Regardless whether it works, buggy or not, you have access to a sub and given full control for most machine state behaviors (G10 offsets incl). Much safer and easier to keep track of what's what and who's doing what that way.
1. Create a file in your nc subroutines folder named "on_abort.ngc"
2. in your *.INI file, amend the RS274NGC section.
INI file
Code:
[RS274NGC]
SUBROUTINE_PATH = path_to_your/nc_subroutines
ON_ABORT_COMMAND = o <on_abort> call
on_abort.ngc example
Code:
o<on_abort> sub
G59 (Bug fix. See: https://github.com/LinuxCNC/linuxcnc/issues/2745)
G54 (origin offsets are set to the default)
G18 (select XY plane)
G90 (absolute)
G94 (feed mode: units/minute)
M48 (set feed and speed overrides)
G40 (cutter compensation off)
M5 (spindle off)
G80 (cancel modal motion)
M9 (mist and coolant off)
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, abort pressed)
o100 else
(DEBUG, [on_abort.ngc] error parameter is [%d#1])
o100 endif
o<on_abort> endsub
m2