wait, the thread pool is size 3? how hefty are these threads?
Hence the * and the clarification below. I meant, the length of time it takes the script to run doesn't bother the script itself that is running; it couldnt care less
(I added a bit more clarification to my post in case it trips people up)
Yes, but that, I believe, is why Phil is saying it is dangerous, because the stall can result in other events being missed.
They are standard threads.
If a valueChange event calls system.tag.writeBlocking()
, or system.opc.writeValues()
, and the write cannot complete immediately, it will tie up one of the three threads that are processing tag events until the write times out. If you have three tags running such events with dangerous calls, you can halt all tag event processing for the entire gateway for the length of those timeouts (typically 45 or 60 seconds).
Same with DB operations other than S&F inserts/updates, and same with network API calls. Just not safe to do within tag event scripts. Full stop.
Is this still the case if the script calls out to a project library script? (I'm not 100% on Ignition's internal code running model)
Yes. Calling a library script doesn't change the thread the code is running within. Don't let tag events run more than a small handful of milliseconds.