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: 

Allow programability to few specific bits in a word while other remain fixed

Solved!
Go to solution

@smercurio_fc wrote:

I went by the original statement of the problem, which had ones. If you want a more generic solution, that's a simple modification (still with no arrays Smiley Wink)


I strongly suspected that there would be a way, but I didn't have it.  Thanks you.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 11 of 14
(322 Views)

Here is based on what I was saying,  but I should've XORed the final step rather than AND.

 

 

Try this.

 

This turns off the bits of interest then toggles them on.

 

See if it works for all cases.

Message 12 of 14
(317 Views)

It is simple to merge two values based on a mask.  When a bit in the mask is 0, that bit from the 'unmasked' value is chosen, otherwise the bit from 'masked' is chosen.

 

ControlBits.png

Message 13 of 14
(313 Views)

Thx a lot everyone for putting your efforts.

0 Kudos
Message 14 of 14
(290 Views)