LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to chnage number of bits in every packet of a byte array

Hi I have an array of byte array of 1 and 0s. I would like to make sure every pack of 1 or 0s contains 8 number

I can use this example to explain it better. Lets say I have this array

 

111111110000000111111100000000

 

As can be first pack of 0s and the second pack of 1s contain 7 bits. I would like to programaticaaly change it to 8 so the result should be

 

11111111000000001111111100000000 

 

As can be seen now evey pack of 1s or 0s contains 8 element . Could you please help me on this.A sample code would be great

 

Many thanks

 

0 Kudos
Message 1 of 5
(2,511 Views)

x.png

0 Kudos
Message 2 of 5
(2,485 Views)

Reshape array is your friend.Nevermind.  I just realized what you were going for.  Will need to rethink...


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 5
(2,470 Views)

One clarification: Can there be two packets of 1's (or 0's) together, for which you need 16 1's, etc., and if so, how do you identify this condition?

 

Cameron

 

To err is human, but to really foul it up requires a computer.
The optimist believes we are in the best of all possible worlds - the pessimist fears this is true.
Profanity is the one language all programmers know best.
An expert is someone who has made all the possible mistakes.

To learn something about LabVIEW at no extra cost, work the online LabVIEW tutorial(s):

LabVIEW Unit 1 - Getting Started</ a>
Learn to Use LabVIEW with MyDAQ</ a>
0 Kudos
Message 4 of 5
(2,460 Views)

Are they always all 1's and/or all 0's?  Do they alternate as in the example?  Why are there missing data?  Is this something that should be fixed before parsing the string?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 5
(2,442 Views)