Hello Guest it is November 14, 2019, 12:49:21 AM

Author Topic: Disabling I/O during file loading  (Read 2669 times)

0 Members and 1 Guest are viewing this topic.

Disabling I/O during file loading
« 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.


Offline poppabear

*
  • *
  •  2,233 2,233
  • Briceville, TN, USA
    • View Profile
    • S S Systems, LLC
Re: Disabling I/O during file loading
« Reply #1 on: December 06, 2010, 08:56:51 AM »
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

Commercial Mach3 & Mach 4, Design/Build/Retrofit CNC and Industrial machines.
http://www.ss-systems-llc.com/
Re: Disabling I/O during file loading
« Reply #2 on: December 06, 2010, 09:18:16 AM »
Thanks.
I'll monitor 67 and 172, it sounds like that's exactly what I needed.

Frank

Offline BR549

*
  •  6,916 6,916
    • View Profile
Re: Disabling I/O during file loading
« Reply #3 on: December 07, 2010, 12:21:56 PM »
SCott if you go offline with MACH do you loose positional reference??

Just curious, (;-) TP

Offline smurph

*
  • *
  •  1,149 1,149
  • "That there... that's an RV."
    • View Profile
Re: Disabling I/O during file loading
« Reply #4 on: December 11, 2010, 01:27:09 AM »
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:

Code: [Select]
if (MainPlanner->PathGenerate) {
return;
}