Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: rcaffin 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
-
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.
-
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
-
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
-
Roger, I have been looking for this. Thank You so much, I know years later. LOL
Do I need the parenthesis or no parenthesis?
Thank You again.
Doug
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
-
Yes, you do need the parentheses, AND the minus sign
m98 (-c:\Projectdir\Project1.txt) or .tap
Macvh3Mill.pdf, section 10.8.7, re M98, option b),
Cheers
Roger
-
Roger, Thank you very much, yes I should read the manual.
I have a guy that work with that found this for me.
I am heading downstairs now to try this out.
Hope I have luck. I will let you know.
Thank You
Doug
-
Roger
I know you know it works, but WOW. Thank You so very much for posting this.
Greatly appreciated.
Doug
Yes, you do need the parentheses, AND the minus sign
m98 (-c:\Projectdir\Project1.txt) or .tap
Macvh3Mill.pdf, section 10.8.7, re M98, option b),
Cheers
Roger
-
Yeah, it's very useful.
My current project has about 20 - 30 components, and is only kept under control by having ALL parameters in one data file. That is really ALL of them. Parameter numbers up to about #480.
Cheers
Roger