Cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted

Math function problem

Experimenter
Experimenter
Hello,
first of all I want to apologize if i wrote this in a bad spot but i really do not know where to ask for it.
 
I'm making a motion simulation in NX11 where I want my car wheels to turn as soon as it reach marker.
My idea was to control the turn through an if/else function right on this path: joint->driver->math functions.
Input would be the absolute displacement in X and Y axis from
created sensors and the output would be the angle, for example:

if(disp_x<=100 && disp_y<=20) then (0) else(if(disp_x<150 && disp_y<100) then (3) else (0))

where disp_x and disp_y are the names of sensors and [0,3] are the angular output values for the joint.
 
Every time i try to do it i recive a message "The math function definition is invalid".
If someone can halp me I will be really gratefull.
4 REPLIES

Re: Math function problem

Siemens Honored Contributor Siemens Honored Contributor
Siemens Honored Contributor

Hi @Maestro_Rafaelo,

 

I'm not familiar with the Motion application, but just looking at your syntax and knowing what the NX Expressions editor would reject/allow, I'd suggest trying the following syntax:

 

if(disp_x<=100 && disp_y<=20)(0)else if(disp_x<150 && disp_y<100)(3)else(0)

 

 

Regards, Ben

Re: Math function problem

Experimenter
Experimenter

Hi BenBroad,

 

thanks for your reply, unfortunettly it still do not work.

Re: Math function problem

Siemens Creator Siemens Creator
Siemens Creator

Hi Maestro_Rafaelo,

Please try below.

 

if(disp_x<=100 && disp_y<=20)(0) else(if(disp_x<150 && disp_y<100)(3) else (0))

 

Hope it helps.

Thanks,

Amol

Re: Math function problem

Experimenter
Experimenter

It is still wrong...