8 Basic CNC Programming
8.4 NC Codes
107
M03
G91 X1.5 Y1
G16
X.75Y0
M98 P1 L12
M02
O1 Y30
G81 Z-.1 R0
G80
M99
Code
Explanation
G0X0Z0.07M03
Rapid motion to X0Z0.07.
Spindle ON.
G16 G91X2Z0 M98P1L12
M2
G16
Turn Polar programming ON.
G91
Incremental programming mode ON.
X2Z0
Move to a point 2 inches from the current position, at an
angle of 0 degrees.
M98 P1
Call subprogram 1.
L12
Sets the number of repeats to 12.
M2
End program
O1Z30 G81Z-.1R0 G80
01
Subprogram label 1.
Z30
Move to position 30 degrees from current position.
G81
Start canned drilling cycle.
Z-.1
Drill to Z – 0.1
R0
Retract to Z0 after cycle complete.
G80
End canned drilling cycle.
M99
End of subprogram, return to main program.
Summary
The example combines the use of polar programming with a canned cycle
and a subprogram to drill a hole at 30 degree increments. The L value was
determined by dividing 360 degrees by 30 degrees.