Hi Wade:
The format for a repeating loop is as follows:
G0 G49 G40.1 G80 G50 G90 G98 G20 (inch) (Basic set-up codes)
M6 T1 (Tool change, Tool #1
G43 H1 (Load the tool#1 length offset)
M3 S800 (Turn on spindle, 800 RPM)
G0 X0 Y0 Z.1 (Rapid move to X0, Y0, Z.1 position)
#10=[0] (Parameter #10 starting value; will be used for stepping the X axis in .01 increments)
M98 p1000 L20 (Do a subroutine with label 1000, repeat routine 20 times; The letter p precedes the 1000)
G0 Z1.5 M5 (Loop is finished, and Z moves up clear of work, spindle off)
M30 (Program end)
(subroutine to cut a ramp)
o1000 (Label 1000, indicated with a letter o, not number 0)
G1 X#10 Y0 Z0 F20 (Move cutter to X0, Y0, Z0 at feedrate 20; X holds value of #10, which is 0)
Y.1 Z.5 (First cut motion at feedrate)
#10=[#10+.01] (Increment parameter #10 by .01)
G0 X#10 Y0 Z.1 (Rapid back to X.01 Y0, Z.1, and X is now at .01 because #10 has been increased after cutting action)
M99 (Return to beginning of subroutine)
This is the general format for a subroutine. It is safe to feed the Z axis down to the starting point, versus making
a rapid move all the way to Z0.
Don't forget the subroutine starts with the letter o, and the label number can be any number you
choose, it just has to have a letter p preface.
John