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: 

How to implement logical equation as LabView?

Solved!
Go to solution

Hi,

 

I have this bit test logic I need to implement as a Labview code.

Should I use formula node or either something similar to this already in Labview?

 

"((var & (1<<bit)) != 0)"  where 'var' may be 8, 16, or 32bit, 'bit' is a number 0 - 31 representing

a bit number. 0 is the least significant bit.

 

Thank you,

 

Do

0 Kudos
Message 1 of 4
(2,608 Views)
Solution
Accepted by topic author horanyee

 

Rotate, And, Not equal to zero

Message Edited by Ravens Fan on 08-10-2009 09:36 PM
0 Kudos
Message 2 of 4
(2,595 Views)

You could use a formula node or just a bunch of math nodes.  Either will work.

 

The only really "tricky" part (and it's not that tricky) is the bit shifting.  Just use 2^bit instead of 1<<bit

 

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 3 of 4
(2,592 Views)
Just saw your post Ravens Fan.  Didn't think of a rotate, but that (of course) would work.
-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 4 of 4
(2,591 Views)