Mastercam后处理圆弧起刀补正报警修改
2012-06-20 11:00阅读:
NC中圆弧起刀补正是非法的,不允许的,MC post
处理代码段如下,以下代码只报警,却不报Op_ID,不方便查找错误操作。
pcompwarn
#Cutter Compensation Check
if prv_cc_pos$ <>
cc_pos$ & cc_pos$ & gcode$ > 1,
[
if
compwarnflg = 0,result = mprint(scompwarn,1)
spaces$ =
0
pbld, n$,
pspc, *sm00, pspc, '(', scompwarn, ')', e$
spaces$ =
sav_spc
compwarnflg
= 1
]
r> 按以下方法修改代码,加入OP_ID输出。
sonopid : ''
#定义空字符变量
pcompwarn
#Cutter Compensation Check
if prv_cc_pos$ <>
cc_pos$ & cc_pos$ & gcode$ > 1,
[
if
compwarnflg = 0,sonopid=no2str(op_id$),result
= mprint(scompwarn+' ,'+'on op_id:'+sonopid,1)
spaces$ =
0
pbld, n$,
pspc, *sm00, pspc, '(', scompwarn, ')', e$
spaces$ =
sav_spc
compwarnflg
= 1
]
修改后,下图刀路后处理结果如下
报警信息中多了“,On op_id:3. ”,提示错误操作ID号3。
---------------------------------------------------------------------------------------------------------------------------
sonopid : '' #定义空字符变量
pcompwarn
#Cutter
Compensation Check
if prv_cc_pos$ <>
cc_pos$ & cc_pos$ & gcode$ > 1,
[
if
compwarnflg = 0,sonopid=no2str(op_id$),result = mprint(scompwarn+'
,'+'on op_id:'+sonopid,1)
spaces$ =
0
pbld, n$,
pspc, *sm00, pspc, '(', scompwarn, ')', e$
spaces$ =
sav_spc
compwarnflg
= 1
]
-----------------------------------------------------------------------------------------------------------------------------
附:上述代码释义
sonopid : '' #定义空字符变量
sonopid=no2str(op_id$)#获得op_id并转换成字符型
mprint(scompwarn+' ,'+'on op_id:'+sonopid,1)#输出字符合并后,消息输出,
#函数中第二个参数表示对话框类型,1表示消息输出,只有一个确认按钮。
BY TA
(PLS Do not copy)