]
if (plane$ = 0 & arctype$ < five) | (plane$ = 1 & arctypeyz$ < five) | (plane$ = 2 & arctypexz$ < five) | full_arc_flg$ | arc_pitch$, [
#Arc output for IJK
# If you do NOT want to force out the I,J,K values, # remove the \ if plane$ = zero, *iout, *jout, kout #XY plane code - G17 if plane$ = one, iout, *jout, *kout #YZ plane code - G19 if plane$ = two, *iout, jout, *kout #XZ plane code - G18 !i$, !j$, !k$ ] else, [
#Arc output for R
if abs(sweep$)<=180 | (plane$ = 0 & arctype$ = five) | (plane$ = 1 & arctypeyz$ = five) |
(plane$ = 2 & arctypexz$ = five), result = nwadrs(srad, arcrad$) else, result = nwadrs(srminus, arcrad$) *arcrad$ ]
# -------------------------------------------------------------------------- # Drilling
# -------------------------------------------------------------------------- pdrlcommonb #Canned Drill Cycle common call, before if initht$ <> refht$, drillref = zero else, drillref = one if gcode$ = 81, [
result = newfs(two, zinc)
if drillcyc$ = three | drillcyc$ = 7, drlgsel = fsg1(-ss$) + drillcyc$ * two else, drlgsel = fsg2(dwell$) + drillcyc$ * two prv_refht_a = c9k prv_refht_i = c9k prv_dwell$ = zero prv_shftdrl$ = zero ]
z$ = depth$ prv_zia = initht$ pcom_moveb feed = fr_pos$ comment$ pcan
prdrlout #R drill position refht_a = refht$
refht_i = refht$ - initht$
if absinc$ = zero, refht_a, !refht_i else, refht_i, !refht_a
pdrill$ #Canned Drill Cycle pdrlcommonb
pcan1, pbld, n$, *sgdrlref, *sgdrill, pxout, pyout, pfzout, prdrlout, dwell$, *feed, strcantext, e$ pcom_movea
ppeck$ #Canned Peck Drill Cycle pdrlcommonb
pcan1, pbld, n$, *sgdrlref, *sgdrill, pxout, pyout, pfzout, prdrlout, *peck1$, *feed, strcantext, e$ pcom_movea
pchpbrk$ #Canned Chip Break Cycle pdrlcommonb
pcan1, pbld, n$, *sgdrlref, *sgdrill, pxout, pyout, pfzout, prdrlout, *peck1$, *feed, strcantext, e$ pcom_movea
ptap$ #Canned Tap Cycle pdrlcommonb
result = newfs(17, feed) # Set for tapping Feedrate format pcan1, pbld, n$, *sgdrlref, *sgdrill, pxout, pyout, pfzout, prdrlout, *feed, strcantext, e$ pcom_movea
pbore1$ #Canned Bore #1 Cycle pdrlcommonb
pcan1, pbld, n$, *sgdrlref, *sgdrill, pxout, pyout, pfzout, prdrlout, dwell$, *feed, strcantext, e$ pcom_movea
pbore2$ #Canned Bore #2 Cycle pdrlcommonb
pcan1, pbld, n$, *sgdrlref, *sgdrill, pxout, pyout, pfzout, prdrlout, *feed, strcantext, e$ pcom_movea
pmisc1$ #Canned Fine Bore (shift) Cycle pdrlcommonb
pcan1, pbld, n$, *sgdrlref, *sgdrill, pxout, pyout, pfzout, prdrlout, shftdrl$, dwell$, *feed, strcantext, e$ pcom_movea
pmisc2$ #Canned Rigid Tapping Cycle pdrlcommonb
#RH/LH based on spindle direction pbld, n$, sg95, e$
pbld, n$, sm29, *speed, e$
if met_tool$, pitch = n_tap_thds$ #Tap pitch (mm per thread) else, pitch = 1/n_tap_thds$ #Tap pitch (inches per thread) pcan1, pbld, n$, *sgdrlref, *sgdrill, pxout, pyout, pfzout, prdrlout, *pitch, !feed, strcantext, e$ pcom_movea
pdrlcst$ #Custom drill cycles 8 - 19 (user option) #Use this postblock to customize drilling cycles 8 - 19 if drillcyc$ = 8, pdrlcst8 else, [
pdrlcommonb
sopen_prn, \e$
pcom_movea ]
pdrlcst8 #Custom drill cycle 8 - example custom cycle pdrlcommonb
sopen_prn, \ pcan1, pbld, n$, *sgdrlref, *sgdrill, pxout, pyout, pfzout, prdrlout, shftdrl$, dwell$, *feed, strcantext, e$ pcom_movea
# Additional Holes
pdrill_2$ #Canned Drill Cycle, additional points pdrlcommonb
pcan1, pbld, n$, pxout, pyout, pzout, prdrlout, feed, strcantext, e$ pcom_movea
ppeck_2$ #Canned Peck Drill Cycle pdrill_2$
pchpbrk_2$ #Canned Chip Break Cycle pdrill_2$
ptap_2$ #Canned Tap Cycle pdrill_2$
pbore1_2$ #Canned Bore #1 Cycle pdrill_2$
pbore2_2$ #Canned Bore #2 Cycle pdrill_2$
pmisc1_2$ #Canned Fine Bore (shift) Cycle pdrill_2$
pmisc2_2$ #Canned Rigid Tapping Cycle pdrlcommonb
pcan1, pbld, n$, pxout, pyout, pzout, prdrlout, strcantext, e$ pcom_movea
pdrlcst_2$ #Custom drill cycles 8 - 19, additional points (user option) #Use this postblock to customize drilling cycles 8 - 19 if drillcyc$ = 8, pdrlcst8_2 else, [
sopen_prn, \e$
pdrill_2$ ]
pdrlcst8_2 #Custom drill cycle 8 - example custom cycle
sopen_prn, \ pdrill_2$
pcanceldc$ #Cancel canned drill cycle result = newfs(three, zinc) z$ = initht$
prv_zia = initht$ pxyzcout !zabs, !zinc
prv_gcode$ = zero pcan
pcan1, pbld, n$, sg80, strcantext, e$ if drillcyc$ = 7, pbld, n$, sg94, e$
pcan2
# -------------------------------------------------------------------------- #Subprogram postblocks
#sub_trnstyp - 0=mirror, 1=rotate, 2=scale, 3=translate #sub_trnmthd (mirror) - 0=X axis, 1=Y axis, 2=line
#sub_trnmthd (rotate) - 0=tplane, 1=tplane origin only, 2=coordinates # -------------------------------------------------------------------------- psub_call_m$ #Call to main level, single tool psub_call_trans
psub_call_mm$ #Call to main level, multiple tools psub_call_trans
psub_call_trans #Translate level calls from toolchange, user if mi1$ <= one, result = mprint(shomeserror) sav_absinc = absinc$
#Mirror or Rotate Coord's
if sub_trnstyp$ = zero | (sub_trnstyp$ = one & mr_rt_actv), [
#The original pattern is not mirrored or rotated if sub_sec_no$, [
absinc$ = zero
if sub_trnstyp$, psub_rotate else, psub_mirror ]
mr_rt_actv = three ]
else, #Translate [
if sub_mny_t$, [
if mi1$ > one, absinc$ = zero
pbld, n$, *sgcode, *sgabsinc, pwcs, pfxout, pfyout, pfzout, e$ pe_inc_calc ps_inc_calc ] ]
absinc$ = sav_absinc
result = nwadrs(strp, main_prg_no$)
if progno$ = main_prg_no$, result = mprint(sprgnerror) pbld, n$, \ prv_feed = c9k #Force feed in sub