LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

convert binary string into binary array

Dear I am looking for a way to convert my ten bit string array into 10 bit array.
 
Any idea?
0 Kudos
Message 1 of 12
(8,213 Views)


@BENIO wrote:
Dear I am looking for a way to convert my ten bit string array into 10 bit array.
 

Hi!
   What do you mean by "ten bit string"? Do you have an array of 10 elements, one bit each element? In that case, the bool array can be the straightforward data type....

  Have a nice day!

graziano
0 Kudos
Message 2 of 12
(8,203 Views)
Yes, but you need to tell us in more details what you have and what you want. 🙂
  1. 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!
  2. 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).

 

 
 
Message 3 of 12
(8,201 Views)
There are a variety of ways to convert strings to arrays.  Check the Conversion function under the Numeric palette, and String/Number Conversion or String/Array/Path Conversion under the String palette.
 
** Or like altenbach said, provide us more details.

Message Edited by Steve.Briggs on 10-31-2007 10:11 AM

0 Kudos
Message 4 of 12
(8,199 Views)


@altenbach wrote:
Yes, but you need to tell us in more details what you have and what you want. 🙂
 


It seems to be a common problem, on these days, on the forum! Smiley Very Happy
Message 5 of 12
(8,188 Views)

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.

 

Download All
0 Kudos
Message 6 of 12
(8,174 Views)

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?

0 Kudos
Message 7 of 12
(8,156 Views)
Indeed there are 11 bits, no parity.it is just a matter to build an array of 11 digits, but I have to find a way to cleanup the string format because there a space between digit.
0 Kudos
Message 8 of 12
(8,146 Views)
You could use "spreadsheet string to array" for each segment, with a space as delimiter and a 1D U8 array as type. 😉
Message 9 of 12
(8,141 Views)

Try this (LabVIEW 8.5):

(There are dozends equally good alternatives, just play around a bit)

Message 10 of 12
(8,131 Views)