LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

bit array

Hi,

I have an array in labview of u8 numerics. Each numeric is a bit (1 or 0). Each u8 numeric is a byte large, which for an array representing 100 bits would be 100 bytes = 800 bits (8 times as large). Is there a way to represent single bits (1 and 0's ) in labview efficiently.

Thank you,

-Tim
0 Kudos
Message 1 of 14
(5,604 Views)

Does that mean a U8 true is 255 (all 1's) and a U8 false is 0 (all 0's)?

How about this?

Message Edited by Ravens Fan on 07-13-2007 11:04 PM

Message 2 of 14
(5,601 Views)

Or with a simpler alternative.

Message Edited by Ravens Fan on 07-13-2007 11:11 PM

Alternative #3 added.

Message Edited by Ravens Fan on 07-13-2007 11:15 PM

Download All
Message 3 of 14
(5,600 Views)
Message timed out before I got #3 in.
 

Message Edited by Ravens Fan on 07-13-2007 11:18 PM

Message 4 of 14
(5,594 Views)
Hi,

I meant by 1 and 0 that the lsb (least significant bit) of each U8 numeric is 1 and 0. So we have in binary for each u8 element of the array 1 and 0.

Thank you for your reply,

Tim
0 Kudos
Message 5 of 14
(5,585 Views)
Even more simplified....


Message Edited by Bill@NGC on 07-13-2007 10:25 PM

Message 6 of 14
(5,579 Views)
LabVIEW 4.1 was the last version that stored an array of booleans in packed format. A boolean array now is an array of bytes so converting U8 to boolean only makes a copy of the data. You can use run length encoding or bit packing to compress the data but the both have access problems.
Message 7 of 14
(5,564 Views)
Hi,

Are there functions in labview to do run lenght encoding and bit packing in labview, or would I have to implement these myself?

Thank you,

Tim
0 Kudos
Message 8 of 14
(5,560 Views)
Really not so hard, just tell LV8 to treat the boolean array as though it were LV4...

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 9 of 14
(5,549 Views)
Hi mikeporter,

Which version of labview are you using? I am using 8.2 and I only see a convert to 7.x in my unflatten to string, and flatten to string functions. I do not see the convert to 4.x on my functions. Also, I looked in this site

http://digital.ni.com/public.nsf/allkb/3B60483A50030258862565BC00733B89

and it says that in labview 4.x booleans are treated as 16-bit numerics which is more memory intensive than in newer versions of labview where a boolean is just a single byte (8 bits).

-Tim
0 Kudos
Message 10 of 14
(5,514 Views)