Instructions
g00 z.3
y.25
g01 z-.3
g00 z.3
x-.25
g01 z-.3
g00 z.3
o200 endsub
g90 g00 g40 g80 x1.0 y1.0 z0 (move into position for the starting point of the sub
program)
o200 call (call up sub program o200)
g90 g00 x1.0 y-1.0 z0 (A g90 must be entered in the line of code calling for its next
position move) (Be sure to have your spindle high enough to clear all obstacles such as
clamping devices.)
o200 call (call up sub program o200)
As many times as needed.
Now every time the machine sees “o200 call” in the program, it will search for “o200
sub”. Then it will run that section of the program until it reads “o200 endsub”. At this
point, the spindle will go back to the position it was before the “o200 call” was initiated
and continue to run the main program.
%
(Main Program with a Sub Program Nesting Sample)
o200 sub (4 hole pattern)
g91 g01 z-.3 f15.0
g00 z.300
x.25
g01 z-.3
g00 z.3
y.25
g01 z-.3
g00 z.3
x-.25
66