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: 2024-11-22 05:27 PM
Hi Everyone
I thought I had a pretty good understanding of ST execution but haven't been able to find the answer to this problem.
I have an ST Logic program which is set to '0s' interval time and is only executed manually from a pushbutton on a mimic (using .execute method on a pick action).
The ST program queries a Data Table, finds a particular value in the table, and then inserts a new record in the table using an INSERT query. This part works fine.
Where the problem starts is if the table is cleared. Clearing the table is done by another pushbutton.
It looks like my %S Variable doesn't update (or query fails on an empty table?) at the beginning of the program because the Tag1 variable remain the same from the last execution.
VAR
Tag1 AT %S(SELECT ........)
END_VAR
If the %S variable is failing or not updating, is there a way I can capture this in the Logic so that I can manually reset my variables to some default values?
This only seems to happen if I clear the whole Data Table. If I just delete some records it works fine.
Thanks.
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: 2024-11-28 05:10 PM
Thanks @AndrewScott . I did have a play around with the VAR NOCACHE because it seemed like the likely solution.
It turned out that when the table was empty the .Value parameter kept the last good value. To solve this I was able to use the .Valid flag to check if the record was 'null' and if it was I would manually set the value to a default number.
Thanks again for your suggestion.
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: 2024-11-25 03:35 AM
Have you tried declaring the variable NOCACHE?
See Using VAR NOCACHE to Prevent Cached Values Being Used in an ST Program in the help.
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: 2024-11-28 05:10 PM
Thanks @AndrewScott . I did have a play around with the VAR NOCACHE because it seemed like the likely solution.
It turned out that when the table was empty the .Value parameter kept the last good value. To solve this I was able to use the .Valid flag to check if the record was 'null' and if it was I would manually set the value to a default number.
Thanks again for your suggestion.
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.