Report generation for Masterscada

I will tell you about the reporting system we developed and implemented on one of the dispatch objects. At the end of all the work, the Customer had a need for reports, which were previously discussed, but rather as something secondary. In fact, this is quite a responsible link in the system, since it carries the economic component - numbers. All data in the tables is requested by sampling by dates from the SQLite database, processed by FBScript and displayed in forms developed in Visual Studio.

The implementation of the reports began with the fact that the Customer, at the end of the general NDP, gave us seven interconnected tables, which were to be interactively recalculated and memorized.

Obviously, this is the task of the application (script) when dealing with a sample of any database. Mastercade has its own database, but there was no paid tool for accessing it and we had to create an application, create our own database and DBMS on SQLite. Masterskada, of course, has its own master of creating reports, but, having examined it, it was decided to develop its own subroutine, allowing it to respond flexibly to any requests of our Customer. This decision was dictated by the need to inherit this reporting system to any other SCADA systems.

A master script was written in Masterskad that runs once a second, polls the variables and stores them in SQLite. Visualization (report forms) were developed in Visual Studio 2017. Report forms select the necessary data from the database (for a specific month) and form a table for display. The DB at Masterskada is not closed, but we have a difficulty in pre-purchasing the tool for working with this DB itself. The fact is that the Customer and the integrator did not know that it was necessary to purchase the application for Masterskada, which would allow working with the database (recording data for further processing). By that time, the money was already coordinated and no one was going to buy anything - I had to develop my application.

With the choice of the DBMS (the DBMS is a program for working with the database), I also had to tinker. There were difficulties associated with the features of the operating system Windows 7 and not very advanced computer configuration. Everything had to be fairly optimized to ensure the stable operation of the system.

Why choose SQLIte? The entire database consists of a single data file, which ensures the highest level of portability, i.e. nothing needs to be installed on the computer. I created a database, threw it into the project - and everything works perfectly, no need to put any server + we have a small load, there are no huge amounts of data.

It turned out that the possibility of ActiveX output is present in Masterskad, this allowed to place reports directly in the format of mnemonic diagrams, without going beyond the limits of the application using operator rights. Mastercade allows you to connect custom components / interfaces written in Visual Studio. The principle of operation is quite simple: visualization is written in Visual Studio - our reports, the library is assembled - dll, and then this dll is simply connected in Masterskad via ActiveX. Then the written user interface is dragged with the mouse in Masterskad to the right place. Thus, using Visual Studio tools, you can finish the Masterscade functionality well.

For comparison, SimpleScada and Teslascada do not have the possibility of adding OLE-objects to the project, which makes these software products not applicable for the implementation of this approach.

As a result, two databases were used on the computer. One for graphs and events (internal Masterskady functions), the second for the reporting system. DBMS act independently from each other, in different threads.

There were difficulties in the fact that Masterskad occasionally fell off and had to pretty much dig in the settings, before we achieved steady work and application of reports, and Masterskada itself. Quite difficult was the data processing at the beginning of the day, month, year. The fact is that in the calculations it was necessary to take into account the discharges of the integral indicators of metering devices, the shutdown of a computer or a SCADA system, as well as various factors, including human, like short-term starts of pumps.

It was also created the ability to display reports on a connected laser printer, saving a report (sample) for a specified period of time on disk.

The technical task was agreed upon in appearance, it is about seven tables in MS Word.


Report structure. How software components interact with each other, how things work

Appearance of report windows, including a general report navigation window, monthly reports and final annual reports.











I would be glad if you express criticism, suggestions, questions in the "comment"

