For sharing, a pretty simple example Macro used for drilling deep holes with parameters for; Pilot hole depth, Tip engagement and breakthrough if needed.


%
O7200(DEEP HOLE DRILLING CYCLE)
(3 RPMS, 4 DEPTHS @ 4 FEEDS)
(EXPANATION AND USAGE AT BOTTOM)

(W=#23 PILOT HOLE DEPTH )
(E=#8 PILOT HOLE FEED)

(Q=#17 REDUCED RPM2)
(K=#6 TIP ENGAGEMENT DEPTH)
(M=#13 REDUCED FEED)

(Z=#26 FULL DEPTH)
(F=#9 FULL FEED)
(S=#19 HIGH RPM3)

(U=#21 BREAKTHROUGH DEPTH)
(V=#22 BREAKTHROUGH FEED)

(R=#18 "R" PLANE)

#1=#4001 (STORES G00/G01)
#2=#4003 (STORES G90/G91)
#3=#4109 (STORES MODAL FEEDRATE)
#4=#5003 (STORES Z START POSITION)
#5=#4119 (STORES ORIGINAL RPM1)

IF[#18EQ#0]#18=#4(GO TO Z IF NO R PLANE)
IF[#23EQ#0]#23=#18 (SKIP PILOT IF NOT NEEDED)
IF[#8EQ#0]#8=#13
IF[#21EQ#0]#21=#26(SKIP BREAKTHROUGH IF NOT NEEDED)
IF[#22EQ#0]#22=#9
IF[#17EQ#0]#17=#5(USE ORIGINAL RPM1 IF RPM2 IS NOT SET)

G00 G90 Z#18 (RAPID TO R-PLANE)
G01Z#23 F#8 (PILOT FEED DEPTH)
N10M38(TURN TOOL COOLANT ON)
S#17(REDUCED RPM2)
G01Z#6F#13(ENGAGE FULL TIP DIAM)
S#19(FULL RPM3)
G01Z#26F#9(FULL DEPTH)
S#17M3 (REDUCED RPM)
G01Z#21F#22(BREAKTHROUGH)
G01Z#23F#8(FEED UP TO PILOT DEPTH)
M9(TURN COOLANT OFF)
S#5(RETURN RPM TO ORIGINAL)
IF[#4010 EQ 98]GOTO 100 (G98 OR G99)
G00 Z#18 (RAPID TO R-PLANE)
GOTO 200;
N100 G00 Z#4 (RAPID TO I-PLANE)
N200 G#1 G#2 F#3 (RESTORES MODAL INFO)
M99



(PROGRAM IS WRITTEN TO BE USED LIKE A CANNED CYCLE FOR DEEP HOLES.)
(THE PILOT DEPTH IS THE EXISTING PILOT HOLE'S DEPTH - MINUS CLEARANCE)
(THE TIP ENGAGEMENT DEPTH SHOULD BE AROUND 1.5X THE DIAM OF THE DRILL)
(IF NO BREAKOUT IS REQUIRED, DO NOT PROGRAM THE VARIABLES, U & V)
(IF NO PILOT IS USED, DO NOT PROGRAM THE VARIABLES, W & E)
(ALL DEPTHS ARE ABSOLUTE VALUES)
(USE DECIMALS AFTER EACH VARIABLE - EVEN RPMS)
(USE ONLY X AND/OR Y AXIS LOCATIONS UNTIL CYCLE IS FINISHED - G67))

(USAGE
G0G90G54X0.Y0.
G43Z2.0H1
S100M3(USE THIS FOR FIRST RPM1 TO ENGAGE PILOT HOLE)
G98 G66 P7200 W-.5 E25. Q500. K-.75 M2.5 Z-9. F10.S1000. U-9.5 V3.5 R.1
X1.Y1.
X-1.
Y-1.0
X1.0
.. ..
G67
(................................................. ...............................................)
(OR FOR REDUCED ENTRANCE FEEDS ONLY)
G0G90G54X0.Y0.
G43Z2.0H1M38
S800M3(USE THIS FOR FIRST RPM1)
G99 G66 P7200 K-.375 M5. Z-3. F15. R.1 S800.
X1.5 Y2.
X2.0
X1.5 Y2.5
X2.0
.. ..
G67
%