From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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,359 Views)
Solution
Accepted by topic author millerman
replace || with &&
_________________________________________________________________________________________________
LV 8.2 at Windows & Linux


Message 2 of 3
(2,351 Views)

elementary, Watson.

Thanks

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