Yeah, I understand how the alarming works (It’s very similar and design and nature to the other HMI packages I’ve used). I used the example of a couple of bits because that’s the simplest example. Well that and from a design standpoint I prefer to do all my alarming in the PLC and translate it to a boolean high = alarm bit for whatever HMI package I’m using to annunciate off of.
To be fair, it’s hit and miss in other HMI packages for this sort of control as well. FactoryTalk does it, but, to my knowledge, Wonderware does not. Not sure about iFix, but I think it does.
Fortunately, I was able to make a button with the following code to acknowledge a specific alarm (Apologies if the comments don’t describe exactly what’s happening, it’s my understanding of what the system is doing)
[code]"""
This script will acknowledge every instance of a specific alarm.
For the purpose of this script, BaseTagName is assumed to be the name of the tag that has an alarm assigned to it.
For example, if the tag 01AIT00201_CL2_BAD had an alarm assigned to it, then the BaseTagName is “01AIT00201_CL2_BAD” (minus the quotes)
“”"
#Get the string value of the BaseTagName custom property
stringval = ‘’.join([event.source.parent.BaseTagName])
#Require operators to confim acknowledgment command
if system.gui.confirm(u’CONFIRM ACKNOWLEDGE COMMAND’, ‘CONFORM’):
#Search the alarm status item for any alarm event that matches the BaseTagName variable
results = system.alarm.queryStatus(path=["*"+stringval+"*"])
# initizalize the loop counter
i = 0
#Iterate trough all the matching alarm events that match the BaseTagName
for item in results:
#convert the result to a Dataset
table = results.getDataset()
#To acknowledge an alarm you much provide the UUID of the alarm. A unique UUID is create for each time the alarm goes active
#this means that 1 alarm can have any number of previous unacknowledged alarm UUIDs out there still. Each unacknowledged alarm
#will create a row in the Dataset table created on the line above. The loop counter will get the UUID for the associate row so
#that it can be acknowledged
uuid = [str(table.getValueAt(i, 'EventId'))]
#Acknowledge the alarm with the associated UUID, log the user who is currently logged in
system.alarm.acknowledge(uuid, system.security.getUsername())
#increment the loop
i += 1
#end of for loop
#end of if statment[/code]
I also realized that I can add a
system.tag.write("[Path]/Tagname_ack_bit",1)
to the Alarm Acknowledged Tag Event to give me a defacto PLC handshake in the meantime 