Showing results for 
Search instead for 
Do you mean 
Reply

How to define cutting time?

[ Edited ]

How to define cutting time for tool?

I want results

(------------------------------)

N1 (CUTTING_TIME:3 MINS)

T01M6

... ...

 

I tried to change in PB, but the result does not!

My Test Methods:

 

#Start of Path:

MOM_output_text "CT"

 

}

#--------------------------------------------------

#End of Program:

global ptp_file_name tt mom_cutting_time

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 OLD [open $tmp_file_name r] ; set NEW [open $ptp_file_name w]

 

set line ""
while {[gets $OLD line] >= 0} {

    if {$line eq "CT"} {
    puts $NEW [lindex $tt 1]
   } else {
   puts $NEW $line
   }
}

 

close $OLD ; close $NEW
MOM_remove_file $tmp_file_name

 

 

4 REPLIES

Re: How to define cutting time?

It looks like you are appending the list with the cutting times of the tool and your are using the tool number to query the list?  How were you planning on matching up the different operations and the index value that it corresponds to in the list?  It seems like you need to have a way to count how many times you output the cut time to the list and then do a while loop to increment the index number you put out at the end to the program.

Jake Hardwick
CNC Programmer
Senior Aerospace AMT
Production NX8.5.3.3 Beta testing NX10.0.1.4

Re: How to define cutting time?

[ Edited ]

Seems to me that your list is supposed to handle both tool number and current path time. You may want to make 2 lists or an array with tn as index like tt(tn).

NX10.03
Windows 7 Pro

Re: How to define cutting time?

FYI this custom command from Hank Holt will output the time per path.

 

#===============================================================================
# Exported Custom Commands created by holt
# on Wed Feb 05 16:11:49 2003 Central Daylight Time
#===============================================================================



#=============================================================
proc PB_CMD_start_time { } {
#=============================================================
global accumulated_time
set accumulated_time 0
}



#=============================================================
proc PB_CMD_path_time { } {
#=============================================================
# 
# add the custom command PB_CMD_start_time to
# the Start_of_Program event, then add
# this custom command to the End_of_Operation event
# This will calculate the time for each path and output it

global mom_machine_time accumulated_time mom_operation_name
global mom_sys_control_in mom_sys_control_out ci co

# call in the control in & out codes

set ci " "
set co " "
if {[info exists mom_sys_control_in] == 1 }  { set ci $mom_sys_control_in }
if {[info exists mom_sys_control_out] == 1 }  { set co $mom_sys_control_out }

set op_time [expr $mom_machine_time - $accumulated_time]
MOM_set_seq_off
MOM_output_literal "$co==========================================$ci"
MOM_output_literal "$co OPERATION: $mom_operation_name   TIME: [format "%3.1f" $op_time] MIN.$ci"
MOM_output_literal "$co==========================================$ci"
MOM_set_seq_on
set accumulated_time $mom_machine_time


}



#=============================================================
proc PB_CMD_machine_time { } {
#=============================================================

global mom_machine_time ci co
MOM_set_seq_off
MOM_output_literal "$co ========================================== $ci"
MOM_output_literal "$co TOTAL TIME: [format "%3.1f" $mom_machine_time] $ci"
MOM_output_literal "$co ========================================== $ci"
MOM_set_seq_on

}

 

 

 

Mark Rief
Retired Siemens

Re: How to define cutting time?

1) Note that "$line" may actually be "CT " (note the space after the CT)

This was true up thru NX7.5, I haven't tested after that.

I would also suggects a longer string (e.g. "PUT CUTTING TIME HERE")

 

2) I would store the time as an array based on operation name.

Then change the flag line to "PUT CUTTING TIME HERE: $mom_operation_name"

then search for the tsart, parse the op name, output the data.  At the end of everything, make sure all operation time data has been output (?delete array element when used, then see if array size > 0 at end?)

 

Note you may also have to check if no time info exists for the operation (just in case...)

 

Ken

Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP5 + patch/TC11.2
I'd rather be e-steemed than e-diseaseled


Learn online





Solution Information