% O9010 (DRILLMACRO.NC1) (G81 MACRO) ( Z is final drill depth ) ( K is Depth per peck ) ( R is Standoff amount from last depth ) ( F is Feed rate ) ( Drill retracts to whatever the Z value was before calling the G81 cycle ) #1=0 #2=0 IF[#23NE#0]GOTO1 IF[#26EQ#0]GOTO8 #23=#5002-#26 N1#1=#1+#6 IF[#1LE#23]GOTO2 #1=#23 N2G0W-#3 G1W-[#1-#3]F#9 G0W#1 IF[#1GE#23]GOTO9 #2=#1 #3=#2-#18 GOTO1 N9M99 N8#3000=1(NO Z OR W COMMAND) % (PROGRAM EXAMPLE: ) (5/8" SPADE DRILL 8.0" FLUTE LENGTH) N58 G0 T0505 N60 G50 S300 N62 G97 S300 M3 N64 G0 X0. Z.1 M8 N66 G81 Z-5.322 K1.14 R.04 F.008 N68 G0 Z .1 N70 G30 U0 W0 P2 M9 N72 M30