[Se...] Posted August 7 Share Posted August 7 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 https://qualityforum.zeiss.com/topic/27198-running-blocking-gomscript-calls-without-freezing-a-background-polling-loop-inside-a-locked-zeiss-inspect-addon/ Share on other sites More sharing options...
[De...] Posted August 25 Share Posted August 25 Would creating a Zeiss Inspect service help with your situation? https://zeiss.github.io/zeiss-inspect-app-api/2026/howtos/using_services/using_services.html hope it helps. Link to comment https://qualityforum.zeiss.com/topic/27198-running-blocking-gomscript-calls-without-freezing-a-background-polling-loop-inside-a-locked-zeiss-inspect-addon/#findComment-154736 Share on other sites More sharing options...
[Ma...] Posted August 25 Share Posted August 25 Please sign in to view this username. I've studied services and those are mainly for sharing functions across many add-ons. But it's like for calculations - not for dialogs. If anyone needs a function, which should return calculated result defined by parameters, then this can be used. But i don't think you can hide code or use compiled python code. At least i didn't try "pyc" file Link to comment https://qualityforum.zeiss.com/topic/27198-running-blocking-gomscript-calls-without-freezing-a-background-polling-loop-inside-a-locked-zeiss-inspect-addon/#findComment-154742 Share on other sites More sharing options...
[De...] Posted August 26 Share Posted August 26 was thinking something like: while True: if modbus_service.get_station_state(1) == "READY": break time.sleep(0.1) run_gom_operation_for_station_1() would help to have more context into what OP is trying todo, but hope it helps! Link to comment https://qualityforum.zeiss.com/topic/27198-running-blocking-gomscript-calls-without-freezing-a-background-polling-loop-inside-a-locked-zeiss-inspect-addon/#findComment-154806 Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in