What comes first, Tag Change Script or Alarms?

Hey Everyone,

I'm trying to troubleshoot an issue, and it sparked a question. I'll start with the issue. Right now, we have a tag in the PLC that is called PrintFlag.bitx, and when that bit turns on by the PLC, there's an alarm that triggers and it pulls information from other tags and stores it in a string in an alarm journal. However, there's a tag change script that as soon as the bit turns 1, it writes back 0 to the tag. In our alarm journal database, we can't find an instance that an alarm fired and went to the database, but it really should have or we would've seen more issues with the machine.

So now to my question, can a tag change script, on the tag itself, change the value of a tag before an alarm is triggered?

I can't find documentation on the order of how all the events around a tag change are ordered. I'm guessing that the alarm is triggered before any tag change happens, but I would like to ensure that it can't. I'm in a regulated industry, so any specs around how ignition does its locks or mutexs on a tag change would be very helpful

Thank you!

Technically, the alarm subsystem would see the value in the tag actor pipeline first, but both alarms and scripts have various buffers and dwells and queues that make them pseudo-parallel operations.

You really should not be turning off the bit with a script--writing a tag from two directions (PLC and Ignition) is a great way to miss handshakes. Ignition should write to a separate bit in the PLC that the PLC can use to turn off the alarm bit. (And then Ignition would turn off the clear bit--don't have the PLC clear it.)

Also:

Tag data delivery from OPC is not ordered, so such an alarm journal use of aux data will likely have stale data. Such operations should be scripted to use system.opc.read*() to guarantee the aux data is retrieved after the trigger, before sending to a DB.

I agree. There's a lot of issues with this project. There's a reason why I'm trouble shooting lol. I'll take notes of these, when we decide to upgrade these pieces of equipment