How best to run a DB query on a timed basis?

When you create a Gateway Tag Change Script you add the tags that the event should be subscribed to. See Tag Change Scripts for a better explanation. Basically, any tag that the event is subscribed to will cause the script to run.

The triggering tag value and path are available from the script so it is a fairly simple task to write a generic script that will execute your query using the specific triggering tags information.

It's hard to say and a lot of it has to do with how intensive the scripts are. I learned this lesson the hard way and spent about a month or so converting numerous valueChange scripts over to Gateway Tag Change Scripts.

Don't misunderstand, valueChange scripts have their uses, but most of the time Tag Change Scripts are superior.

This will provide some understanding on the topic.

1 Like