Hello Guest it is March 29, 2024, 12:35:04 AM

Author Topic: M6 is skipped when the toolpath display is hidden  (Read 3021 times)

0 Members and 1 Guest are viewing this topic.

M6 is skipped when the toolpath display is hidden
« on: April 19, 2016, 05:04:21 PM »
I've been mystified for some time as to why Mach4 occasionally fails to pause and call my M6 macro when a tool is selected within a gcode program. At other times Mach behaves as expected, even using the same gcode file.

I eventually tracked this down to the toolpath display. My (customized) screen set ordinarily hides the toolpath displays on background tabs. When no toolpath is visible, the pause for toolchange and the M6 macro call are skipped. If any of the toolpaths are displayed, even briefly, prior to gcode execution, all works as expected: the program pauses and M6 is called. This is the case both for the simulator and my CSMIO/IP-A controller.

My personal feeling is that this behaviour is a bug: the user should be free to rearrange a screen set without disrupting core operations. Has anyone else seen this behaviour and found a solution other than always having a toolpath on display?

I haven't noticed any effect other than skipping of the tool change action: the gcode otherwise seens to run normally.

Allan

Offline Pedio

*
  •  200 200
    • View Profile
Re: M6 is skipped when the toolpath display is hidden
« Reply #1 on: April 20, 2016, 09:12:45 AM »
My machine freezes occasionally when it gets to a toolchange. The Gcode stops and the cycle start button is grayed out. I have to stop and restart M4. Usually when I try to restart M4 I get a message saying "another of copy of M4 GUI is already running".

I have done a lot of testing to determine why but can not find anything. My toolpaths don't always display. Also, there seems to be a bug if you zero the axis to a workpiece after you have loaded the Gcode file it does not place the image in the toolpath window correctly. I wonder if there is an easy way to test if this is the problem.
Re: M6 is skipped when the toolpath display is hidden
« Reply #2 on: April 20, 2016, 03:33:18 PM »
I've never had freezing fortunately. In fact Mach4 seems very stable.

The only time I've had missing toolpaths is when there has been an error in the gcode file. I seem to remember that this occurred recently an I traced it to mismatched parentheses in a comment line. I had just assumed that nested comments would have been OK, But no! (No nesting of brackets is permitted).

Pressing the Regenerate Toolpath button normally corrects the display after changing the Axis zero point.

Allan

Offline Pedio

*
  •  200 200
    • View Profile
Re: M6 is skipped when the toolpath display is hidden
« Reply #3 on: April 20, 2016, 04:29:12 PM »
On my copy of M4 when I regen toolpaths it does not reset the rapid speed. I would not have noticed except when I use a laser I slow the machine down. The first rapid move on a regen (back to 0,0) is at the slow speed.

Offline smurph

*
  • *
  •  1,544 1,544
  • "That there... that's an RV."
    • View Profile
Re: M6 is skipped when the toolpath display is hidden
« Reply #4 on: April 24, 2016, 10:44:10 PM »
Allan,
If there is no tool path, the regen never completes and leaves the core in a mode where M codes are not processed.  The reason for this is we obviously don't want to run M codes while generating the tool path.  We are expecting a tool path to be there.  After the initial run of the loaded G code, the initial tool path update is what clears this state.  A workaround for this would be to simply drop a tool path on the screen somewhere and set its properties to hide it. 

Pedio,
Regen on a tool path is not the same thing as resetting the control.  Reset will put the control in the default state.  As Allen stated, regen is only used after an origin change.  It does nothing else and it is up to the user to do this.  It will not reset the rapid speed.  If you are using a rapid override, then you are also the one that needs to reset it.  Now, this can be done in a script on the regen button (or the reset button for that matte) if that is how you want your machine to operate. 

If the M6 is locking up, then there is a problem in the M6 macro or the motion controller plugin getting stuck in a bad state.  :(

Steve

Offline dude1

*
  •  1,253 1,253
    • View Profile
Re: M6 is skipped when the toolpath display is hidden
« Reply #5 on: April 24, 2016, 11:20:50 PM »
have you installed and run as admin sometime this is needed
Re: M6 is skipped when the toolpath display is hidden
« Reply #6 on: April 25, 2016, 07:34:59 AM »
Steve

Many thanks for the insight into core operation. I tried your suggestion and created a toolpath about the size of your thumbnail in a corner of the tab that contains the Open File button. This worked fine when the TP was visible, but making it invisible did not prove successful: my original issue returned.

Spurred on by your ideas I reduced the toolpath to a 1x1 pixel and set its background colour to match the blue tab background I was using (I like plenty of colour!). This worked a treat: the TP was effectively invisible but allowed core operations to proceed correctly, executing macros as needed.

Allan