Stopping all nested macros.
-
I'm having an occasional issue with my tool changing macros where one of my axes is out of limit when I return from parking a tool and think I'm back in bounds. (I suspect U, the axis used for tool lock and unlock) This has caused some very quick grasping at the power switch to prevent two physical objects from trying to occupy the same physical space at the same time.
So I'm going to write a macro that I run after I believe I've returned withing limits and just before I issue an M564 S1 command. This macro will compare the current position of all axes to their limits and if any are outside limits, it will take action.
My question to the forum is what is the appropriate action. My goal is to stop execution while the operator (me) figures out what's happening. My current options:
- M0, but I don't want to run stop.g or cancel.g (or set a new global variable for them to stop themselves)
- M1, but the same as M0, except for not wanting to run sleep.g
- M2 - same as M0
- M25, but I don't want to run pause.g
- G4 S9999 - this should give me time to assess things but seems like a crude method and not acceptable for unattended operation. It's my current best plan.
- setting a global variable that will be looked at by parent macros and trigger them to execute an M99 of their own
Is there a smarter way to do this?
-
M291 prompting the operator to confirm things are like they are supposed to be?
-
@oliof - excellent suggestion because it addresses the unattended operation concern. I can have two buttons. One is to resume, the other would be to cancel... but what do do on that cancel message?
-
@mikeabuilder "abort"?
-
Just when I think I know the meta commands...
abort <opt-expression>
This causes all nested macros and the current print file (if any) to be terminated.
RTFM. Thanks @jay_s_uk