|
发表于 2025-3-25 16:26:10
|
显示全部楼层
代码关掉刀具清单就不显示.打开就乱码.好像不识别MOM代码
global ptp_file_name
set tmp_file_name "${ptp_file_name}_"
if {[file exists $tmp_file_name]} {
MOM_remove_file $tmp_file_name
}
MOM_close_output_file $ptp_file_name
file rename $ptp_file_name $tmp_file_name
set ifile [open $tmp_file_name r]
set ofile [open $ptp_file_name w]
global tooli numbers toolnumbers sametoolZmin
global mom_output_file_basename
global mom_part_name
global mom_date numbers
global mom_part_name st1 st2 st3 st4
puts $ofile "%"
puts $ofile "O0001"
puts $ofile "G17 G40 G49 G80"
#puts $ofile "(Part: $st3)"
#puts $ofile "(Equipment: FANUC)"
#MOM_output_literal "%"
#MOM_output_literal "O0001"
#MOM_output_literal "$mom_output_file_basename"
#MOM_output_literal "(Part: $st3)"
#MOM_output_literal "(NC Name: $mom_output_file_basename.NC)"
#puts $ofile "(Equipment: FANUC)"
#MOM_output_literal "G17 G40 G49 G80"
global mom_part_name
#puts $ofile "(Part: $mom_part_name)"
global mom_date
set datee [clock format [clock seconds] -format "%Y/%m/%d %H:%M /%w"]
puts $ofile "($datee)"
global mom_output_file_basename
puts $ofile "(NC name: $mom_output_file_basename.NC)"
global mom_machine_time
puts $ofile "(Machine time: [format "%.2f" $mom_machine_time] MIN)"
MOM_output_literal "(Total Tool numbers)"
#puts $ofile "(Total Tool numbers)"
global toollistend ii iii Step numbers
for { set ii 0 } { $ii < $numbers } { incr ii } {
set iii [expr $ii+1 ]
MOM_output_literal "($toollistend($ii))"
#puts $ofile "($toollistend($ii))"
}
set buf ""
while { [gets $ifile buf] > 0 } {
puts $ofile $buf
}
close $ifile
close $ofile
MOM_remove_file $tmp_file_name
MOM_open_output_file $ptp_file_name |
|