Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

CSE - axis setJointAlias

Hello,

 

is it possible to declare an unusual variable like "GV_B" to the B axis with setJointAlias?

 

Thank you!

14 REPLIES

Re: CSE - axis setJointAlias

Hi VikP,

 

yes it´s possible, but take care wenn using setJointAlias! Don´t forget a documentation about that. When it´s possible, I would suggest to create a adress with the name "GV_B" which points to the B-Axis. It´s more flexible and clear for everyone.

 

ThomasF

Re: CSE - axis setJointAlias

Hi Thomas,

 

thank you for the notice.

 

I created an adress with GV_B, now it's red marked.

 

The metacode looks like that and an error appears with the message "variable not declared":

 

 <Name>GV_B</Name>
 <Param>Value</Param>
 <Param>Flag</Param>
<Execute>
<Command>
 <Name>SetJointAlias</Name>
 <Param>"GV_B"</Param>
 <Param>"B"</Param>
 </Command>
<IfCommand>
 <Condition>"rotational" == getJointParameter("GV_B", "Type")</Condition>
<Then>
<MacroCommand>
 <Name>GMe_SetJointValueRotational</Name>
 <Param>"GV_B"</Param>
 <Param>Value</Param>
 <Param>Flag</Param>
 </MacroCommand>
 </Then>
<Else>
<MacroCommand>
 <Name>GMe_SetJointValueInfRotational</Name>
 <Param>"GV_B"</Param>
 <Param>Value</Param>
 <Param>Flag</Param>
 </MacroCommand>
 </Else>
 </IfCommand>
 </Execute>
 
 

Re: CSE - axis setJointAlias

Hi VikP,

 

please clarify what you want to do?

I assume:

- you have an axis in the KIM with its name "GV_B"?

- you move this axis with the following NC code by e.g. B10?

 

ThomasF

Re: CSE - axis setJointAlias

Almost right, but please turn the trouble like that:

 

- I have an axis in the KIM with its name "B"

- I move this axis with the following NC code by e.g. GV_B=10

 

Solution
Solution
Accepted by topic author VikP
‎08-26-2015 04:32 AM

Re: CSE - axis setJointAlias

In that case you need the "power" of the CSEPreprocessLine ;-) because "GV_B" is no valid axis adress for the parser. This method is called for every NC Code line BEFORE the string is send to the parser.

 

Remark:

It´s similar to the SetJointAlias function... BE CAREFUL!! Take care of a good traceability and documentation! 

 

<Name>CSEPreprocessLine</Name>
<Param>strLine</Param>
<Execute>
   <AssignCommand>
      <Variable>strLine</Variable>
      <Value>replaceSubstr("GV_B",strLine,"B")</Value>
   </AssignCommand>
   <ReturnCommand>
      <Value>strLine</Value>
   </ReturnCommand>
</Execute>

ThomasF

Re: CSE - axis setJointAlias

It works!

 

Thank you very much! Very good...

 

 

But I also found another way and wrote this into the main.ini :

 

DEFINE GV_B AS G0 B

Re: CSE - axis setJointAlias

DEFINE AS is for Sinumerik only!

Re: CSE - axis setJointAlias

Hi everybody,

 

I've got a new problem.

How can I define Y2 as a new second geo axis by checking a variable (isDefined)?

Normally the second geo axis is Y1. I use NX 10.0.2.6 MP1.

 

Thanks.

Re: CSE - axis setJointAlias

Use the CSE Kernel command

 

SetFirst/Second/ThirdGeoAxis(JointName)

 

ThomasF

Learn online





Solution Information