I’ve been trying to use system.util.invokeAsynchronous without success. I am suspicious that it is because I am using Sepasoft’s Instrument Interface module to read data from a device over a serial port.
The way to get control of a serial port using the Instrument Interface module is put a “Serial Controller” object onto an Ignition screen. This object is only visible in the designer. It would serve no purpose in a client.
You use the object’s properties and methods to work with a serial port.
What I am doing is reading a large amount of data from the serial port, massaging it and then inserting it into a database. I don’t want the user to have to wait while this is going on - he has plenty that he could be doing during that time. I would like to define all of that as a function and call it with system.util.invokeAsynchronous.
I know that you should not interact with the GUI in the asynchronous thread. Since this object is invisible on the screen and the user can’t interact with it, I wonder if this is considered to be “part of the GUI”. If so, I’m sure that is my problem.
Also, is using Python’s “print” command considered to be an interaction with the GUI? I have sprinkled a few of them throughout the code that I’m trying to run asynchronously to troubleshoot this issue.