×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

tool list in nc program

tool list in nc program

tool list in nc program

(OP)
hi,how add to my nc program a tool list(the description,mom_tool_description) at the begin of program?
i see this comand but don´t works with mom_tool_description.
Need reprocess it?
Thnaks

CODE -->

global ptp_file_name mom_definition_file_name mom_output_file_full_name 
global mom_output_file_directory mom_output_file_basename mom_output_file_suffix 
global mom_warning_info 
global mom_machine_time mom_group_name mom_operation_name mom_part_name
global mom_tool_count mom_tool_use
global mom_logname mom_ug_version mom_date mom_machine_name 

set tm1 [clock seconds]
set tm2 [clock format $tm1 -format "%M:%S"]
MOM_log_message "MOM Start = $tm2 "

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]

set temp ";%_N_"
set temp1 $mom_output_file_basename
set temp2 _MPF
set stroka [concat $temp$temp1$temp2]
puts $ofile "$stroka"

set temp ";$"
set temp1 "PATH=/_N_WKS_DIR/_N_WORK_PROGRAMS\_WPD"
set stroka [concat $temp$temp1]
puts $ofile "$stroka"

puts $ofile " "
set path $mom_part_name
puts $ofile ";(PART: $path)"

if {[info exists mom_operation_name] == 0} { set mom_operation_name "" }
if {[info exists mom_group_name] == 0} { set mom_group_name $mom_operation_name }
puts $ofile ";(Program: $mom_group_name)" 
puts $ofile ";(Date:$mom_date User:$mom_logname)"
puts $ofile ";(MACHINE: $mom_machine_name, Siemens CNC)"

puts $ofile ";(MACHINE TIME: [format "%.2f" $mom_machine_time] MIN)"
puts $ofile " "

puts $ofile ";(----------- TOOL LIST -----------)"
for { set nn 0 } { $nn < 99 } {incr nn} {
  if {[hiset mom_tool_use($nn,0)] && [hiset mom_tool_use($nn,1)]} {
    set a [scan $mom_tool_use($nn,0) %d tn]
    set str [format "%s %.2f" $tn $mom_tool_use($nn,1)]
    puts $ofile ";(TOOL NUMBER $str MIN)"
  }
}
puts $ofile ";(--------- END TOOL LIST ---------)"

while { [gets $ifile buf] > 0 } {
   puts $ofile $buf
}

close $ifile
close $ofile
MOM_remove_file $tmp_file_name

set tm1 [clock seconds]
set tm2 [clock format $tm1 -format "%M:%S"]
MOM_log_message "MOM End = $tm2 "

MOM_open_output_file $ptp_file_name 

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources