Machsupport Forum
Mach Discussion => General Mach Discussion => Topic started by: escowizard on February 11, 2007, 10:43:05 PM
-
Ok, so I feel like a dummy here but.......I seem to be unable to get a subroutine program to run. it just runs through the main program and thats it.
What am I missing?
Main program
1004
M98 P9999 L2
M30
Then the sub program is
O9999
G20 G90
G0 X1.5
G0 Z-.500
G1 Z-.650 F100
G0 Z0
X1.0
M99
Both progs are saved as the same name as the first line in ea.
So what am I missing? I am using Mach2 Version 6.11i (Licensed )
Scott
-
Make sure you have pressed return after the M99, what I do is put in the % as it shows you that you have pressed the return after the last line.
Hood
-
Hi, Scott
"Both progs are saved as the same name as the first line in ea." Should be saved as one.
Try this.
;Main program
;1004
M98 P9999 L2
M30
;Then the sub program is
O9999
G20 G90
G0 X1.5
G0 Z-.500
G1 Z-.650 F100
G0 Z0
X1.0
M99
%
Hope this Helps, Chip
-
Do you mean the sub should be included in the main prog ? So you only save one prog ?
I thought as long as I had the main prog and the sub both saved in the same file folder, it would find it.
OR
Am I just in a brain fade ?
And I understand the % at the end of the file but why the ; at the beginning of the file ? or is it just a diff way to quote " " ?
-
There isnt anything foolish in Mach 2 like someplace to check "on" to make it allowable to run subroutine progs is there?
Tried the above and it still will not go to the sub prog...........
Hmmmmmm
-
Got it
Ok, you are correct or I finally understand. I do have to include the sub prog "within" the main prog. Doing that, it works.
I am not used to including it within the main. Does not make sub progs as usefull as I used to be familiar with.
I learned on Fanuc back in the 80's and I could call up sub progs such as single point threading on cnc swiss screw machines and run em
on any part or family of parts.
See, I want to make cribbage board patterns so I figured what a great way of using sub progs to repeat the 10 hole block.
Is there any way of calling up an external prog, looping it a bunch of times and returning back to the main prog ?
-
Hi, Scott
Been tied-up today, If you Ref. the Mach3 manual sec 10.8.7, it states that if you use M98 (filename.txt) it will import and run that file I haven't been able to get it to work though. so your not off on this at all.
Read up on this see if you can get it to work.
Thanks, Chip
-
Don't forget, I am using Mach 2 allthough I think it should work in this version too.
Thank you for your efforts. I really do appreciate it.
-
Hi, Scott
Didn't see the ref. in Mach2 manual, just thought you mite want to look at it.
Thanks Chip
-
Ya, well it doesn't say I can't use a file not embedded in the main file..........and it doesn't say I must use a file embedded within the main file either.
-
Well the good thing is .........I can work within these current boundaries. It would be nice if I could do what I used to do for versatility sake but I can write longer progs.
At least it will save a bunch. Maybe eventually it will save a bunch MORE. lol
I wanted to come up with a method to use a single block cribage board hole segment and be able to utilize that into any configuration I wanted like making big letters out of a crib board or an outline of a duck or whatever.
Without being able to import a sub prog in any manner I need just slows me down a bit and means I do a little more writing.
Bigger files. thats all. I still love it all.
-
There is nothing to stop you having the subs stored on your PC and then just cut and paste them into the files you are going to use.
Graham.
-
Ya, I know and thats simple enough.
I just want to make sure I can use Mach 2 to the fullest of its abilities for what I need.