Showing results for 
Search instead for 
Do you mean 
Reply

How can i do tool code replace tool number , and in the head show all tool code and tool number?

5 REPLIES

Re: How can i do tool code replace tool number , and in the head show all tool code and tool number?

Hi!

1) At the start of program define the custom global variable ToolNumbers as list:

global ToolNumbers
set ToolNumbers [list]

2) In the procedure of tool change add the lines like this:

global mom_tool_number
global ToolNumbers

set l [llength $ToolNumbers]
for { set i 0 } { $i < $l } { incr i } {
set num [lindex $ToolNumbers $i]
if { $mom_tool_number == $num } { break }
}

if { $i >= $l } { lappend ToolNumbers $mom_tool_number }
MOM_output_literal [format "TOOL CALL Q%d ..." [expr 601+$i]]

3) Add the procedure like PB_cmd_reprocess (see http://community.plm.automation.siemens.com/t5/Discussion-Forum-NX/PostProcessor-The-minimum-and-max...) to the end_of_program, where instead of max/min limits you should output the list of tool numbers:

global ToolNumbers

set l [llength $ToolNumbers]
for { set i 0 } { $i < $l } { incr i } {
set num [lindex $ToolNumbers $i]
MOM_output_literal [format "Q%d=%d" [expr 601+$i] $num]
}

 

Re: How can i do tool code replace tool number , and in the head show all tool code and tool number?

I have problemI have problem

Re: How can i do tool code replace tool number , and in the head show all tool code and tool number?

I share my files in the post,you can try it!
I have follow your post setting,but it isn't Correct

Re: How can i do tool code replace tool number , and in the head show all tool code and tool number?

Hi,

1) Any format of address may be defined either in a template file *.def or using tcl command format.

For example:

MOM_output_literal [format "TOOL CALL Q%d S%.1f" [expr 601+$i] $mom_spindle_speed]

 The parameter %.1f means to output one digit after decimal point.

 

2) About transfer of any data from program end to program start I wrote here: http://community.plm.automation.siemens.com/t5/Discussion-Forum-NX/PostProcessor-The-minimum-and-max...

Please read carefully. You only should insert lines of output "Q601=..." into the procedure PB_cmd_reprocess and call it in the end of program.

Re: How can i do tool code replace tool number , and in the head show all tool code and tool number?

Hi FROBI

 

I got it! 

Thanks

Learn online





Solution Information