Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: mgamber on December 09, 2013, 06:21:14 PM
-
I need to write a G-code program that calls certain other g-code programs in a specific order.
Say I have;
1.tap
2.tap
3.tap
If opened individually these files make a single part.
Then I want a "job" file that calls these like so;
Load 1.tap and run
Load 3.tap and run
Load 1.tap and run
Load 1.tap and run
Load 2.tap and run
Each tap file cannot know of the existence of each other, only the "job" file knows who to run next.
Is this possible?
Best guess so far is to create a macro, call it m999
Function Param1 () as String ' gets P word
StrutFile = "C:\" + Param1 + ".tap"
LoadRun (StrutFile)
The job file;
M999 P1
M999 P3
M999 P1
M999 P1
M999 P2
What am I missing? How does the macro return to original code running? Or once a new file is loaded is that it?
-
Have a look at 10.8.7 in the Using Mach Mill Manual.
Some info from a post:
To run two separate G code files.
Store your file in the subroutines directory within Mach and call them with a program like this:
O0001 (MAIN PROGRAM)
M98 (SUB_PROG1.TAP)
M98 (SUB_PROG2.TAP)
M30
There are number of different ways to do it.
Grayham, if reading this , have some suggestions?
RICH
-
This thread has some examples that might work for you.
http://www.machsupport.com/forum/index.php/topic,15401.msg103250.html#msg103250