Cancel
Showing results for 
Search instead for 
Did you mean: 

#TOOL variable

Pioneer
Pioneer

Hello,

I have a problem try to simulate a toolpath, follow that training: 

 

https://community.plm.automation.siemens.com/t5/Tech-Tips-Knowledge-Base-NX-Manufacturing/Customize-...

 

I can't activate the tool lenght compensation, I see that it uses $TOOL variable, does it is that the problem? Beacause I didn't define that variable and if I try to get it in my GCODE I see that it is undefined. I don't get any error, just the code ignore compensation.

 

This is my metacode of D address:

 

 <Name>D</Name>
 <Param>Value</Param>
<Execute>
<Command>
 <Name>ActivateTransformation</Name>
 <Param>"$TOOL"</Param>
 <Param>FALSE</Param>
 <Param>FALSE</Param>
 </Command>
<Command>
 <Name>ResetTransformation</Name>
 <Param>"$TOOL"</Param>
 </Command>
<IfCommand>
 <Condition>0!=Value</Condition>
<Then>
<Command>
 <Name>SetToolCorrection</Name>
 <Param>INTEGER(Value)</Param>
 <Param>"S"</Param>
 </Command>
<Command>
 <Name>DisplaceOrigin</Name>
 <Param>"$TOOL"</Param>
 <Param>TRUE</Param>
 <Param>"Z"</Param>
 <Param>getLCorrection()</Param>
 </Command>
 </Then>
 </IfCommand>
<Command>
 <Name>ActivateTransformation</Name>
 <Param>"$TOOL"</Param>
 <Param>TRUE</Param>
 <Param>TRUE</Param>
 </Command>
 </Execute>

And this is my toolchange subprogram:

 

##LANGUAGE AC

INT nToolID;
STRING currentTool;
STRING sToolName;

nToolID = getVariable("$P_TOOLP");

IF (0 != nToolID);
    sToolName = getToolNameByNumber(nToolID);
    generateTool(sToolName, "S");
ENDIF;

IF (exist(getCurrentTool("S")));
    visibility(getCurrentTool("S"), OFF, TRUE);
    release(getCurrentTool("S"));
ENDIF;

IF (exist(getNextTool ("S")));
    grasp (getNextTool("S"), getSpindleObject("S"));
    visibility(getNextTool("S"), ON, TRUE);
    activateNextTool("S");
ENDIF;

currentTool = getCurrentTool("S");

##LANGUAGE NATIVE

Could someone help me?

 

Thank you

5 REPLIES

Re: #TOOL variable

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi,

 

let me clarify some general points first:

 

- $TOOL is not a variable! It´s a transformation (with a special purpose for cse simulation) which must/should be used to store the tool length values

- $TOOL is always available and usable even though it is not displayed in the transformation stack in Machine Configurator

 

Back to your problem... please check if the tool lengths are available via cse functions getLCorrection(), getZCorrection() and getQCorrection() in cse variables. If they are '0' maybe the mounted tool is not activated?

 

Thomas

Re: #TOOL variable

Pioneer
Pioneer

 

 

Hello Thomas,

that are the values if I try to get them from simulation dialog:

 

 

Correttore_Utensile.PNG

The tool is visibile and right mounted on machine, I putted it under a pocket, so everything seems correct

 

Thank you for your help

Re: #TOOL variable

Siemens Phenom Siemens Phenom
Siemens Phenom
Looks good so far.
Does "Z" as axis name exist in the kinematic model?

please, can you add the following to the variables dialog and execute the D1 line
getVectorX(getMatrixTranslation(getTrafoMatrix("$TOOL")))
getVectorY(getMatrixTranslation(getTrafoMatrix("$TOOL")))
getVectorZ(getMatrixTranslation(getTrafoMatrix("$TOOL")))

This function combination queries the translational part from $tool transformation

thanks
Thomas

Re: #TOOL variable

Pioneer
Pioneer

The problem is that after call "D1" using getVectorZ(getMatrixTranslation(getTrafoMatrix("$TOOL"))) i get 75, and it's correct, but on the second call of Z0 I have to see machine moving:

 

T1
M6
G0 X0 Y0 Z0
D1
G0 X0 Y0 Z0 (here It has to move!)

 

Checked axis name, changed Z axis to "Z", nothing changed.

Re: #TOOL variable

Siemens Phenom Siemens Phenom
Siemens Phenom

Hi,

 

is there a D1 call within the M6 called subprogram? What happens when moving all the axes to 0 before the tool change?

 

Thomas

Learn online





Solution Information