07-03-2019 08:48 PM - edited 07-03-2019 08:56 PM
Hi Labview Experts,
I am trying to make two cases with the use of 'and' logic.
case 1: when motor speed and valve openess = 0, process pressure = 0, this works.
case 2: when motor speed and valve openess not = 0, process pressure proceeds with a simple calculation.
However, there are two issues:
1. For some reason case 1, doesnt work for some values. For example, if you put motor speed = 30, and valve openess = 0, it still reads TRUE and goes to the case 1.
2. Some values does not work for case 2. For example, if you input the values, 32 and 21, for motor speed and valve respectively, it doesn't go to case 2. That seems strange to me
is there a way to fix this?
attached is the VI.
Thanks!
Solved! Go to Solution.
07-03-2019 10:44 PM
You don't seem to understand the difference between boolean logic and boolean operations on integers. Also, the fact that boolean operations on integers doesn't work when you are acting on floating point numbers.
Browse the Comparison palette. Do you see functions in there like =0 and <>0 ? Mind you, comparing floating point values to zero can be problematic depending on where the value comes from. A zero may not truly be zero.
You performed the comparison operations after the boolean operations rather than the other way around!
Also, what do you want the output to be if one is zero and the other is not? You haven't defined that.
See attached subVI to fix your issues.
07-04-2019 11:27 AM
Thanks a lot for your help!
I read up on boolean logic (bitwise) also and yes I understand why the comparison wouldnt work now.
Best,