LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to make a set of boolean cases into a bits of a byte

I'm trying to create a byte based on a series of toggle buttons. My problem is that LV takes the "0" and "1" values as a byte value rather than bits or as ASCII values 48 and 49. I'm trying to avoid using the base two conversion. Anyone have any suggestions?
0 Kudos
Message 1 of 4
(2,801 Views)
It sounds like you were just a little off from what you wnated!

Check out this demo that shows you how to use the "Boolean Array To Number" function. I added what little I could and still have it work out the way you would like.

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 4
(2,801 Views)
Hi,

I am attaching a vi which takes any number that is generated when any of the switch is toggled.

If u are looking something different, pl. clear. Your feedbacks are welcome.

Best regards,
Nirmal Sharma
India
0 Kudos
Message 3 of 4
(2,801 Views)
> I'm trying to create a byte based on a series of toggle buttons. My
> problem is that LV takes the "0" and "1" values as a byte value rather
> than bits or as ASCII values 48 and 49. I'm trying to avoid using the
> base two conversion. Anyone have any suggestions?

I'm not certain what conversion you are trying to make, but look at the
Boolean Array to Number conversion node. It takes eight, sixteen, or 32
Boolean array elements and packs them into an integer, thus TF in an
array becomes 10 in base two or 2 in base ten.

If this isn't what you want, please be more specific.
Greg McKaskle
0 Kudos
Message 4 of 4
(2,801 Views)