axis_qty = 1 'the number of project axis
'table(101) = to send axis-error and alarm status on PC
DIM x AS INTEGER
FOR x = 0 TO axis_qty-1
    ETHERCAT($64 , x) 'clear the slave drive CW - to clear AXISSTATUS ERROR
    WA(20)
NEXT x
DATUM(0) 'clear the controller following error - to clear AXISSTATUS ERROR
WA(10)
UNIT_CLEAR 'clear the init error - to clear System ERROR
WA(10)

IF MOTION_ERROR <> 0 THEN

    TABLE(101,AXISSTATUS) ' reset outpout
ELSE
    TABLE(101,0) ' set outpout
ENDIF

