convert binary string into binary array

convert binary string into binary array

Post by altenbac » Thu, 01 Nov 2007 23:10:07


Yes, but you need to tell us in more details what you have and what you want. :)

- There is no "10bit string", they come in integer multiples of 8 bits. Some possible interpretations:


- Maybe you have a 2 character string (16bits). Do you want the 10 low order bits?

- Maybe you have a 10 character formatted string of zeroes and ones, one character for each bit.

- Do you have a long string and every 10 consecutive bits are one 10bit number that you want as integer?

- Please clarify!

- There is no "10bit array". Do you want:


- a boolean array with 10 elements, one element per bit?

- An integer array if ones and zeroes?

- An array of U16, each element corresponding to 10bits of the original string?

- something else?

It might help if you could attach a small example containing typical data. (make current values default before saving and attaching here).
 
 
 
 
 
 

convert binary string into binary array

Post by BENI » Fri, 02 Nov 2007 00:40:07

Well I am reading a wgl file (see attached), then converting in into a string array(see picture ).
When I am trying to convert the string array into a bit array I have somme problem because between digit I have space so I need to remove them before conversion.
 


read_ wgl.vi:
http://www.yqcomputer.com/


6534.txt:
http://www.yqcomputer.com/


read wgl.gif:
http://www.yqcomputer.com/

 
 
 

convert binary string into binary array

Post by altenbac » Fri, 02 Nov 2007 00:40:09

I see 11 ones and zeroes. Do you actually have 11 bits or Is one a parity bit.
You are doing this way too convoluted. Are the fields fixed width or can they vary in width?
 
 
 

convert binary string into binary array

Post by altenbac » Fri, 02 Nov 2007 01:40:08

Try this (LabVIEW 8.5):
(There are dozends equally good alternatives, just play around a bit)


read_ wglMOD2.vi:
http://www.yqcomputer.com/