Tag events run in a limited thread pool (three threads, by default). You must not do anything in a tag event script that takes more than a handful of milliseconds. (Like, single digit milliseconds.)
This means your tag events must not:
-
Make any database calls, except Insert/Update via the Store and Forward system.
-
Make any direct OPC reads, or any OPC tag writes, or direct OPC writes, as these block for many seconds if there are communication problems.
-
Use any system or java functions that will block on any other network activity.
-
Use any system or java functions that access large amounts of data in a filesystem.
-
Use any form of
.sleep()
or any form of busy-looping.
If you need any of the above, use a project-level Gateway Tag Change event (or multiple such) instead of event scripts attached directly to the tag.