Tag change scripts firing when tag properties edited

How can I prevent gateway tag change scripts from executing when the tag properties are edited? Conditioning with not initialChange and previousValue.value != currentValue.value is not effective. Thanks.

Ignition 7.9.8

1 Like

I created a tag ( Memory Tag ), used it as trigger for a tag change script ( inside Gateway Events Scripts ).
Inside my page I have a button that changes a property of this tag ( EngHigh ), but when I click it, no script is fired.
I tried all the combination for “Change Triggers” ( the options Value, Quality, Timestamp ) but still nothing.

1 Like

In case it’s not clear, try using Gateway Tag Change Event Scripts, not Tag Events. { There are many other good reasons, too. }

2 Likes

Thanks, this is good information. This may be the case for scripted changes, but right-clicking on a tag to enter the tag editor and clicking OK (whether or not any changes have been made) will fire the tag change script.

Thanks Phil. I have not noticed a difference and in fact in this case I am using a gateway event script triggered by a tag change (I should note that I have only selected ‘Value’ as the change trigger). Maybe this is not too big of an issue. It was only a problem for me after creating and re-assigning some scan classes which ultimately created a fair amount of bad data needing to be cleaned up. If there is a method to prevent this I would add it to my common script header.

This is because the Tag gets refreshed. It’s something like its value goes from something (your value) to NULL to something (your value). This is seen as a value change so the scripting event will fire.

This is a good point. Ok, so I achieved the result I wanted by adding the condition previousValue.value is not None and currentValue.value is not None. This prevents the tag change script from running when the tag editor is saved and closed.

2 Likes