Since there is no "auto-only" ack mode (i.e. alarm cannot be acknowledged except by the system, automatically when it clears) I am wanting to reset this alarm to unack'd when it is ack'd and still active.
My first thought was to add an alarmAcked() script to the tag that checks the status to see if it's still active and then re-unack's it, but I'm not exactly sure how to set the alarm status back to unack'd.
Maybe there's a better way to do this with a derived tag and some other tag event scripting.
Can't say I've ever had an operator request wanting to unack an alarm. My first thought though would be you could trigger restarting the tag or disabling/enabling the alarm so it comes in again but that would change the active time and a new entry in the alarm journal.
Think I figured out a pretty simple way around this. Requires 1 extra memory tag and 3 tag change scripts.
For some context, there's a pushbutton that operators press when testing the generator so that the generator PLC doesn't run it's code. I am setting up a diagnostic alarm that I want to always be active and unack'd while the PB is in the "testing" mode so that operators are reminded that it is still testing.
2 tags
a. PB tag
b. PB alarm tag
No alarm on the PB tag
Tag change script on the PB tag that writes value to the PB alarm tag
Alarm on the PB alarm tag (diagnostic, equal to 1)
alarmAcked() script on the PB alarm tag to set it's own value back to 0 (clears the acked status and triggers the next script.
valueChanged() script on the PB alarm tag to check the PB tag value and set the value back to 1 if the PB is still active (retriggers the alarm). If not active, that means it was auto-acked when the PB was toggled back to 0.
def valueChanged(tag, tagPath, previousValue, currentValue, initialChange, missedEvents):
if currentValue.value == 0:
pbActive = system.tag.readBlocking("[.]Generator_Test_Pushbutton")[0].value
if pbActive:
system.tag.writeBlocking([tagPath], [1])
The only potential side effect here is if someone tries to ack it over and over again while it's active it will have extra entries in the alarm history, but at least it's only diagnostic so it can easily be filtered out.