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-11-26 02:09 PM . Last Modified: 2023-05-03 12:21 AM
>>Message imported from previous forum - Category:Scripts and Tips<<
User: hemanth, originally posted: 2019-10-08 11:28:11 Id:534
Hi,
I have created a data table [TEST1_TABLE] in clearscada with Index1,val1,val2 all INT type.
Inserted few rows using INSERT command.
Is it possible to extract number of rows to an internal variable in ST to perform some calculation! I have been trying the following code to extract rows from DataTable but not successful in transferring to internal variables [ Rec_count,val1,val2]
IS TEHRE A WAY TO GET ROWS?
TYPE Records:
STRUCT
Index1:INT;
val1:INT;
val2:INT;
END_STRUCT;
END_TYPE
PROGRAM SQL_EXTRACT
VAR
pump1data :Records;
END_VAR;
VAR
Rec_count :INT;
val1 :INT;
val2 :INT;
END_VAR;
VAR
Test1 AT %S(Select Index1,val1,val2 FROM TEST1_TABLE WHERE Index1 = 2):RESULTSET OF RECORDS;
END_VAR;
IF Test1.Valid = TRUE THEN
Rec_count := pump1data.Index1;
val1 := pump1data.val1;
val2 := pump1data.val2;
END_IF;
END_PROGRAM
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2019-11-26 02:10 PM
>>Responses imported from previous forum
Reply From User: geoffpatton, posted: 2019-10-08 20:41:59
I think it is Test1.Size is the number of rows
Reply From User: hemanth, posted: 2019-10-10 03:54:32
Thanks..
following link provides more info...
https://www.citect.schneider-electric.com/scada/clearscada/help/2017/Content/LogicGuide/UsinganSTPro...
Link copied. Please paste this link to share this article on your social media post.
Link copied. Please paste this link to share this article on your social media post.
Posted: 2019-11-26 02:10 PM
>>Responses imported from previous forum
Reply From User: geoffpatton, posted: 2019-10-08 20:41:59
I think it is Test1.Size is the number of rows
Reply From User: hemanth, posted: 2019-10-10 03:54:32
Thanks..
following link provides more info...
https://www.citect.schneider-electric.com/scada/clearscada/help/2017/Content/LogicGuide/UsinganSTPro...
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