What order is the M6 read? Also a paid job...

This is where you talk about Macros, show examples of your macro scripting and SHARE handy segments of script code as examples.

Re: What order is the M6 read? Also a paid job...

Postby fsli » Tue Dec 20, 2022 3:13 am

dimmaz88 wrote:Am I right in thinking that there should be no tool offset commands in the g-code if using a M6 macro?

It shouldn't make a difference, as long as the G43 in the G Code references the same tool that was used in the M6.

Could you post the tool table entries, and the offsets screen before/after the problem?
Frank
fsli
 
Posts: 97
Joined: Mon Jul 11, 2022 12:36 am

Re: What order is the M6 read? Also a paid job...

Postby dimmaz88 » Tue Dec 20, 2022 2:11 pm

Hi Frank, here are the screenshots you requested. The first one is before I click cycle start, the job calls for the tool that's already in the spindle...


preCycleStart.JPG


The second is what happens once I've started the job, you can see the tool offset has been added..

postCycleStart.JPG


Tools..

toolTable.JPG





What I've noticed is if I do a tool change e.g. "M6T3" the tool length is immediately added, once the change complete the offset is then removed. I remember we had to add a work around and that's why this happens, I just can't remember why lol.

I guess if the M6 runs but already has the correct tool, the offset is being added at the start but because the M6 doesn't complete it doesn't get removed at the end..
dimmaz88
 
Posts: 27
Joined: Mon Jun 13, 2022 9:22 am

Re: What order is the M6 read? Also a paid job...

Postby fsli » Wed Dec 21, 2022 12:10 am

Okay, I'm seeing it now, and your prior explanations are starting to make sense.

The problem is that you have a G49 at the beginning of your G Code:
Code: Select all
N100G00G21G17G90G40G49G80

The G49 removes the tool offset, but it doesn't reset the tool number. So, when the M6 runs and recognizes that the tool hasn't changed, it doesn't issue the G43 to establish the tool offset. The M6 -- as written -- is assuming that the tool offset from the prior tool change is still in effect. You had said that you needed to do a manual tool change prior to running, to make the program think a different tool was in the spindle. That makes sense now, because that's the only way the M6 macro would reach the G43.

Remove the G49 and the problem should go away.
Frank
fsli
 
Posts: 97
Joined: Mon Jul 11, 2022 12:36 am

Re: What order is the M6 read? Also a paid job...

Postby dimmaz88 » Wed Dec 21, 2022 9:51 am

Thank you Frank, you found the problem.

All sorted :D
dimmaz88
 
Posts: 27
Joined: Mon Jun 13, 2022 9:22 am

Previous

Return to Macros

Who is online

Users browsing this forum: No registered users and 18 guests