EcoStruxure Geo SCADA Expert Forum
Schneider Electric support forum about installation, configuration, integration and troubleshooting of EcoStruxure Geo SCADA Expert (ClearSCADA, ViewX, WebX).
Link copied. Please paste this link to share this article on your social media post.
Posted: 2019-10-25 03:38 PM . Last Modified: 2023-05-03 12:39 AM
>>Message imported from previous forum - Category:ClearSCADA Software<<
User: florian, originally posted: 2018-10-24 19:38:40 Id:193
This is a re-posting from the obsoleted (October 2018) "Schneider Electric Telemetry & SCADA" forum.
------------------
**_neilj:_**
**_I have 7 Crystal Reports to Export when the user clicks a button. However, a Button can only have one Pick Action method (which was how the CR Training Course did it), so I'm thinking of using Structured Text logic to call the Export method for each report.Can anyone give an example of the code required to declare each of the Crystal Report objects and call the Export method?_**
**_...or is there an easier way? (i.e. not using a script/logic)_**
--------------------
AWoodland:
Logic is probably best, less to worry about about what happens if your client connection goes down mid way through the process. Some example code:
PROGRAM GenerateReport
METHOD
Report1 AT %M(.Crystal Report 1.Export);
Report2 AT %M(.Crystal Report 2.Export);
END_METHOD
Report1();
Report2();
END_PROGRAM
What you want to do after all 7 are generated might make it somewhat easier to do in scripting...
----------------------------
**_neilj:_**
**_Thanks for the pointers Adam.The final code I created, with "Date From" and "Date To" values that all the Crystal Reports will use, is:_**
**_PROGRAM ExportReports_**
**_METHOD_**
**_Report_01 AT %M(.DV01 - Inflow Vol.Export) : DATE, DATE;_**
**_Report_02 AT %M(.DV02 - Total Inflow Vol.Export) : DATE, DATE;_**
**_Report_03 AT %M(.DV03 - Target Discharge Vol.Export) : DATE, DATE;_**
**_Report_04 AT %M(.DV04 - Actual Discharge Vol.Export) : DATE, DATE;_**
**_Report_05 AT %M(.DV05 - Discharge Vol Diff.Export) : DATE, DATE;_**
**_Report_06 AT %M(.DV06 - Discharge Vol Breach.Export) : DATE, DATE;_**
**_END_METHOD_**
**_VAR_**
**_start_date AT %M(...Report Start Date.CurrentValue) : DATE;_**
**_end_date AT %M(...Report End Date.CurrentValue) : DATE;_**
**_END_VAR_**
**_Report_01(start_date,end_date);_**
**_Report_02(start_date,end_date);_**
**_Report_03(start_date,end_date);_**
**_Report_04(start_date,end_date);_**
**_Report_05(start_date,end_date);_**
**_Report_06(start_date,end_date);_**
**_END_PROGRAM_**
-------------------
ejme:
Can you generate more than four crystal repots using logic?
I seem to have hit a limitation and can only successfully generate 4 reports in a structured text logic program, is there are reason for this?
Note: I am using ClearSCADA 2015 R2
-------------------
AWoodland:
How long do those four reports take to execute? If they take too long then anything else on the stack (they all get added at the same time) will be canned.
I think the time is 15 mins before they get cancelled
----------------
trantereng:
Did you get this ST program to work correctly? I am trying something similar - using an aggregate Control method to write a MODBUS register to multiple devices based on a button click.
But I am getting a compile error with my ST program?
Compile error: at line: 8, column: 9; unique expected
The program compiles and runs correctly when I declare and call a single method but not when I have multiple?
PROGRAM AlarmReset
METHOD
(*declare Alarm Reset Command Methods for Comap, PowerStore and Solar Inverters*)
COMAP_RST AT %M(BSS.STAT.Cmd_Alarm_Reset.Control.Control):BYTE;
6_E01_RST AT %M(BSS.6.E01.Cmd_Alarm_Reset.Control.Control):BYTE;
6_E02_RST AT %M(BSS.6.E02.Cmd_Alarm_Reset.Control.Control):BYTE;
1_E01_RST AT %M(SPS.1.E01.Cmd_Alarm_Reset.Control.Control):BYTE;
1_E02_RST AT %M(SPS.1.E02.Cmd_Alarm_Reset.Control.Control):BYTE;
2_E03_RST AT %M(SPS.2.E03.Cmd_Alarm_Reset.Control.Control):BYTE;
2_E04_RST AT %M(SPS.2.E04.Cmd_Alarm_Reset.Control.Control):BYTE;
3_E05_RST AT %M(SPS.3.E05.Cmd_Alarm_Reset.Control.Control):BYTE;
3_E06_RST AT %M(SPS.3.E06.Cmd_Alarm_Reset.Control.Control):BYTE;
4_E07_RST AT %M(SPS.4.E07.Cmd_Alarm_Reset.Control.Control):BYTE;
4_E08_RST AT %M(SPS.4.E08.Cmd_Alarm_Reset.Control.Control):BYTE;
5_E09_RST AT %M(SPS.5.E09.Cmd_Alarm_Reset.Control.Control):BYTE;
5_E10_RST AT %M(SPS.5.E10.Cmd_Alarm_Reset.Control.Control):BYTE;
(*declare Start Command Methods for PowerStore and Solar Inverters*)
6_E01_START AT %M(BSS.6.E01.Cmd_Start.Control.Control):BYTE;
6_E02_START AT %M(BSS.6.E02.Cmd_Start.Control.Control):BYTE;
1_E01_START AT %M(SPS.1.E01.Cmd_Start.Control.Control):BYTE;
1_E02_START AT %M(SPS.1.E02.Cmd_Start.Control.Control):BYTE;
2_E03_START AT %M(SPS.2.E03.Cmd_Start.Control.Control):BYTE;
2_E04_START AT %M(SPS.2.E04.Cmd_Start.Control.Control):BYTE;
3_E05_START AT %M(SPS.3.E05.Cmd_Start.Control.Control):BYTE;
3_E06_START AT %M(SPS.3.E06.Cmd_Start.Control.Control):BYTE;
4_E07_START AT %M(SPS.4.E07.Cmd_Start.Control.Control):BYTE;
4_E08_START AT %M(SPS.4.E08.Cmd_Start.Control.Control):BYTE;
5_E09_START AT %M(SPS.5.E09.Cmd_Start.Control.Control):BYTE;
5_E10_START AT %M(SPS.5.E10.Cmd_Start.Control.Control):BYTE;
END_METHOD
(*call Alarm Reset Methods for Comap, PowerStore and Solar Inverters with 500 ms delay between each method call*)
COMAP_RST(1);
SLEEP(500);
6_E01_RST(1);
SLEEP(500);
6_E02_RST(1);
SLEEP(500);
1_E01_RST(1);
SLEEP(500);
1_E02_RST(1);
SLEEP(500);
2_E03_RST(1);
SLEEP(500);
2_E04_RST(1);
SLEEP(500);
3_E05_RST(1);
SLEEP(500);
3_E06_RST(1);
SLEEP(500);
4_E07_RST(1);
SLEEP(500);
4_E08_RST(1);
SLEEP(500);
5_E09_RST(1);
SLEEP(500);
5_E10_RST(1);
SLEEP(500);
(*call Start Command Methods for PowerStore and Solar Inverters with 500 ms delay between each method call*)
6_E01_START(1);
SLEEP(500);
6_E02_START(1);
SLEEP(500);
1_E01_START(1);
SLEEP(500);
1_E02_START(1);
SLEEP(500);
2_E03_START(1);
SLEEP(500);
2_E04_START(1);
SLEEP(500);
3_E05_START(1);
SLEEP(500);
3_E06_START(1);
SLEEP(500);
4_E07_START(1);
SLEEP(500);
4_E08_START(1);
SLEEP(500);
5_E09_START(1);
SLEEP(500);
5_E10_START(1);
END_PROGRAM
-------------------------------
AWoodland:
It doesn't like the number as the first character of the method name, change that and it should compile.
The error message is perhaps unhelpful in this case 🙂
--------------------------
trantereng:
Ok awesome thanks very much!
Link copied. Please paste this link to share this article on your social media post.
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.
With achievable small steps, users progress and continually feel satisfaction in task accomplishment.
Usetiful Onboarding Checklist remembers the progress of every user, allowing them to take bite-sized journeys and continue where they left.
of