#!/usr/bin/python3 import sys import time import hal import linuxcnc c = hal.component("test_component") ls = linuxcnc.stat() lc = linuxcnc.command() estop_reset = True try: c.ready() while True: ls.poll() if ( estop_reset ): if (ls.task_state == linuxcnc.STATE_ESTOP ): print("Test component: ESTOP_RESET") lc.state(linuxcnc.STATE_ESTOP_RESET) print("Test component: g5x_index: " + format(ls.g5x_index)) time.sleep(1) except(KeyboardInterrupt): print("Test component: Exiting") sys.exit(1) except Exception as e: print("Exception in test component") print(e) raise sys.exit(1)