Hello Guest it is March 28, 2024, 04:46:40 AM

Author Topic: How can I have a G-Code program load and run another G-Code program  (Read 13836 times)

0 Members and 1 Guest are viewing this topic.

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: How can I have a G-Code program load and run another G-Code program
« Reply #10 on: May 01, 2012, 06:14:10 PM »
YOU may want to try the other method

Loadfile("C:\Mach3\Gcode\PushStick.tap")   'Load new file
While IsMoving()
Sleep(1000)
Wend
DoOemButton(160)  ' Regen toolpath
While Ismoving()
Sleep(5000)
Wend
DoOemButton(0)     'Start program


(;-) TP



Offline TomR

*
  •  17 17
    • View Profile
Re: How can I have a G-Code program load and run another G-Code program
« Reply #11 on: May 04, 2012, 11:44:39 AM »
I tried the above macro but found the tool path regeneration oembutton 160 goes into some kind of indefinite loop.  The tool path dialog box opens indicating the tool path is being regenerated but only "hangs" there indefinitely.  Cycle Start never executes.

Also, I assume DoOemButton(0) is a typo and should be DoOemButton(1000).

Thanks, TomR

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: How can I have a G-Code program load and run another G-Code program
« Reply #12 on: May 04, 2012, 01:11:06 PM »
SO far eveything has worked here, BUT that is not unusual.  IT MAY be the files that you are trying to use. CAN you post teh files so I can test them here.

Try this method, It does work here as well.

'M5001 Macro
DoButton(169)  'Close Current G-Code file
LoadRUN("C:\Mach3\Gcode\RR2.txt") 'Load Next G-Code File
While ISmoving()
SLeep(5000)
Wend

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: How can I have a G-Code program load and run another G-Code program
« Reply #13 on: May 04, 2012, 02:58:49 PM »
IF you do not want the 5sec pause remove the

Sleep(5000)

Offline TomR

*
  •  17 17
    • View Profile
Re: How can I have a G-Code program load and run another G-Code program
« Reply #14 on: May 06, 2012, 10:50:47 AM »
Attached are the three test files I have been using.  It is actually the Road Runner divided into three separate files. 

Thanks, TomR

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: How can I have a G-Code program load and run another G-Code program
« Reply #15 on: May 07, 2012, 12:48:39 PM »
Tom I have tested here and it works fine stiching all 3 files together.

(;-) TP

Offline Graham Waterworth

*
  • *
  •  2,668 2,668
  • Yorkshire Dales, England
    • View Profile
Re: How can I have a G-Code program load and run another G-Code program
« Reply #16 on: May 08, 2012, 06:07:53 PM »
Hi TomR,

are you using a licensed or the demo version of Mach3, the Demo version has limitations.

Graham
Without engineers the world stops

Offline TomR

*
  •  17 17
    • View Profile
Re: How can I have a G-Code program load and run another G-Code program
« Reply #17 on: May 10, 2012, 11:01:27 AM »
Well that appears to be the problem.  I have a licensed version at our shop but a demo version at home where I do most of my code development.  When I used BR549's macro on the licensed version, it worked fine.  I was surprised to find the demo has such limitations.

Sorry guys and I hope I didn't waste your time.  I really appreciate your help.

Regards, TomR

Offline BR549

*
  •  6,965 6,965
    • View Profile
Re: How can I have a G-Code program load and run another G-Code program
« Reply #18 on: May 10, 2012, 03:24:44 PM »
Art pretty much knew most of the ways around the 500 line demo restricitons(;-). THere ARE a few that work BUT they shall remain unmentioned

(;-) TP

Offline TomR

*
  •  17 17
    • View Profile
Re: How can I have a G-Code program load and run another G-Code program
« Reply #19 on: May 11, 2012, 11:43:27 AM »
Pretty please!  I won't tell anyone.