Machsupport Forum
Mach Discussion => Mach SDK plugin questions and answers. => Topic started by: FoxtrotBravo on December 03, 2010, 12:44:54 PM
-
When Mach3 loads a file it runs through a simulation of the g-code. What variable can a plug-in check to determine if Mach3 is in this simulation mode? I'm creating a plug-in for an I/O board, and I/O is being executed during program loading, and that's what I will need to prevent.
Thanks.
-
before your code block that you are loading the g code with, put this:
if( !GetLED(67) ) //if OEM led for offline is NOT on
DoButton(178);//button press for putting mach offline.
//**** Your load g code, code here********
if( !GetLED(172) ) //G-Code is done loading LED.
return;
else
if( GetLED(67) ) //if OEM led for offline IS on
DoButton(178);//button press for putting mach back online again.
//advance to your next sequence, switch, or statement.
//scott
-
Thanks.
I'll monitor 67 and 172, it sounds like that's exactly what I needed.
Frank
-
SCott if you go offline with MACH do you loose positional reference??
Just curious, (;-) TP
-
Mach is generating the tool path at this point, so it's not a true simulation. MainPlanner->PathGenerate is set to true when the gcode file is loading. Stick this in your update loop to keep your plugin quiet while loading a file:
if (MainPlanner->PathGenerate) {
return;
}