pbld #Canned text - 单节删除
if bld, '/'
pfbld #强制 - 单节删除
"/"
pccdia #切削补偿
#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 #选择圆弧输出格式
if arcoutput = zero,
[
#圆弧输出为 IJK
i, j, k
]
else,
[
#圆弧输出为 R
if abs(sweep)<=180 | arcoutput=one, result = nwadrs(srad, arcrad)
else, result = nwadrs(srminus, arcrad)
*arcrad
]
# --------------------------------------------------------------------------
# Drilling 钻孔
# --------------------------------------------------------------------------
pdrlcommonb #Canned Drill Cycle common call, before
if gcode = 81,
[
result = newfs (two, zinc)
if drillcyc = three, drlgsel = fsg1(-ss) + drillcyc * two
else, drlgsel = fsg2(dwell) + drillcyc * two
if initht <> refht, drillref = zero
else, drillref = one
prv_refht_a = c9k
prv_refht_i = c9k
]
z = depth
prv_zia = initht
feed = fr_pos
prv_dwell = zero
@dwell
pcom_moveb
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 #钻孔固定循环
pdrlcommonb
pcan1, pbld, n, *sgdrlref, *sgdrill, pxout, pyout, pfzout,
prdrlout, dwell, *feed, strcantext, e
pcom_movea
ppeck #啄式钻孔固定循环
pdrlcommonb
pcan1, pbld, n, *sgdrlref, *sgdrill, pxout, pyout, pfzout,
prdrlout, *peck1, *feed, strcantext, e
pcom_movea
pchpbrk #断屑固定循环
pdrlcommonb
pcan1, pbld, n, *sgdrlref, *sgdrill, pxout, pyout, pfzout,
prdrlout, *peck1, *feed, strcantext, e
pcom_movea
ptap #攻螺纹固定循环
pdrlcommonb
pcan1, pbld, n, *sgdrlref, *sgdrill, pxout, pyout, pfzout,
prdrlout, *feed, strcantext, e
pcom_movea
pbore1 #镗孔固定循环 #1
pdrlcommonb
pcan1, pbld, n, *sgdrlref, *sgdrill, pxout, pyout, pfzout,
prdrlout, dwell, *feed, strcantext, e
pcom_movea
pbore2 #镗孔固定循环 #2
pdrlcommonb
pcan1, pbld, n, *sgdrlref, *sgdrill, pxout, pyout, pfzout,
prdrlout, *feed, strcantext, e
pcom_movea
pmisc1 #Canned Misc #1 Cycle
pdrlcommonb
pcan1, pbld, n, *sgdrlref, *sgdrill, pxout, pyout, pfzout,
prdrlout, shftdrl, dwell, *feed, strcantext, e
pcom_movea
pmisc2 #Canned Misc #2 Cycle (User Option)
pdrill
pdrill_2 #Canned Drill Cycle, additional points
pdrlcommonb
pcan1, pbld, n, pxout, pyout, pzout, prdrlout, dwell,
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 Misc #1 Cycle
pdrill_2
pmisc2_2 #Canned Misc #2 Cycle
pdrill_2
pdrlcst #自定义钻孔循环 8 - 19 (user option)
#Use this postblock to customize drilling cycles 8 - 19
pdrlcommonb
"CUSTOMIZABLE DRILL CYCLE ", pfxout, pfyout, pfzout, e
pcom_movea
pdrlcst_2 #自定义钻孔循环 8 - 19, additional points (user option)
#Use this postblock to customize drilling cycles 8 - 19
pdrlcommonb
"CUSTOMIZABLE DRILL CYCLE ", pfxout, pfyout, pfzout, e
pcom_movea
pcanceldc #Cancel canned drill cycle
result = newfs (three, zinc)
z = initht
prv_zia = initht
pxyzcout
!zabs, !zinc
prv_gcode = zero
pbld, n, "G80", e
# --------------------------------------------------------------------------
# Canned Text
# --------------------------------------------------------------------------
pcan #Canned text - before output call
strcantext = sblank
if cant_no > zero,
[
if cant_pos1 = zero, pcant_1
if cant_pos2 = zero, pcant_2
if cant_pos3 = zero, pcant_3
if cant_pos4 = zero, pcant_4
if cant_pos5 = zero, pcant_5
if cant_pos6 = zero, pcant_6
if cant_pos7 = zero, pcant_7
if cant_pos8 = zero, pcant_8
if cant_pos9 = zero, pcant_9
if cant_pos10 = zero, pcant_10
pbld, n, strcantext, e
strcantext = sblank
]
pcan1 #Canned text - with move
strcantext = sblank
if cant_no > zero,
[
if cant_pos1 = one, pcant_1
if cant_pos2 = one, pcant_2
if cant_pos3 = one, pcant_3
if cant_pos4 = one, pcant_4
if cant_pos5 = one, pcant_5
if cant_pos6 = one, pcant_6
if cant_pos7 = one, pcant_7
if cant_pos8 = one, pcant_8
if cant_pos9 = one, pcant_9
if cant_pos10 = one, pcant_10
]
if cstop, strcantext = strcantext + sm00
if cgstop, strcantext = strcantext + sm01
#Output of strcantext occurs at the end of the output line
pcan2 #Canned text - after output call
strcantext = sblank
if cant_no > zero,
[
if cant_pos1 = two, pcant_1
if cant_pos2 = two, pcant_2
if cant_pos3 = two, pcant_3
if cant_pos4 = two, pcant_4
if cant_pos5 = two, pcant_5
if cant_pos6 = two, pcant_6
if cant_pos7 = two, pcant_7
if cant_pos8 = two, pcant_8
if cant_pos9 = two, pcant_9
if cant_pos10 = two, pcant_10
pbld, n, strcantext, e
strcantext = sblank
]
pcant_1 #Canned text - output call
cantext = cant_val1
pcant_out
pcant_2 #Canned text - output call
cantext = cant_val2
pcant_out
pcant_3 #Canned text - output call
cantext = cant_val3
pcant_out
pcant_4 #Canned text - output call
cantext = cant_val4
pcant_out
pcant_5 #Canned text - output call
cantext = cant_val5
pcant_out
pcant_6 #Canned text - output call
cantext = cant_val6
pcant_out
pcant_7 #Canned text - output call
cantext = cant_val7
pcant_out
pcant_8 #Canned text - output call
cantext = cant_val8
pcant_out
pcant_9 #Canned text - output call
cantext = cant_val9
pcant_out
pcant_10 #Canned text - output call
cantext = cant_val10
pcant_out
pcant_out #Canned text - build the string for output
#Assign string select type outputs
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
]
# --------------------------------------------------------------------------
# 坐标计算,通常不需要修改
# --------------------------------------------------------------------------
pxyzcout #Map coordinates
xabs = vequ (x)
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 |