absinc$ = sav_absinc coolant$ = sav_coolant
peof0$ #End of file for tool zero peof$
peof$ #End of file for non-zero tool pretract comment$
if stagetool = 1 & stagetltype = 2, pbld, n$, *first_tool$, e$ n$, \ mergesub$ clearsub$ mergeaux$ clearaux$ \
pwcs #G54+ coordinate setting at toolchange if mi1$ > one, [
sav_frc_wcs = force_wcs
if sub_level$ > 0, force_wcs = zero
if workofs$ <> prv_workofs$ | (force_wcs & toolchng), [
if workofs$ < 6, [
g_wcs = workofs$ + 54 *g_wcs ] else, [
p_wcs = workofs$ - five \ ] ]
force_wcs = sav_frc_wcs !workofs$ ]
pgear #Find spindle gear from lookup table if use_gear = one, [
gear = frange (one, speed) *gear
]
#Toolchange setup
pspindchng #Spindle speed change
if prv_spdir2 <> spdir2 & prv_speed <> zero, pbld, n$, *sm05, e$ if prv_speed <> speed | prv_spdir2 <> spdir2, [
if speed, pbld, n$, *speed, *spindle, pgear, e$ ]
!speed, !spdir2
pspindle #Spindle speed calculations for RPM speed = abs(ss$) if speed, [
if speed > maxss$, speed = maxss$
if speed < min_speed, speed = min_speed ]
spdir2 = fsg3(spdir$)
pq$ #Setup post based on switch settings
stagetool = bldnxtool$ #Set stagetool from CD setting
ptoolend$ #End of tool path, before reading new tool data !speed, !spdir2
ptlchg1002$ #Call at actual toolchange, end last path here if op_id$ <> prv_op_id$, pset_mach #Read machine def parameters pspindle
whatline$ = four #Required for vector toolpaths if gcode$ = 1000, [
#Null toolchange ] else, [
#Toolchange and Start of file if gcode$ = 1002, [
#Actual toolchange pretract ]
if stagetool = one, prv_next_tool$ = m_one prv_xia = vequ(xh$)
prv_feed = c9k ] !op_id$
# -------------------------------------------------------------------------- # Motion NC output
# -------------------------------------------------------------------------- #The variables for absolute output are xabs, yabs, zabs. #The variables for incremental output are xinc, yinc, zinc. # --------------------------------------------------------------------------
prapidout #Output to NC of linear movement - rapid pcan1, pbld, n$, sgplane, `sgcode, sgabsinc, pccdia, pxout, pyout, pzout, strcantext, scoolant, e$
#Modify following line to customize output for high-speed toolpath #tool inspection/change points
if rpd_typ$ = 7, pbld, n$, \\INSPECTION POINT - POST CUSTOMIZATION REQUIRED)\
plinout #Output to NC of linear movement - feed pcan1, pbld, n$, sgplane, `sgcode, sgabsinc, pccdia, pxout, pyout, pzout, feed, strcantext, scoolant, e$
#Modify following line to customize output for high-speed toolpath #tool inspection/change points
if rpd_typ$ = 7, pbld, n$, \\INSPECTION POINT - POST CUSTOMIZATION REQUIRED)\
pcirout #Output to NC of circular interpolation pcan1, pbld, n$, sgplane, sgcode, sgabsinc, pccdia,
pxout, pyout, pzout, parc, feed, strcantext, scoolant, e$
pcom_moveb #Common motion preparation routines, before pxyzcout ps_inc_calc
pncoutput #Movement output pcom_moveb comment$ pcan
if gcode$ = zero, prapidout if gcode$ = one, plinout
if gcode$ > one & gcode$ < four, pcirout
if mr_rt_actv, #Restore absolute/incremental for G51/G68 [
absinc$ = sav_absinc
mr_rt_actv = zero ]
pcom_movea
pcom_movea #Common motion preparation routines, after pcan2
pe_inc_calc
pdwl_spd$ #Call from NCI gcode 4 pspindle comment$ pspindchng pcan
if fmtrnd(dwell$), pcan1, pbld, n$, *sgcode, *dwell$, strcantext, e$ else, pcan1, pbld, n$, strcantext, e$ pcan2
prapid$ #Output to NC of linear movement - rapid pncoutput
pzrapid$ #Output to NC of linear movement - rapid Z only pncoutput
plin$ #Output to NC of linear movement - feed pncoutput
pz$ #Output to NC of linear movement - feed Z only pncoutput
pmx$ #Output to NC of vector NCI pncoutput
pcir$ #Output to NC of circular interpolation pncoutput
# -------------------------------------------------------------------------- # Motion output components
# -------------------------------------------------------------------------- pbld #Canned text - block delete if bld, '/'
pfbld #Force - block delete \
pccdia #Cutter Compensation #Force Dxx#
if prv_cc_pos$ <> cc_pos$ & cc_pos$, prv_tloffno$ = c9k sccomp
if cc_pos$, tloffno$
pfxout #Force X axis output if absinc$ = zero, *xabs, !xinc else, *xinc, !xabs
pxout #X output
if absinc$ = zero, xabs, !xinc else, xinc, !xabs
pfyout #Force Y axis output if absinc$ = zero, *yabs, !yinc else, *yinc, !yabs
pyout #Y output
if absinc$ = zero, yabs, !yinc else, yinc, !yabs
pfzout #Force Z axis output if absinc$ = zero, *zabs, !zinc else, *zinc, !zabs
pzout #Z output
if absinc$ = zero, zabs, !zinc else, zinc, !zabs
parc #Select the arc output
if (plane$ = zero & (arctype$ = one | arctype$ = four)) | #XY Plane (plane$ = one & (arctypeyz$ = one | arctypeyz$ = four)) | #YZ Plane (plane$ = two & (arctypexz$ = one | arctypexz$ = four)), #XZ Plane [
result = newfs(two, iout) result = newfs(two, jout) result = newfs(two, kout) ] else, [
result = newfs(three, iout) result = newfs(three, jout) result = newfs(three, kout)