Jump to content

Running blocking gom.script calls without freezing a background polling loop, inside a locked ZEISS INSPECT addon


---
 Share

Recommended Posts

Hello,

My add-on needs to run a blocking GOM command while a Modbus polling loop keeps running for a two-station workflow.

Since GOM commands can only run on the main thread, I tried using multiprocessing.Process for the blocking scan. This works in the edit mode, but after the add-on is locked and packaged, the child process fails with ModuleNotFoundError when importing the add-on module.

Using a temporary .py file with subprocess is not an option because it would expose the source code.
I also tried threading, but it sometimes causes unexpected crashes in software, so I would prefer not to use it.

Is there an official way to use multiprocessing or a separate Python process in a locked add-on without exposing the source code?
If not, what is the recommended way to handle this kind of two-station parallel workflow?

Link to comment
Share on other sites

 Share

×
×
  • Create New...