Hi All!
I've noticed this on quite a few applications. I have a latched tag on the PLC which is used to trigger the execution of a transaction group. I have the transaction group set to reset the trigger after executing and 99% of the time that works. Occasionally though I will find the trigger stuck on and therefore will prevent execution of the transaction group. I have added some event code:
from time import sleep
if currentValue.value == True:
sleep(1)
if system.tag.readBlocking(['[default]XXX/GoodPartRightTrigger'])[0].value == True:
system.tag.writeBlocking(['[default]XXX/GoodPartRightTrigger'],[False])
To manually flip it off if it's stuck on for more than a second, but this seems like a clugey fix. Is there a better way to resolve this issue?
Thanks!
-Kelly
You are probably getting into a race condition with the read/write for OPC. I'm not up on the technical side of things on exactly why.
The way to fix this is to use an integer to trigger, and then have an integer handshake as a response.
So when the trigger happens in the PLC, increment the trigger integer by 1, roll over as needed, and then have the transaction group handshake a value back to a status integer. When you see that handshake to be a specific value, then clear the internal PLC trigger and reset the status.
This kind of race condition is possible any time two different devices write to the same tag in normal operation. The PLC should turn the trigger boolean off, not Ignition (presumably, after it sees the handshake bit). Ignition should turn off its own handshake bit when it sees the trigger boolean turn off. (Use an event script on the trigger tag for this part.)
This is great info, thank you!