pcant_12 #Canned text - output call cant_pos = cant_pos12$ cantext$ = cant_val12$ pcant_out
pcant_13 #Canned text - output call cant_pos = cant_pos13$ cantext$ = cant_val13$ pcant_out
pcant_14 #Canned text - output call cant_pos = cant_pos14$ cantext$ = cant_val14$ pcant_out
pcant_15 #Canned text - output call cant_pos = cant_pos15$ cantext$ = cant_val15$ pcant_out
pcant_16 #Canned text - output call cant_pos = cant_pos16$ cantext$ = cant_val16$ pcant_out
pcant_17 #Canned text - output call cant_pos = cant_pos17$ cantext$ = cant_val17$ pcant_out
pcant_18 #Canned text - output call cant_pos = cant_pos18$ cantext$ = cant_val18$ pcant_out
pcant_19 #Canned text - output call cant_pos = cant_pos19$ cantext$ = cant_val19$ pcant_out
pcant_20 #Canned text - output call cant_pos = cant_pos20$ cantext$ = cant_val20$ pcant_out
pcant_out #Canned text - build the string for output #Assign string select type outputs
if cant_pos < three, #cant_pos indicates canned text output [
if cantext$ = three, bld = one if cantext$ = four, bld = zero #Build the cantext string
if cantext$ = one, strcantext = strcantext + sm00 if cantext$ = two, strcantext = strcantext + sm01 if cantext$ > four, [
strtextno = no2str(cantext$)
strcantext = strcantext + strm + strtextno ] ]
else, #cant_pos indicates coolant output [
coolant_bin = flook (two, cantext$) #Create binary value for each coolant using lookup table
if frac(cantext$/two), [
if all_cool_off, [
if coolant_on, pbld, n$, *sall_cool_off, e$ coolant_on = zero ]
else, coolant_on = coolant_on - coolant_bin/2 #Odd = off command, subtract appropriate binary value. ]
else, #Even = on command [ #Determine if this coolant is already on local_int = zero coolantx = zero while local_int < 20, [
result2 = and(2^local_int, coolant_on) local_int = local_int + one
if result2 = coolant_bin, suppress = one ] ]
if suppress <> 1, #Don't output an on code for a coolant that is already on [
if not(frac(cantext$/two)), coolant_on = coolant_on + coolant_bin #Maintain binary
sum of all coolants
currently on
coolantx = cantext$ - 50 #Create a coolantx value for string
select
pbld, n$, *scoolantx, e$ ]
suppress = zero ]
# --------------------------------------------------------------------------
# Position calculations, generally these do not need to be modified # --------------------------------------------------------------------------
pmiscint$ #Capture the top level absinc for subprograms if sub_level$ <= zero, absinc$ = mi2$
pcheckaxis #Check for valid rotary axis
#If selected axis combination has more than 0 rotary axes and toolpath has rotation
if (mill5$ | rotary_type$ = 1 | rotary_type$ = 2) & rotaxerror = 1, [if mprint(srotaxerror, 2) = 2,
exitpost$]
pxyzcout #Map coordinates
xabs = vequ(x$) #Retrieve X,Y,Z positions into xabs,yabs,zabs iout = vequ(i$) feed = fr_pos$
if feed > maxfeedpm, feed = maxfeedpm
#Incremental calculations
ps_inc_calc #Incremental calculations, start xia = fmtrnd(xabs) yia = fmtrnd(yabs) zia = fmtrnd(zabs)
xinc = vsub (xia, prv_xia)
pe_inc_calc #Incremental calculations, end !xia, !yia, !zia
!x$, !y$, !z$, !cc_pos$
# -------------------------------------------------------------------------- # Parameter read postblocks:
# --------------------------------------------------------------------------
pprep$ #Pre-process postblock - Allows post instructions after the post is parsed but before the NC and
NCI file are opened.
#DO NOT ATTEMPT TO OUTPUT TO THE NC FILE IN THIS POSTBLOCK (OR ANY POSTBLOCKS YOU MAY CALL FROM HERE) BECAUSE
THE NC OUTPUT FILE IS NOT YET OPENED! rd_cd$ #Read CD Parameters
rd_mch_ent_no$ = 0 #Read only the machine base parameters (use to collect common parameters from
CNC_MACHINE_TYPE)
rd_md$ #Read machine definition parameters
pwrtt$ #Pre-read NCI file
if tool_info > 1 & t$ > 0 & gcode$ <> 1003, ptooltable
if ra_type$, ra_error = 1 #Aggregates NOT supported in this post
pwrttparam$ #Pre-read parameter data
#\
if prmcode$ = 15346, comp_type = rpar(sparameter$, 1) #Cutter compensation type - 0=computer, 1=control,
2=wear, 3=reverse wear, 4=off
if prmcode$ = 10010, xy_stock = rpar(sparameter$, 1) #Capture stock to leave (XY) if prmcode$ = 10068, z_stock = rpar(sparameter$, 1) #Capture stock to leave (Z)
pparameter$ #Read operation parameters
#rd_params is used to call pparameter postblock and read the parameters of the operation specified in
rd_param_op_no
#\
# --------------------------------------------------------------------------
# Parameter lookup tables - You must adjust the size value if you add or remove any parameters to/from these
tables!
# -------------------------------------------------------------------------- # Machine Definition Parameters
fprmtbl 17000 4 #Table Number, Size
# Param Variable to load value into
17605 min_speed #Minimum spindle speed 17643 maxfeedpm #Limit for feed in inch/min 17651 maxfeedpm_m #Limit for feed in mm/min
17101 all_cool_off #First coolant off command shuts off ALL coolant options
# Control Definition Parameters
fprmtbl 18000 0 #Table Number, Size # Param Variable to load value into
# Toolpath Group Parameters
fprmtbl 19000 0 #Table Number, Size # Param Variable to load value into
# --------------------------------------------------------------------------
pset_mach #Set post switches by reading machine def parameters rot_ax_cnt = 0 rotaxerror = 0
#maxfeedpm = 999999 #Uncomment these variables to force use of machine def values as initial lowest
max feedrate value
#maxfeedpm_m = 9999999 #Otherwise the default (post) initialization setting is used as initial value
!maxfeedpm, !maxfeedpm_m
rd_mch_ent_no$ = syncaxis$ #Retrieve machine parameters based on current axis combination - read from
.nci G950 line
rd_md$ #Read machine definition parameters - calls pmachineinfo$
#We only need this set at toolchange (and start of file). No need to set them each time a user may call
rd_md
if met_tool$ = 1, maxfeedpm = maxfeedpm_m #Set limit for feed in mm/min
# --------------------------------------------------------------------------
# Machine definition and control definition parameter capture: # --------------------------------------------------------------------------
pmachineinfo$ #Machine information parameters postblock
#rd_md is used to call pmachineinfo postblock and read the parameters of the selected axis