LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unsigned Integer to Cluster of 8 Booleans

Solved!
Go to solution

I am developing a basic counter program for an FPGA and am struggling with converting the unsigned 8-bit integer to an cluster of 8 front panel LEDs.

 

The aim is to depict the binary value of the counter with a set of 8 LEDs, but an integer to a cluster of 8 booleans are considered incompatable. 

 

Any suggestions?

 

Counters Screengrab.png

0 Kudos
Message 1 of 4
(3,410 Views)
Solution
Accepted by topic author David-Baratheon

Don't use the cluster.  Instead, hit ctrl+space and type in "to boolean array"

 

This should convert your integer to a boolean array.  Just be aware the first element in your array is the LSB.

 

Also, before you get too into developing this application, you should take a look at some of the basic courses for LabVIEW.  I'm guessing you come from a text based background.  Would it make sense for you to define struct bob and later say bob = 3?  It doesn't make sense in LabVIEW either.  That's why your wires are broken.  If you want to convert data types, you need to do this before wiring the two wires together.  Otherwise, you'll have data conflicts.

Message 2 of 4
(3,377 Views)

to Boolean array did the trick. Thanks.

0 Kudos
Message 3 of 4
(3,371 Views)

I'm sure you noticed this now.  There's also the inverse boolean array to int.  You can use these to save on the transfer of booleans with the FPGA.  If you're trying to do logic, make sure you remember the LSB tidbit.

Message 4 of 4
(3,368 Views)