Machsupport Forum

G-Code, CAD, and CAM => G-Code, CAD, and CAM discussions => Topic started by: TomR on May 02, 2012, 02:45:01 PM

Title: Need Help on a Mcode Macro
Post by: TomR on May 02, 2012, 02:45:01 PM
I am having problems with a mcode macro which consists on the following:

'M5001 Macro
DoButton(169)  'Close Current G-Code file
LoadFile("C:\Mach3\Gcode\RR2.tap") 'Load Next G-Code File
DoButton(1000)  'Start Cycle after Loading File

What I'm trying to do is daisy chain a series of G-Code programs such that when one program completes, the next program loads, regenerates a new tool path and cycle starts without operator interaction.  The above macro (M5001) will load the G-Code file (C:\Mach3\Gcode\RR2.tap) and regenerate the new tool path, although it does not start the cycle without mousing the "Cycle Start" button.

As an option, I used the "LoadRun" command  which did successfully load and start the G-Code without mousing the "Cycle Start" button.  However this command does not regenerate a new tool path on the Tool Path screen.

What am I doing wrong?

Regards, TomR
Title: Re: Need Help on a Mcode Macro
Post by: BR549 on May 02, 2012, 04:59:34 PM
Instead of the dooembutton TRY

RunFile()
Title: Re: Need Help on a Mcode Macro
Post by: BR549 on May 02, 2012, 05:26:25 PM
OK I had to test this

This works here

'M5001 Macro
DoButton(169)  'Close Current G-Code file
LoadRun("C:\Mach3\Gcode\RR2.tap") 'Load Next G-Code File
Title: Re: Need Help on a Mcode Macro
Post by: TomR on May 04, 2012, 11:31:14 AM
I have tried this earlier and it works fine with one exception.  The tool path is regenerated properly on the first program only.  On all subsequent programs the tool path screen is blank leaving the operator blind to what is being machined.

Thanks, TomR