o<on_abort> sub


o100 if [#1 eq 5]
    (machine on)
o100 elseif [#1 eq 6]
    (machine off)
o100 elseif [#1 eq 7]
    (estopped)
o100 elseif [#1 eq 8]
    (msg,Process Aborted)
o100 else
    (DEBUG,Abort Parameter is %d[#1])
o100 endif

o<on_abort> endsub
m2

These are potential abort number:

        EMC_ABORT_TASK_EXEC_ERROR = 1,
        EMC_ABORT_AUX_ESTOP = 2,
        EMC_ABORT_MOTION_OR_IO_RCS_ERROR = 3,
        EMC_ABORT_TASK_STATE_OFF = 4,
        EMC_ABORT_TASK_STATE_ESTOP_RESET = 5,
        EMC_ABORT_TASK_STATE_ESTOP = 6,
        EMC_ABORT_TASK_STATE_NOT_ON = 7,
        EMC_ABORT_TASK_ABORT = 8,
        EMC_ABORT_INTERPRETER_ERROR = 9,        // interpreter failed during readahead
        EMC_ABORT_INTERPRETER_ERROR_MDI = 10,   // interpreter failed during MDI execution
        EMC_ABORT_USER = 100  // user-defined abort codes start here
