There is an initialChange flag, but it isn’t accessed the same way.
Here is the 8.1 manual listing:
https://docs.inductiveautomation.com/display/DOC81/Gateway+Event+Scripts
There is an initialChange flag, but it isn’t accessed the same way.
Here is the 8.1 manual listing:
https://docs.inductiveautomation.com/display/DOC81/Gateway+Event+Scripts
Well, that's good to know, I guess checking for None is essentially the same thing, but more painful!
I'm under the impression that event handlers are designed to automatically execute in response to certain events. Therefor, in this case the tagChange
function would execute whenever a tag change event occurs in the Ignition system. So, even though the tagChange
function is not being called in the script, it's being called by Ignition whenever a tag change event occurs. To my understanding, this is why you can put logic inside the tagChange
function to respond to tag changes, and Ignition will automatically execute that logic.
If I'm wrong about this, thank you for correcting me.
You assign a trigger tag to the event, once a change event is detected the script defined inside of the script tab is executed. From there the script is executed just as any jython would.
I’m working under the assumption that the new script you provided is inside of the script tab. If that is indeed the case then you have defined a function inside of that script and it isn’t being called, therefore none of the code within its scope is being executed.
For instance this code inside of that script tab will do nothing:
def tagChange(event):
for i in range(10):
print I
Well, not nothing technically. It'll define the function, but then nothing else. It won't be called/executed
To eliminate any confusion, a screenshot of the code editor and what your code looks like within it would be helpful in this case.