"Tag Change" gateway event script vs "Value Changed" tag value event

Yes, it is very real.

Not only is the valueChange script queue bounded to 5 per tag, but there is also a bounded thread pool, such that only 3 scripts can run at one time. This adds to the possibility of queue sizes building up and eventually discarding events that are pushed out of the queue.

valueChange events should never run long running tasks, and should not run longer latency tasks such as interfacing with databases.

Yes, to an extent, each event in the queue is executed in order prior to the next event being processed, for all tags assigned to that Gateway Tag Change Event. You can split different changes across multiple threads (allowing asynchronous execution) by defining multiple change events. So in this case you will want to author your script to be generic and assign all tags to that event.

For reference:

I would also recommend that you look into the initialChange flag.

1 Like