If function problem - can't get it worked

Creator
Creator

Hi everyone, I'm desperate of keep searching for the solution. I'm using NX 12 and I tried all the command of if function I found but nothing works. 

 

My case: I'm trying to do this command: if "displacement sensor != 0" then "force == 100" else "force == 0"

What I wrote in Function: IF(Se002 != 0)(100) ELSE (0) 

I have also tried: IF(Se002 != 0, 100, 0)

I enter this function creation within a vector force creation. I clicked Vector force, chose the link, base etc., then at Magnitude I chose Function, enter Function Manager, create.

 

Is there something I don't understand? What kind of Syntax is this? I know Python, Java but this isn't any of them, C++ is also different. And I can't seem to find in Help where they actually show how to use the function

 

Thanks for reply, I will be very very appreciated

4 REPLIES 4

Re: If function problem - can't get it worked

Siemens Experimenter Siemens Experimenter
Siemens Experimenter

Hello,

 

All functions of the Simcenter 3D Motion solver are documented in the Online Help. Attached you find a document from the OLH explaining the different functions, including the IF function.

 

Based on the information underneath, I would say you need next function:

 

IF(Se002,100,0,100)

 

Regards

Re: If function problem - can't get it worked

Creator
Creator
Hi Jonas, thanks for the attachment I found the Syntax of IF

However, base on what the document describes, the function you wrote is neither of the 2 possible syntaxes.
Either IF (e1:e2, e3, e4) or IF(cond,e1,e2)
Can you please explain your function? Why is there 4 commas, Thanks!
Highlighted

Re: If function problem - can't get it worked

Siemens Experimenter Siemens Experimenter
Siemens Experimenter

You're right, it should be:

 

IF(Se002:100,0,100)

 

Regards

 

 

Re: If function problem - can't get it worked

Creator
Creator
Thank you for your answer, I will practice a little bit and see what happens. Can I get your contact by any means? Whatsapp, email, facebook messenger? It would be great! I won't ask nonsense and without careful research. Thanks and have a nice day