I have many alarms that are defined at the UDT level and some can be enabled/disabled and delay adjusted by the operators as needed.
I would also like a way to provide the current alarm configuration for each alarm that could be active (i.e. whether it's enabled or not, what the current delay is, and what the alarm pipeline is).
This sounds like a job for a python script to iterate through every tag and create a table with the desired information, but I'm not exactly sure where to start. I also know that this will be a heavy task, but it will be run via pushbutton so not run very often.
I think your best bet is to use the system.tag.query function (see the tag report tool), make sure to configure it to "Alarm(s) configured" (again you can use the tag report tool and copy the script and just paste it where needed).
From there, when doing it like so, you can loop through the results and use something like below:
# here the query argument for the function below
# is the dictionary given by the tag report tool
results = system.tag.query(provider, query)
for tag in results:
for alarm in tag["alarms"]:
#here do whatever you want with your alarm
Doing so, you can then append your alarm to a list, then return the list and pass it to a Table component.
There are a bunch of properties for the Alarm Mode but there is no actual mode. It should be "Below Setpoint" but I do not see anything to point me in that direction. The three parameters needed for a Below Setpoint alarm (Setpoint, Inclusive, Any Change) are defined. Anyone have an idea? TIA
I haven't exported this info, but is "setpointA" maybe the actual mode, but just not named intuitively? Have you tried setting up one for "Above Setpoint" to see what changes?
Keep in mind that if you edit alarms within UDT instances the entire alarm will be overridden, which makes using UDTs someone useless.
Even if you edit manually the alarm will be overridden. The only way that I'm aware of to make this work is create tags outside of the alarm and bind these to the alarm props. Then you can edit those props manually or programmatically.
But those will only update on an alarm event. That is, if the alarm is inactive, and you change the a tag that a setpoint is bound to, the next alarm will be with the old setpoint.
If you want alarming on dynamic values, make a boolean expression tag that turns true at the appropriate time, and make that boolean your alarm.
Not enable either, enable is also bound to a tag and while the alarm is active I can edit this tag as well and it updates. I don't ever bind to the setpoint since all of my alarms are BOOL and trigger high.