Hello Guest it is July 22, 2024, 03:58:06 PM

Author Topic: Macro programming questions  (Read 2379 times)

0 Members and 1 Guest are viewing this topic.

Macro programming questions
« 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;

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?

Offline RICH

  • *
  •  7,427 7,427
Re: Macro programming questions
« Reply #1 on: December 10, 2013, 07:19:54 AM »
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:


There are number of different ways to do it.

Grayham, if reading this , have some suggestions?

Re: Macro programming questions
« Reply #2 on: December 10, 2013, 08:13:42 AM »
This thread has some examples that might work for you.