树梢月光 发表于 2020-11-22 20:31:08

后处理刀号重复的报警代码怎么写???

劳烦各位大驾,指导一下

qiuxiaolong 发表于 2020-11-22 21:44:16

树梢月光 发表于 2020-11-22 21:07
报错了

global nStep
setnStep-1

两行代码加在程序开始

我发的报警代码加在自动换刀的后面

qiuxiaolong 发表于 2020-11-22 20:49:47

#在这里快速回复#global numbers toolnumbers mom_operation_name global nStep nt mom_tool_number ni ntd mom_tool_name set nStep #set nt(0) 9999 set nt($nStep) $mom_tool_number set ntd($nStep) $mom_tool_name #MOM_output_literal " nt($nStep):$nt($nStep)   "for { set ni 0 } { $ni < $nStep } { incr ni } { #MOM_output_literal " nt($ni):$nt($ni)   " if { $nt($ni) == $mom_tool_number } { #MOM_output_literal " Same as before" set nStep if { } { MOM_abort "\n\n same tool number \n\n qq202520 提示您:\n\n 操作:《$mom_operation_name》的刀具号与前面的刀号相同,请重新设定刀具号 \n\n\n " } return } }

qiuxiaolong 发表于 2020-11-22 20:50:55

程序头刀具清单源码以及各种防出错代码

global numbers toolnumbers mom_operation_name
global nStep nt mom_tool_number ni ntd mom_tool_name
set nStep
#set nt(0) 9999
set nt($nStep) $mom_tool_number
set ntd($nStep) $mom_tool_name
#MOM_output_literal " nt($nStep):$nt($nStep)   "

for { set ni 0 } { $ni < $nStep } { incr ni } {
#MOM_output_literal " nt($ni):$nt($ni)   "
if { $nt($ni) == $mom_tool_number } {
#MOM_output_literal " Same as before"
set nStep

if { } {
MOM_abort "\n\n same tool number \n\n qq202520 提示您:\n\n 操作:《$mom_operation_name》的刀具号与前面的刀号相同,请重新设定刀具号 \n\n\n "
}
return
}
}

树梢月光 发表于 2020-11-22 21:07:27

qiuxiaolong 发表于 2020-11-22 20:50
global numbers toolnumbers mom_operation_name
global nStep nt mom_tool_number ni ntd mom_tool_name
...

报错了

树梢月光 发表于 2020-11-22 22:25:53

qiuxiaolong 发表于 2020-11-22 21:44
global nStep
setnStep-1



试了没有用

qiuxiaolong 发表于 2020-11-22 22:27:31

树梢月光 发表于 2020-11-22 22:25
试了没有用

我的都能用你却用不了{:sweat:}

qiuxiaolong 发表于 2020-11-22 22:28:30

树梢月光 发表于 2020-11-22 22:25
试了没有用

还有个原因就是和你用的代码冲突了

qiuxiaolong 发表于 2020-11-22 22:29:03

qiuxiaolong 发表于 2020-11-22 22:28
还有个原因就是和你用的代码冲突了

你自己摸索吧

qiuxiaolong 发表于 2020-11-22 22:32:45

qiuxiaolong 发表于 2020-11-22 22:28
还有个原因就是和你用的代码冲突了

你自己摸索吧
页: [1] 2
查看完整版本: 后处理刀号重复的报警代码怎么写???