12/18/2024 7:24 AM | |
Joined: 1/21/2013 Last visit: 2/10/2025 Posts: 3526 Rating:
|
Hi Mr_Prof, Since I doubt you want to get the number of alarms with just one click, an automatic update is needed. Calling your script example with a cyclic trigger is not recommended, as it may cause a high load on your system. Since your script does not use screen items and assuming that the two tags used are system-wide tags, the best solution in my opinion would be to use a scheduled task triggered by the system tag @SystemActivationState and an alarm subscription within that task. As an example, I have created a scheduled task named 'AlarmCounter' with the 'Taggs' trigger configuration and the @SystemActivationState trigger tag mentioned above. This is done because the alarm subscription script only needs to be run when the runtime is started. For the task event, switch from the function list to the script and add the following line to the global definition:
The script function itself should look like this:
Kind regards |
This contribution was helpful to
2 thankful Users |
12/19/2024 9:01 AM | |
Joined: 8/3/2009 Last visit: 2/10/2025 Posts: 14693 Rating:
|
Hello Mr_Prof similar to the solution of Stefan also in the Toolbox there is a alarm indicator which acts similar: https://support.industry.siemens.com/cs/de/en/view/109770480 Bye Murof |
If this Information really helps, you could use the Rate function |
|
This contribution was helpful to
1 thankful Users |
1/10/2025 6:35 PM | |
Joined: 7/5/2021 Last visit: 2/10/2025 Posts: 164 Rating:
|
write() should be in upper case: Write() |
This contribution was helpful to
1 thankful Users |
Follow us on