; This oword sub is called on IoAborts if so defined in the ini file ; ; to activate, incantate as follows: ; ; [RS274NGC] ; # handler gsub called on IoAborts - to cleanup HAL pins etc ; ON_ABORT_COMMAND=ocall ; ; the reason code is passed as parameter #1 and is taken from ; the below enum in src/emc/nml_intf/emc.hh : ; ; // types for emcIoAbort() reasons ; enum EMC_IO_ABORT_REASON_ENUM { ; 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_USER = 100 // user-defined abort codes start here ; }; ; see src/emc/emc/task/emctask.cc and emctaskmain.cc for context where this ; is called ; O sub (DEBUG, on_abort called, reason = [#1]) ; (DEBUG, deasserting motion.digital-out-00 as iocontrol.tool-prepare) ; M65 P0 ; assert the equivalent of the iocontrol.tool-change pin ; which is now motion.digital-out-01 ;(DEBUG, deasserting motion.digital-out-01) M65 P1 g0 ; see if this syncs motion ; O endsub ;