I just started playing around with Mach 3 and have have been trying to write a small G-Code program that uses a subroutine to generate a pocket.. Simple in concept.. Set the Z-Depth of the cut..call the routine to do the pocket "slice"..Set the next slice depth..call the subroutine.
Using Wizard I have a program that seems to work fine but If I load it into Mach 3 it chokes!...I am using the trial version right now. So I have two questions:
1. Are subroutines supported in Mach 3
2. I can't seem to set a local or global (volatile or non volatile) variable prior to each subroutine call and use it in the subroutine.. Any insight.. My code looks something like:
O1
#100=-4.0
M98 P02
#100=-6.0
M98 P02
end -main
O02
G0 Z10 (Safe Zone)
G0 Xn Yn (move to pocket origin)
G1 Z[#100] (drop down to the set level).
...
Return
The G-Code language is quite archaic lying somewhere between BASIC and Assembly language.. Im quite surprised it hasn't evolved into a much more structured form.
Thanks in advance for any suggestions & guidance!