LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Applying Logic Gates on Numeric Data.. How it works?

Solved!
Go to solution

Hello,

While working with labview i tried to apply OR Gate on Numeric Data, it accepted the input and replied the output in Numeric form too.

I couldnt understand how is it working on a numeric data while the input are supposed to be boolean for the logic gates input.

The outputs are also out of the assumption at 5 || 4 gives result 5.

I am also attaching my VI.

Kindly inform what is the logic behind this calculation.

Regards

0 Kudos
Message 1 of 3
(4,643 Views)

I am not sure how it is done but when I did the same logical operation by converting the number to Boolean array the result is same. So I guess internally LabVIEW converts the number to boolean array and performs Logical operation and back converts it. In your example additionaly it converts DBL to I 32 and does the logical operation.

-----

The best solution is the one you find it by yourself
Message 2 of 3
(4,630 Views)
Solution
Accepted by topic author Abuzar

Hi,

 

logical operations work with integers (any kind will do) too. The integer is used bitwise...

 


The outputs are also out of the assumption at 5 || 4 gives result 5.


 

5 is "0101" in binary representation, 4 is "0100":

0101 OR
0100
____
0101 result

 

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 3 of 3
(4,621 Views)