In my Gateway Tag Change Event Scripts I use
if not initialChange:
to prevent the script running after a script change or tag change. And it works well for this. If I don’t use this, the script will run when it shouldn’t.
However, if the gateway is restarted, it also prevents the script running the first time its triggered. In this case I do want it to fire, and this is causing problems. Subsequent triggers run fine after this.
For example, if the gateway is restarted and 4 hours later the event is triggered for the first time since the restart, the initialChange line will prevent it from running.
How do I prevent it running on a script change or tag change, and allow it to run the first time it’s triggered after a gateway restart?
Note: This is on version 8.0.6