Hello Guest it is May 10, 2021, 09:47:08 PM

Author Topic: M6 Doesn't work...  (Read 2189 times)

0 Members and 1 Guest are viewing this topic.

Re: M6 Doesn't work...
« Reply #10 on: February 08, 2018, 12:52:54 PM »
when executing a manual M6 the macro will have to include a CycleStop or equivalent. The control state then goes to Idle and so you can jog or MDI.
Once you've finished clamping the tool in place you can continue to jog and or MDI. Alternately you could have a screen button that takes you to a touch
off location.

Note that all these jogs, MDIs or Button moves can only occur when the control state is Idle. When you are done hit <cycle start> and the Gcode file takes over,
of course the control state is no longer Idle.

A statement like GcodeExecuteWait() executes its line or lines of code as if they were entered as MDI.

You may have noticed in another thread when I was doing something similar I 'ran aground' where even though the control state was Idle the GcodeExecuteWait()
call didn't progress and would return MERROR_NOT_NOW. Exactly what circumstances that an API fails to progress are not clear to me yet.

What that experience has taught me is that you should always test the return codes of any API if you expect your code to be robust.

My wife left with my best friend...
     and I miss him!

Offline thosj

  •  432 432
    • View Profile
Re: M6 Doesn't work...
« Reply #11 on: February 08, 2018, 01:49:52 PM »
What is "manual M6"? Something other than an M6 in gcode running?

I understand that if I MDI T2 M6 it will be idle at the end of that. Is that the same in gcode running along, T2 M6 happens, machine stops waiting for me to change the tool, I put in the new tool then I can jog around, set my A, and press cycle start and off she goes?

Perhaps that's gcode behavior since time began, but I've never thought to do it or did it!! Cool if that's they way it works. Maybe you CAN teach a 70 year old dog new tricks.
Re: M6 Doesn't work...
« Reply #12 on: February 08, 2018, 06:12:08 PM »
not quite. When Mach encounters an M code in a Gcode job it executes it as Gcode from the interpreter and you will
not be able to jog or MDI while its happening.

If however that macro has a CycleStop command embedded in it it would allow you to jog etc.

'Manual M6' means that the M6 macro contains a CycleStop and requires you to fit the tool and touch off by hand as it were.
Only when you are finished do you <cycle start> and the Gcode interpreter regains control of the motion planner.

My wife left with my best friend...
     and I miss him!