LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

In a multi-conditional formula node it keeps returning same thing

I am trying to execute a multi-conditional if else loop. From this website it says version 6.0 (which I have) can use C language so it should be something like:
if (x=0) y= 1000;
else if (x=1) y= 60000;
else if (x=2) y= 90000;
else y=0;
etc
what I am trying to do is take a value from a ring (0,1,2,3) and multiply it by a certain constant depending on what the value is. However, no matter what I do the loop is returning only the first value of the if statement no matter what the input value is. How can I get this loop to return 60000 if x=1 etc?
0 Kudos
Message 1 of 2
(2,486 Views)
Try this code - this is just syntax. More information is available in the help files in LabVIEW DSC.

if(x==0) {
y=1000;
}
else if(x==1) {
y=60000;
}
else if(x==2) {
y=90000;
}
else
y=0;

Let me know if you have any other questions.
0 Kudos
Message 2 of 2
(2,486 Views)