Hi, I am having some trouble with gateway scripting. I have some tag change events that are running through specific tags (Tag-> Tag Events->Value Changed) that work perfectly. However, when I use the exact same code in the gateway scripting console ( Gateway Event Scripts → Tag Change ) it doesn’t execute when the specified tag changes value. Im not sure if there is a different way of scripting in the gateway console, or if there is something I am missing, but any help would be appreciated!
I have written a tester code, which works fine through tag events but does not execute at all in the gateway script:
[.] means "use the tag provider local to this tag - it only works when you’re on an actual tag. Use [~] to refer to the project’s default tag provider (note that this will only work in gateway tag change scripts like this, and will not work from tag event scripts. Or, omit all relative references and hardcode the provider: [default] (or whatever your realtime tag provider is actually named).
Gateway tag change event scripts have access to the tag path and related properties for the tag that changed–you can programmatically construct a tag path relative to that.