Ignition 7 Difference between a Gateway Tag Change Script and Tag Event Scripts

Is there any difference in the way that a tag change script is run/triggered if you place it in the “Gateway Event Scripts > Tag Change Script” versus a “Tag Event Script > Value Changed”? Other than the fact that a gateway event script can be triggered by multiple tags.

I want to know in general the difference, but also which may be more efficient.

For my specific purpose, I am collecting different datasets from a SQL server, but I do not have permission to make any changes to the server (read-only). I need to capture timestamps when these values change in this server. I have a UDT with 6 Query Tags collecting the datasets and will insert timestamps into a database on a different server that I am able to write to. Ideally, I wouldn’t use Ignition and would communicate directly with the servers, but I have absolutely no access to the originating server other than through Ignition.

I have thought of using a transaction group for this, but I have to do scripting in order to get the correct inserted values. Now, I am looking at either triggering the value changed scripts in the gateway event scripts or in a tag event script.

Consider using a single gateway timer event script in place of the six query tags, and just run the insert queries from that same script.

Yes, that would be a better way to run the queries.

My question still stands though. What is the difference between gateway tag change scripts and tag event scripts? Other than perhaps storage location.

Gateway tag change event scripts are part of a project. And can therefore call project.* scripts. And can be enabled/disabled independently of the functioning of the tag. And can be disabled in bulk by disabling the project they’re in. And a single script can listen to many tags.

A tag event is part of the tag and applies to just the one tag. They can call scripts in the shared.* namespace, but remember that editing shared scripts and saving resets scripting in all projects and prompts for client updates for all projects.

Tag events can be defined on elements of a UDT, which makes all instances use that code. That is the only way to use tag events without either repeating oneself all over the place (maintenance nightmare) or suffering through project resets while developing (production nightmare).

1 Like