Welcome, Guest. Please login or register.
Did you miss your activation email?
May 27, 2012, 10:37:47 AM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  Mach SDK plugin questions and answers.
| | |-+  Disabling I/O during file loading
Pages: 1   Go Down
Print
Author Topic: Disabling I/O during file loading  (Read 534 times)
0 Members and 2 Guests are viewing this topic.
FoxtrotBravo
Active Member

Offline Offline

Posts: 2


View Profile
« 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.


Logged
poppabear
S S SYSTEMS, LLC
Global Moderator
*
Offline Offline

Posts: 1,707


Briceville, TN, USA


View Profile WWW
« 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

Logged

Commercial Mach3: Screens (regular and flash), Wizards, Plug-ins, Brains, PLCs, Macros, ATC's, machine build, retrofit and Prototyping
http://sites.google.com/site/volunteerfablab/
FoxtrotBravo
Active Member

Offline Offline

Posts: 2


View Profile
« 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
Logged
BR549
Active Member

Offline Offline

Posts: 2,556


View Profile
« 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
Logged
smurph
Active Member

Offline Offline

Posts: 244


View Profile
« 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:
if (MainPlanner->PathGenerate) {
return;
}
Logged
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!