LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

"and' logic output

Solved!
Go to solution

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!

0 Kudos
Message 1 of 3
(2,070 Views)
Solution
Accepted by topic author wew044

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.

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

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,

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