We have a set of devices that store events and increment a tag that tracks the number of events currently in a queue (we call them indexes).
In a production world, these events needs to be unloaded one at a time from the PLC, controlled by a few tags to form a sort of handshake between the PLC and Ignition. The most important is one that we call a “Ready Flag” that indicates whether or not work is ready to be done. (This is used by the device, so False = work is not ready to be done by the device)
We’re using a set of Gateway tag change scripts that need to trigger when a given Index changes. Once inside the script, we make sure the Index is above zero (occasionally, the PLC will write 0 to these tags) and we check to see if the Ready flag is false, which indicates work can be started.
The issue that we’re running into now is that if more events occur while processing is happening (i.e. the index increases while the Ready flag is True) this does not trigger an event, as intended, however once the processing is done and the Ready flag is set to False, no more events are processed unless the index increases again. This essentially resets the cycle, however.
First thing we tried was setting the tag group to Polled and allowing the tag change script to trigger on a timestamp change. This doesn’t seem to work because Ignition only updates the timestamp if the value has changed.
My question to the infinite wisdom of pturmel and the other forum helpers is: Is there a way to make this current implementation work?
Things I have tried:
- system.tag.requestGroupExecution
- Enabling “Include Timestamp-only changes”
- Changing to a Driven, One-shot/“Any Change” tag group
Thanks in advance!