Hello Guest it is April 19, 2024, 08:09:33 AM

Author Topic: Easiest way to have Gcode file close after completed.  (Read 4513 times)

0 Members and 1 Guest are viewing this topic.

Easiest way to have Gcode file close after completed.
« on: March 19, 2012, 11:39:22 AM »
We do a lot of pen tracing, and we have found that when my cnc operator gets interrupted and doesn't remember to close the pen file and load the cut file we mess pieces up. SO is there a way I can have the gcode file automatically close after it is run ( I do realize the easy thing is to get in the habit of load programs correctly, but it is a mistake that can be easily done and cost money) . I was thinking this may entail putting a macro at the end of the program in the post processor. I don't have a clue how to do this yet so a copy/paste instruction and help would be great.
Re: Easiest way to have Gcode file close after completed.
« Reply #1 on: March 19, 2012, 11:46:13 AM »
I guess you would make a new macro with the do oembutton 169 (close current file). Maybe this is incorrect, if I put in the close file in the code, when mach loads the gcode it goes through it first would't it close the file?

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Easiest way to have Gcode file close after completed.
« Reply #2 on: March 19, 2012, 11:51:04 AM »
In General Config, there's an option to ignore M codes while loading.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html
Re: Easiest way to have Gcode file close after completed.
« Reply #3 on: March 19, 2012, 11:55:43 AM »
Could I do something like this. But with the 169 button

From:http://www.henriksplace.se/cnc/cnc_mach3_vb.html

Here's a macro that closes down Mach3 and shuts down the PC. If saved as M300.m1s for example we can call that instead of M30 at the end of the G-code and it will shut down the PC for us.
  Code "M30"                                 'Stop and rewind
  If IsLoading = 0 Then                 'Is the code loading or should we actually run it?
    Message("Shuting down...")  'Tell operator we are shutting down.
    DoOEMButton(705)                 'OEMButton705 shuts down the PC
  End If
 

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Easiest way to have Gcode file close after completed.
« Reply #4 on: March 19, 2012, 01:31:53 PM »
I am not sure that would help you. AS IS when the first program ends it rewinds and MACH3 is sitting idle. HOW does that mess things up???

I take it after the first program runs the OP needs to load a different program to run ??

(;-) TP

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: Easiest way to have Gcode file close after completed.
« Reply #5 on: March 19, 2012, 01:41:41 PM »
Just add the following line to the M1030 macro

DoOemButton(169)

The M1030 macro is automatically called by the M30 mcode at program end.

(;-) TP
Re: Easiest way to have Gcode file close after completed.
« Reply #6 on: March 19, 2012, 01:54:02 PM »
Worked out great