#Reports, #Masterscada, #Insat, #SQLite, #VisualStudio, #ActiveX, #DBMS, #monthly, #Excel, #SCADA
Russian version
    [ID] => 377
    [IBLOCK_ID] => 1
    [NAME] => Reports on SCADA
    [IBLOCK] => Array
            [ID] => 1
            [~ID] => 1
            [TIMESTAMP_X] => 18.04.2022 02:37:10
            [~TIMESTAMP_X] => 18.04.2022 02:37:10
            [IBLOCK_TYPE_ID] => EN
            [~IBLOCK_TYPE_ID] => EN
            [LID] => s2
            [~LID] => s2
            [CODE] => articles
            [~CODE] => articles
            [API_CODE] => 
            [~API_CODE] => 
            [NAME] => Articles
            [~NAME] => Articles
            [ACTIVE] => Y
            [~ACTIVE] => Y
            [SORT] => 10
            [~SORT] => 10
            [LIST_PAGE_URL] => /articles/
            [~LIST_PAGE_URL] => /articles/
            [DETAIL_PAGE_URL] => /articles/#ELEMENT_CODE#.html
            [~DETAIL_PAGE_URL] => /articles/#ELEMENT_CODE#.html
            [SECTION_PAGE_URL] => 
            [~SECTION_PAGE_URL] => 
            [CANONICAL_PAGE_URL] =>
            [~CANONICAL_PAGE_URL] =>
            [PICTURE] => 
            [~PICTURE] => 
            [DESCRIPTION] => 
            [~DESCRIPTION] => 
            [DESCRIPTION_TYPE] => html
            [~DESCRIPTION_TYPE] => html
            [RSS_TTL] => 24
            [~RSS_TTL] => 24
            [RSS_ACTIVE] => Y
            [~RSS_ACTIVE] => Y
            [RSS_FILE_ACTIVE] => N
            [~RSS_FILE_ACTIVE] => N
            [RSS_FILE_LIMIT] => 
            [~RSS_FILE_LIMIT] => 
            [RSS_FILE_DAYS] => 
            [~RSS_FILE_DAYS] => 
            [RSS_YANDEX_ACTIVE] => N
            [~RSS_YANDEX_ACTIVE] => N
            [XML_ID] => 
            [~XML_ID] => 
            [TMP_ID] => 
            [~TMP_ID] => 
            [INDEX_ELEMENT] => Y
            [~INDEX_ELEMENT] => Y
            [INDEX_SECTION] => N
            [~INDEX_SECTION] => N
            [WORKFLOW] => N
            [~WORKFLOW] => N
            [BIZPROC] => N
            [~BIZPROC] => N
            [SECTION_CHOOSER] => L
            [~SECTION_CHOOSER] => L
            [LIST_MODE] => 
            [~LIST_MODE] => 
            [RIGHTS_MODE] => S
            [~RIGHTS_MODE] => S
            [SECTION_PROPERTY] => N
            [~SECTION_PROPERTY] => N
            [PROPERTY_INDEX] => N
            [~PROPERTY_INDEX] => N
            [VERSION] => 1
            [~VERSION] => 1
            [LAST_CONV_ELEMENT] => 0
            [~LAST_CONV_ELEMENT] => 0
            [SOCNET_GROUP_ID] => 
            [~SOCNET_GROUP_ID] => 
            [EDIT_FILE_BEFORE] => 
            [~EDIT_FILE_BEFORE] => 
            [EDIT_FILE_AFTER] => 
            [~EDIT_FILE_AFTER] => 
            [SECTIONS_NAME] => 
            [~SECTIONS_NAME] => 
            [SECTION_NAME] => 
            [~SECTION_NAME] => 
            [ELEMENTS_NAME] => Элементы
            [~ELEMENTS_NAME] => Элементы
            [ELEMENT_NAME] => Элемент
            [~ELEMENT_NAME] => Элемент
            [REST_ON] => N
            [~REST_ON] => N
            [EXTERNAL_ID] => 
            [~EXTERNAL_ID] => 
            [LANG_DIR] => /
            [~LANG_DIR] => /
            [SERVER_NAME] =>
            [~SERVER_NAME] =>

    [LIST_PAGE_URL] => /articles/
    [~LIST_PAGE_URL] => /articles/
    [SECTION_URL] => 
    [SECTION] => Array
            [PATH] => Array


            [ELEMENT_PREVIEW_PICTURE_FILE_NAME] => reports on scada
            [ELEMENT_META_KEYWORDS] => Reports, Masterscada
            [ELEMENT_META_TITLE] => Reports for Masterscada
            [ELEMENT_META_DESCRIPTION] => Brief description of the system for outputting reports on the commercial accounting of consumed water
            [ELEMENT_PAGE_TITLE] => Report generation for Masterscada
            [SECTION_META_TITLE] => Automation articles 
            [SECTION_META_KEYWORDS] => Automation, Articles 
            [SECTION_META_DESCRIPTION] => I met something worthy of attention during the work. It is difficult to assess the necessity of posting this or that article, I tried to clean up the obvious garbage
            [SECTION_PAGE_TITLE] => Here I published articles that may be useful to someone in the production of work

    [TIMESTAMP_X] => 16.11.2021 06:40:17
    [META_TAGS] => Array
            [TITLE] => Report generation for Masterscada
            [BROWSER_TITLE] => Reports for Masterscada
            [KEYWORDS] => Reports, Masterscada
            [DESCRIPTION] => Brief description of the system for outputting reports on the commercial accounting of consumed water

    [PREVIEW_TEXT] => The implementation of the reports began with the fact that the Customer, at the end of the general NDP, gave us seven interconnected tables, which were to be interactively recalculated and memorized. 
    [PREVIEW_PICTURE] => Array
            [ID] => 983
            [TIMESTAMP_X] => Bitrix\Main\Type\DateTime Object
                    [userTimeEnabled:protected] => 1
                    [value:protected] => DateTime Object
                            [date] => 2021-11-16 06:40:17.000000
                            [timezone_type] => 3
                            [timezone] => Europe/Moscow


            [MODULE_ID] => iblock
            [HEIGHT] => 447
            [WIDTH] => 767
            [FILE_SIZE] => 46297
            [CONTENT_TYPE] => image/jpeg
            [SUBDIR] => iblock/8c7
            [FILE_NAME] => reports.jpg
            [ORIGINAL_NAME] => reports.jpg
            [DESCRIPTION] => Reports on C#
            [HANDLER_ID] => 
            [EXTERNAL_ID] => a44096ddb4f8fdaf358bbadec4660513
            [~src] => 
            [SRC] => /upload/iblock/8c7/reports.jpg
            [UNSAFE_SRC] => /upload/iblock/8c7/reports.jpg
            [SAFE_SRC] => /upload/iblock/8c7/reports.jpg
            [ALT] => Reports on SCADA
            [TITLE] => Reports on SCADA

    [DETAIL_PAGE_URL] => /articles/reports.html
Ваш комментарий добавлен

Возврат к списку