Interface stops during script with SQL query

I have a script that gets called from a button and the script pulls data from one database and then writes to another database. During this script operation the user interface is just “frozen”. Is there some way to insure it gets updates? Originally I had the entire script on the button, and during the operation I got a “spinning circle” in the upper right corner. After moving the script to the project script it then does not show the circle, but still just “freezes”.

During the script I am also writing to tags that are supposed to display on the screen to notify the operator of the progress of the script. These items show as intended in the designer window, but nothing happens in the client window unit the script is complete.

How can I get the client to display these items like the designer window does?

Call the project script with invokeAsynchronous(). Within the script, you can write to tags, but don’t access any windows or components in any way. If you must, use invokeLater() to spawn functions that can interact with the GUI. Consider using something like later.py, as described in this thread, to help with sending data back and forth with these functions.

1 Like