[Se...] Posted Friday at 07:06 AM Share Posted Friday at 07:06 AM (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 Friday at 07:22 AM 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