Hello Guest it is May 19, 2019, 02:54:54 AM

Author Topic: M98 Subroutine Directory  (Read 2292 times)

0 Members and 1 Guest are viewing this topic.

M98 Subroutine Directory
« on: August 01, 2010, 07:38:46 AM »
After some hours of frustration, and then another hour of searching here, it appears that any named subroutine I call must be in the Mach3/SubRoutine directory.
This is slightly anomalous as I can load a main routine from anywhere, but I cannot do that with subroutines. That is, the following does not work for me:

M98 (c:\mach3\gcode\sub.tap)

Would it be possible to have the next release allow the full filename string please? That way I can keep projects separate.
If there is another way to handle this, or if I am just wrong, please advise!

Cheers

Offline Mc2

*
  •  31 31
    • View Profile
Re: M98 Subroutine Directory
« Reply #1 on: August 02, 2010, 03:44:22 PM »
I ran into the same issue. You can however just locate your sub program at the end of your regular program that is to say:

(Main program here)
G0 X0 Y0


M98 O0100

M30

(After M30 put the sub program with program number. By the way they start with the Letter O not zero.)

O0100
(Lines of code to run when sub program called)
M99

This will keep all sub programs and main program together. If you use the same sub program for other programs you will have to add it in or save sub program to the subroutine's directory. If there is another way, I have not found it.
Jim.

Re: M98 Subroutine Directory
« Reply #2 on: August 02, 2010, 06:03:52 PM »
I ran into the same issue. You can however just locate your sub program at the end of your regular program

Oh, I know that. I want to use an external file as a subroutine to hold a large number of parameters which are common to several programs. That way, if I alter a parameter, it is automatically altered for every program which uses that parameter file. But it would be nice to have each project in its own folder.

Cheers
Re: M98 Subroutine Directory
« Reply #3 on: April 17, 2018, 12:55:20 AM »
Update, for anyone searching this:

You can have your external subroutine anywhere you like, including in your current directory (c:\Projectdir). For some utterly weird reason, you must prefix the text string with a minus sign to make this work:
m98 (-c:\Projectdir\Project1.tap)

Cheers
Roger