Gateway Tag Change Scripts Operation?

We have developed a Gateway Tag Change Script that is monitoring 40 Tags and when any tag changes we pass parameters to a Python Routine and do some custom data logging. The tags we are monitoring can change at any time and even possibly at the same time. I’m suspecting that I might be seeing some performance issues since this approach is acting different on different projects.

My question is how the Tag Change Scripts Operate. When a Tag changes is an independent Thread launched and then the Change Script Continues to Monitor the other tags to call the Python code or is there a queue that needs to be processed? Is it more efficient and faster to have 40 Independent Change Scripts calling the Python Code Independently?

Any Feedback on how this works will be helpful since the Logging on this project is extremely critical that it is done quickly and then we handshake back to the PLC so the process can move on.

Thank you,

Bruce Gibbens

Tag change scripts run in threads from an expandable thread pool, so multiple scripts can run at the same time without blocking while other scripts finish.

That being said, each script ‘instance’ you have, however many tags it’s setup to listen for, will run in serial.

In other words, if all 40 of your tags change at once, your script will run 40 times, no guarantee to the order, in quick succession.

Thanks for the information. This is what I suspected is my probelm. We will break up the change scripts and test it.

Best Regards,

Bruce Gibbens