LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LabVIEW bit manipulation with 7 bit data type

Hi,

 

LabVIEW 2013 SP1.

 

I have a big array of I32.

Each 8 consequence elements (256 bits) are a separate group.

The first 224 bits in every 256 bits are interleaved data of I and Q each with the size of 7 bits. (2*7*16=224)

(16 I's and 16 Q's data in the first 224 bits)

and the other 32 bit are a cluster of some other information.

 

What do you think would be the best way to unbundle the information ? 

 

Of course that I will have to then convert the 7 bit data to some fractional number....

But for now, the question is about the best way to create two 2D boolean arrays.

For every 8 elements of I32 (or 7) there will be two 2D arrays of the size 16 rows and 7 columns  

 

Thanks,

Amitai.

0 Kudos
Message 1 of 11
(4,656 Views)

Perhaps turn the 1's and 0's into a Boolean array.  Then, remove the first 32 bits using Delete From Array.  Now  you have the separate cluster array.  From there, take the remaining array and...using a For Loop and Delete From Array, delete every 7 bits from the array and use build array to stack the array in a 2D format....after changing the boolean back to an I32 of course.  And wahlah.  Least I think that's what you're wanting.  There's probably a better way of doing it.

0 Kudos
Message 2 of 11
(4,643 Views)

Course....the problem you're going to face is that you can't store anything in 256 in LabVIEW.  You'll need to have 4 different 64 bit variables that co-exist with each other and are manipulated as necessary.

0 Kudos
Message 3 of 11
(4,641 Views)

Pictures > words.  And...I changed some of what I said.  And...I'm not sure I got exactly what it was you were asking.

0 Kudos
Message 4 of 11
(4,635 Views)

Here is kind of what I had in mind.

I haven't used much the bit manipulation VI's so I want to know if there a better way.

 

The VI is attached. LabVIEW 2013 SP1.

 

Correction - the 32 bit datatype is probably DWORD which is U32. (and not I32)

0 Kudos
Message 5 of 11
(4,588 Views)

I can't open this VI.  I am running 2011.

0 Kudos
Message 6 of 11
(4,584 Views)

@aSquared wrote:

For every 8 elements of I32 (or 7) there will be two 2D arrays of the size 16 rows and 7 columns 


I believe you actually meant an array of 16 rows and *2* columns. If so, this should do it:

Manipulate 7-bit data.png

Fun problem, by the way! I couldn't open your VI either before I posted this, I'm still on LV2012, so I have no idea if this is exactly what you did.

0 Kudos
Message 7 of 11
(4,564 Views)

OK, now that I'm on a computer with a newer (2013) version of LabVIEW, I took a look at your VI. Are the individual bits of the I & Q values interleaved, or are the values themselves interleaved but their bits are contiguous? I assumed the latter, but your VI seems to do the former. It would be a little weird to interleave one bit from I, one bit from Q, the next bit from I, the next bit from Q, etc. Does your VI produce the results you want?

0 Kudos
Message 8 of 11
(4,524 Views)

I believe the values are interleaved and not the bits because it's a boolean array passing through his for loop.  So he's separating every other.  His VI very similar to what I was doing.  Although, I don't know if that U32 Array is correct way to represent your initial data.  It doesn't really matter much as long as you interpret it correctly.  But the way you have your delete from arrays would scare me.  That's not necessarily a sure bet.  This is all contingent on the fact that you have indexed from the correct spot in your U32 Array.  You may want to rewind a bit and make sure you are acquiring the data in the correct chunks with the correct LSB and MSB.

0 Kudos
Message 9 of 11
(4,478 Views)

Ok, forget what I said above.  I got a look at your code and I re-read your case problem.  I think I have a better understanding.  The delete portions in the middle seem a little iffy to me as well as the for loop.  Also, might as well delete the cluster data at the beginning since you know where it's at.  So here's what I'd suggest.  Very similar to what you've got going on.

Example.JPG

0 Kudos
Message 10 of 11
(4,462 Views)