Reset Custom M-codes on Machine Disable?

  • Todd Zuercher
  • Todd Zuercher's Avatar Topic Author
  • Away
  • Platinum Member
  • Platinum Member
More
29 May 2026 19:28 - 29 May 2026 19:34 #346746 by Todd Zuercher
Replied by Todd Zuercher on topic Reset Custom M-codes on Machine Disable?
I started playing with the on_abort.ngc and it might work. I need to play a little more. At this point it does a little more than I want it to. It will trigger it for F2 (what I want), but also triggers it when exiting a running milling file with the escape key (not what I want) and the machine does not enter machine off.

The machine state I'm dealing with is particular about how it is entered and exited. I can't simply turn it on or off without the machine moving, when the M-code is active, it can be turned off without issue when the machine is not enabled (in machine off). So I only want the on_abort sequence to cancel my M-code state when the machine is aborting to machine off. Aborting to a machine on state, such as when aborting a running g-code file, the M-code state needs to be left alone, and the operator will have to clear it themselves (else the machine will shutdown with following error alarms.)

In the remap instructions I read about making some things conditional. I'm going to try to play with that now.
Last edit: 29 May 2026 19:34 by Todd Zuercher.

Please Log in or Create an account to join the conversation.

  • Todd Zuercher
  • Todd Zuercher's Avatar Topic Author
  • Away
  • Platinum Member
  • Platinum Member
More
29 May 2026 19:40 #346747 by Todd Zuercher
Replied by Todd Zuercher on topic Reset Custom M-codes on Machine Disable?
Yes with adding the conditional code from the manual seems to be working just the way I want it to.
Here is what I have in the on_abort.ngc file
o<on_abort> sub
o100 if [#1 eq 5]
    (machine on)
o100 elseif [#1 eq 6]
    (machine off)
    M123
o100 elseif [#1 eq 7]
    (estopped)
    M123
o100 elseif [#1 eq 8]
    (msg, abort pressed)
o100 else
    (DEBUG, error parameter is [#1])
o100 endif
o<on_abort> endsub
%
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

Time to create page: 0.062 seconds
Powered by Kunena Forum