LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

controling 20 bits

Solved!
Go to solution

Do not Add and Subtract when it comes to Boolean logic.  AND and OR are what you want.  If the bit comes in as a TRUE, you OR your number with 1 where that bit belongs (1 OR 1 = 1).  If the bit comes in as a FALSE, you AND that bit as a 0.

 

So let's just say you have 0xFFFF right now.  You are told to endable bit 5.  So you perform 0xFFFF OR 0x0010 = 0xFFFF.  Yep, that test is still enabled.

Now you are told to disable bit 5.  So you perform 0xFFFF AND 0xFFEF = 0xFFEF.  Or if you had nothing enabled before, you have 0x0000 AND 0xFFEF = 0x0000.  Yep, still not running anything.

 

 


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 11 of 12
(365 Views)

thanks 

0 Kudos
Message 12 of 12
(331 Views)