LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

If I have 160 bits in an array. How can I parse this out to different arrays of like 32 bits, 64 bits, 16 bits and so on. Until all bits in the original array are used up?

How can I parse out an array of 160 bits into
different arrays of varying bits. Like into an array
of 32 bits, 64 bits and so on? Until I'm done with
the 160 bits.
0 Kudos
Message 1 of 4
(2,733 Views)
Hello,

You can use the "Array Subset" VI which you find in the "Array" subpalette. This VI returns a portion of an array starting at a specific index and containing a certain number of elements. Use this VI several times if you've to split your original Array into several portions. The "Split 1D array" VI could be helpful too.

Hope this helps.

Regards,
Luca
Regards,
Luca
0 Kudos
Message 2 of 4
(2,733 Views)
If you are talking about arrays of boolean values, please bear in mind that a boolean in LV occupies 8 bits. I remember reading that this was changed over previous versions (LV 4 to LV5?) for compatibility and simplification reasons.

If you need to generate a 32-bit number from 32 booleans, there is a function to convert a boolean array to a scalar. Simply "sticking" 32 booleans together and then assuming you have the equivalent of a 32 bit number is incorrect.

Hope this helps

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
0 Kudos
Message 3 of 4
(2,733 Views)