Cancel
Showing results for 
Search instead for 
Did you mean: 

Post gurus: check for duplicate tool numbers?

Legend
Legend

Is there a simple way to check for accidental use of the same tool number for different tools? Maybe a cross-reference that reads the tool number, associated length and diameter and flags an error if these don't match?

 

Many Thanks/Harri

8 REPLIES

Re: Post gurus: check for duplicate tool numbers?

Legend
Legend
You can store the attributes ot each tool in custom global variables (lists). During tool change it is enough to compare the data of new tool with previous ones from the globals.

Re: Post gurus: check for duplicate tool numbers?

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Perhaps somethng like this (note I have not checked this code, so there may be some bugs)

global mom_tool_name
global mom_tool_number
global mom_operation_name global harri_tool_info if {![info exists $harri_tool_info($mom_tool_number)]} {
set harri_tool_info($mom_tool_number) $mom_tool_name
} elseif {$harri_tool_info($mom_tool_number) != $mom_tool_name} {
# your error message here, example might be:
MOM_output_to_listing_device "$mom_operation_name - ERROR - Tool $mom_tool_number already assigned to tool $harri_tool_info($mom_tool_number), now you are trying to use it for $mom_tool_name"
}

 

Alter message to suit.

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


Re: Post gurus: check for duplicate tool numbers?

Legend
Legend

Thanks Ken and Frobi, I'll be looking into this!

 

Harri

 

Re: Post gurus: check for duplicate tool numbers?

Legend
Legend

@Ken_A@hjoy

 

 

Hello Everyone,

 

I am interesting in trying to use this.  Anyone get it working for themselves?

 

First i got the message "no such variable"

 

I then put at (Start Of Program) a command setting the variable to 0. (has worked for me before in other cases)

 

Now I get the message that the variable is not an array. 

 

At (Start Of Path) I put the command below. 

 

 

Any ideas?

 

I'm a little rusty on how to use arrays. Still trying to learn about them. 

 

 

Thanks,

 

global mom_tool_name
global mom_tool_number
global mom_operation_name

global tool_duplicate_check

if {![info exists $tool_duplicate_check($mom_tool_number)]} {
set tool_duplicate_check($mom_tool_number) $mom_tool_name
} elseif {$tool_duplicate_check($mom_tool_number) != $mom_tool_name} {
# your error message here, example might be:
MOM_output_to_listing_device "$mom_operation_name - ERROR - Tool $mom_tool_number already assigned to tool $tool_duplicate_check($mom_tool_number), now you are trying to use it for $mom_tool_name"

}

Glenn Balon
Production: NX 12.0.2 MP3 Primarily CAM

Re: Post gurus: check for duplicate tool numbers?

Solution Partner Genius Solution Partner Genius
Solution Partner Genius

Hello Glenn,

 

My guess is that you need remove the "$" sign as in the image below.

 

Untitled.png

 

I hope this helps.

 

Thanks.

Jean Marcel
Application Engineer
Ally PLM Solutions | PROLIM PLM

Re: Post gurus: check for duplicate tool numbers?

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

And you might want to ignore tools with an "empty" name (i.e. operation has no tool assigned)

 

global mom_tool_name
global mom_tool_number
global mom_operation_name

global tool_duplicate_check

if {![info exists mom_tool_name] ||
    ![string length $mom_tool_name]} {
    # no tool name
    return
}

# has Jean's fix
if {![info exists tool_duplicate_check($mom_tool_number)]} {
    set tool_duplicate_check($mom_tool_number) $mom_tool_name
} elseif {$tool_duplicate_check($mom_tool_number) != $mom_tool_name} {
    # your error message here, example might be:
# not sure if code wrapped when you posted, but this needs to be on one line MOM_output_to_listing_device "$mom_operation_name - ERROR - Tool $mom_tool_number already assigned to tool $tool_duplicate_check($mom_tool_number), now you are trying to use it for $mom_tool_name" }
Ken Akerboom Sr CAx Systems Engr, Moog, Inc.
Production: NX10.0.3.5 MP16/TC11.2
I'd rather be e-steamed than e-diseaseled


Re: Post gurus: check for duplicate tool numbers?

Legend
Legend

Looks good.

 

Thank you everyone for your help.

 

This is what I came up with below. Hopefully other people can use it too. 

Maybe the original poster can mark as a solution if they see it. 

 

I already had the operation name in my listing, that is why it is not shown here and commented out. 

 

 

 

I placed this new command in all my tool change events. 

 

 

global mom_tool_name
global mom_tool_number
#global mom_operation_name
global tool_duplicate_check


if {![info exists mom_tool_name] ||
![string length $mom_tool_name]} {
# no tool name
return
}


if {![info exists tool_duplicate_check($mom_tool_number)]} {
   set tool_duplicate_check($mom_tool_number) $mom_tool_name
} elseif {$tool_duplicate_check($mom_tool_number) != $mom_tool_name} {
   MOM_output_to_listing_device ""
   MOM_output_to_listing_device "!!!!! - T$mom_tool_number has duplicate !!!!!"
   MOM_output_to_listing_device " $tool_duplicate_check($mom_tool_number) already using $mom_tool_number"
   MOM_output_to_listing_device " $mom_tool_name needs unique tool number"
   MOM_output_to_listing_device ""

}

 

 

duplicate warning3.PNGCommand placement

 



duplicate warning1.PNGInfo window listing with errorduplicate warning2.PNGTest file with duplicate

Glenn Balon
Production: NX 12.0.2 MP3 Primarily CAM

Re: Post gurus: check for duplicate tool numbers?

Legend
Legend

Thanks everyone, I'll mark this thread as resolved! Pity you can only tag one post as a solution. As often is, this was a group effort.

 

/Harri

Learn online





Solution Information