Development of reports for device archive in MasterSCADA

Answer:
1. Create an object named 'MyControlM' in the 'Objects' branch of the system tree.

2. Open the ChannelGroup 'System.Workstation.Protocols.Vzljot over TCP.TSR-043 1.ArchiveMonth' in the branches panel (for convenient transfer of channels to 'MyControlM').

1.png

3.Drag the selected channels with the mouse, holding the left button, from the ChannelGroup 'ArchiveMonth' to 'MyControlM'

2.png

Attention! Note that for the created parameters, the value of the 'Archive' property is set to FALSE

3.png

4. Add parameters to 'MyControlM':
a. 'Objects.MyControlM.Start', type 'DT'
b. 'Objects.MyControlM.End', type 'DT'
c. 'Objects.MyControlM.Generate', type 'BOOL'
d. 'Objects.MyControlM.Interval', type TIME

5. Add a report 'Objects.MyControlM.Resources.Reports.Report M' to 'MyControlM'

6. Drag the parameters created by 'dragging' channels in step 3 of this guide with the mouse, holding the left button, from 'MyControlM' to the 'Data_Archive' branch of the report

4.png

7. For the report's 'Data_Archive', on the 'Properties' tab, set the value for the 'Value Generation' property = 'On Change' (it is assumed that all records from the database will be displayed)

5.png

8. For the report's 'Data_Archive', on the 'Properties' tab, set the value for the 'Value Generation' property = 'On Change' (it is assumed that all records from the database will be displayed)

6.png

- after

7.png

9. Move the 'Data Archive' to the page layout.

8.png

10. Select all parameters that we want to see in the report

9.png

11. Save the report.

10.png

12. Link the parameters:
a. 'Objects.MyControlM.Start', type 'DT';
b. 'Objects.MyControlM.End', type 'DT';
c. 'Objects.MyControlM.Interval', type TIME,
to the report parameters: 'Start', 'End', 'Interval'.

11.png

Note the active links after the operations performed in step 8 of this instruction

12.png

13. Create a program to run the report in 'MyControlM'

13.png

14. Set the Initial Value property for 'ReportFB_M' = 'MyControlM.Report M', removing from the value: Objects.MyControlM.Resources.reports.Report M, as written in the instruction

14.png

15. Link 'Report M' to the 'Report' parameter of the 'ReportFB_M' program

15.png

16. Link Objects.MyControlM.Generate to Objects.MyControlM.Resources.Programs.ReportFB_M.Parameters.Report

16.png

17. Run the project in emulation mode and set the parameters for data selection (I created a form for daily control, see Objects.MyControlD):

a. 'Objects.MyControlM.Start' = January 01, 0001, for example
b. 'Objects.MyControlM.End' = tomorrow, for example
c. 'Objects.MyControlM.Generate' = TRUE
d. 'Objects.MyControlM.Interval' - leave unchanged

17.png

18. The report has been created

18.png

19.png

19. Check the output of all records, i.e., for all dates, by creating a query in the database, for example for the parameter 'V1'

select im.id, im.itemid as [Item ID in MasterSCADA 4D project]
, im.Name as [Controlled parameter name]
, dr.value as [Value]
, datetime(dr.source_time / 10000000 -11644473600, 'unixepoch', '+3 hours') as [Время МСК]
, case im.type when 6 then 'SYSTEM_DINT_PARAM' when 11 then 'SYSTEM_LREAL_PARAM' else '' end as [Value type]
from items as im, data_raw as dr
where dr.archive_itemid = im.id
and im.Name like 'System.Workstation.Protocols.Vzljot over TCP.TSR-043 1.ArchiveMonth.V1%'
and dr.layer = 0

20.png

20. To output a report for April, set the parameters as follows:

a. 'Objects.MyControlM.Start' = April 30, 2022, for example
b. 'Objects.MyControlM.End' = April 30, 2022, although, for a report displaying monthly data, I would create a set of controls on the form:
- 'Text Input' for entering the year;
- 'Single/Multiple Selection Tree' for selecting months;
- other elements that will allow generating the report in the required format.

Обсуждение

Log in or register to participate in the discussion.

Thanks! You will be contacted soon.

Write to us
Contact person: 

Request topic 
Message:

Thanks! You will be contacted soon.

Contact manager
Contact person:

Describe the project:

Attach file:

1 pdf/doc/docx file, max 10MB

Thank you for contacting us! The download links have been sent to your email

We invite you to cooperate

Contact person:

Request topic

Message:

Thank you! Your application has been accepted!

Cooperation request
Your cooperation goal with us:
University name:

City:

Education form: 
Contact person:

Thanks! You will be contacted soon.

Send resume
Contact person:

Specify education and specialty:

Short motivation letter: test
Resume file:

1 pdf/doc/docx file, max 10MB
Describe work experience:

Thanks! You will be contacted soon.

Event registration
Contact person:

Thanks! You will be contacted soon.

Get consultation
Contact person:

Describe the project:

<

Thanks! You will be contacted soon.

Start training
Contact person:

Thank you for contacting us! The download links have been sent to your email

Try software

Leave your contact information and we will send you a link and instruction.

You will get access to the demo project.

Contact person:

Comment:

Thank you for contacting us! The download links have been sent to your email

Try software on your model

Leave your contact details - we'll send installation link and instructions.

You can test the software on your information model.

Contact person:

Comment:

Thank you! Your application has been accepted!

Request configuration
Contact person:

<

Number of tags for each MasterOPC copy separated by semicolons (e.g. 500;1000):

Automation object:

Details:

Additional wishes:

Additional documents:

Up to 2 pdf/doc/docx/odt files, max 10MB each

Thank you! Your application has been accepted!

Request configuration
Contact person:

Configuration parameters
Number of external I/O points:
Number of server I/O:
Number of additional clients:
Protocols for lower-level communication:
Operating system in the project:
ToR, block diagram, or other documents:

Up to 2 pdf/doc/docx/odt files, max 10MB each
Additional information:

Thank you! You have successfully registered

Registration is successful

Registration
First name

Field is required

Last name

Field is required

Middle name

Field must not contain digits

Phone

Invalid phone number

E-mail

Invalid email

Company

Field is required

Tax ID (INN)

Password

Field is required

Confirm password

Field is required

Письмо для смены пароля отправлено

Восстановление пароля
E-mail

Invalid email

Вернуться к началу страницы