LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using a<x<b in formula node

Solved!
Go to solution

Hi, I am trying to use the following code snipped in formula node:

 z=(x-2.5)*50;
if (z>-10.0||z< 10.0) {
y = 0;
c=0;}
else {
y = 5*x-12.5;
c=1;}

 

x is input (from cRIO) and z, y, c are outputs .

It doesn't seems to work properly, y, c are always 0.

How else can I use compound evaluation: -10<z<10 ????

Thanks,

Arthur

0 Kudos
Message 1 of 3
(2,374 Views)
Solution
Accepted by topic author millerman
replace || with &&
_________________________________________________________________________________________________
LV 8.2 at Windows & Linux


Message 2 of 3
(2,366 Views)

elementary, Watson.

Thanks

0 Kudos
Message 3 of 3
(2,347 Views)