That is a tag's valueChange
event, which is not a safe place to use any system.opc.*
functions--you risk locking up all tag event processing. Similarly, it isn't safe to do DB operations either, except for fire-and-forget inserts through the Store and Forward system. Finally, it is usually racy to use a single handshake tag--use two, one only written by the PLC, and an echo that is only written by Ignition.
The correct place for such busy and dangerous code is a project library script function called from a tag change event in a project's gateway events. (Not on the tag.)
Finally, you need to investigate how well your device is actually performing, comms-wise. While AB Logix PLCs tend to support way more comms than other brands, in my experience, it is rather easy to screw that up with poor architecture (in the PLC) and with certain kinds of newbie mistakes (drag-n-drop of all the PLC tags from OPC browser to Ignition Tag Browser being #1).
Do you even know if your PLC comms are overloaded? (Device diagnostics.)
Some reading (follow links, too):