Prevent gateway tag change script from running on startup


Is there any way to prevent a gateway tag change script from running on startup? The issue is that every time I save my changes in the designer, it restarts the gateway scripts and although the tag value hasn’t changed, the gateway tag change script gets ran. The only change trigger active is the value checkbox.


No, but you can check the initialChange flag, which should be set the first time the script runs after startup or after a save or edit.


Thanks Kevin, that’s perfect!

if not initialChange:
    # run script here

IIRC, there’s a small window of time during the updates to the project where the old change event is disconnected and the new one is set up. I consider the initialChange flag to be a hint that it might not have changed, and examine reliable state (DB, usually) to verify. When a lost event matters, that is.

1 Like

Hey trying this now on 8.1.23 and the change script is still executing on gateway startup, possible bug or am I missing something?