[Se...] Posted December 20, 2024 Share Posted December 20, 2024 (edited) Hi everyone, I'm working on implementing a stop feature that monitors a PLC signal. When the signal is triggered, I want to automatically stop any running Zeiss software commands. I know there's an abort button in the Zeiss dialog that can stop running commands. I'd like to trigger this abort function programmatically when a PLC signal is detected. Here's my current code for monitoring the PLC signal: def monitor_stop_signal(): while True: try: if read_plc_bool(plc_client, 'Q', 600, 0): print("Stop signal triggered!") """Abort here""" os._exit(0) except Exception as e: print(f"Stop signal monitoring error: {e}") break time.sleep(0.1) # Start monitoring thread monitoring_thread = threading.Thread(target=monitor_stop_signal, daemon=True) monitoring_thread.start() Is there a way to programmatically trigger the dialog's abort function when the PLC signal is detected? How can I call this abort function from my code? Thank you for your help Edited December 20, 2024 Link to comment Share on other sites More sharing options...
[Ma...] Posted January 6 Share Posted January 6 Hi Please sign in to view this username. , do you want to stop your ZEISS INSPECT Python script or are you looking for a generic method for stopping a ZEISS INSPECT command? Best regards, Matthias Link to comment Share on other sites More sharing options...
[Se...] Posted January 8 Author Share Posted January 8 Hi Please sign in to view this username. , I'm looking for a generic method to stop ZEISS INSPECT commands. Right now, even if I send a stop signal during the scan, it will still finish the whole scan before processing my signal. I want to be able to abort the scan immediately when I need to stop it, just like an abort button does. However, I don't know how to use commands to trigger the same action as the abort button. Do you have any suggestions? Link to comment Share on other sites More sharing options...
[DW...] Posted January 13 Share Posted January 13 (edited) Go to the Python editor. Create a new script. Hit record. Start a process. Hit abort. Stop recording. What does the script say? Edited January 13 Link to comment Share on other sites More sharing options...
[Ma...] Posted January 14 Share Posted January 14 (edited) Hi Please sign in to view this username. , There does not seem to be an integrated solution for what you want to achieve, but you could try to use PyAutoGUI · PyPI to emulate clicking the abort button (or pressing the 'ESC' key) from a Python script running externally. Best regards, Matthias Edited January 14 Link to comment Share on other sites More sharing options...
[Se...] Posted Wednesday at 06:46 AM Author Share Posted Wednesday at 06:46 AM Please sign in to view this quote. Hello Please sign in to view this username. , I already tried that before but unfortunately nothing was recorded. Please sign in to view this quote. Hello Please sign in to view this username. , Thank you for your suggestion but due to security policies, we are unable to implement external automation tools like this. It would be very helpful if the abort function could be integrated into the system natively in the future, as it would help us avoid unnecessary waiting time during process execution. Link to comment Share on other sites More sharing options...
[Ma...] Posted Thursday at 01:57 PM Share Posted Thursday at 01:57 PM Hello Please sign in to view this username. , I have filed a development request issue. Best regards, Matthias Link to comment Share on other sites More sharing options...
[Se...] Posted Friday at 01:38 AM Author Share Posted Friday at 01:38 AM Thank you sir. Link to comment 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