ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Binary String to numerical binary array

Hello,

How do you convert a "binary string" to a numerical binary array??

0 Kudos
Message 1 of 11
(6,046 Views)

Here is one way to do it.  Somebody will probably come up with a better method.

 

Message Edited by tbob on 05-04-2007 05:22 PM

- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 11
(6,044 Views)

Hi tbob,

In ur method for loop is not necessary.

 

-Kumar B

Message 3 of 11
(6,016 Views)
Of course we would also need to confirm that "binary string" really means 'binary formatted ASCII string, containing only the characters 0 and 1".
 
There are many other possible interpretations for the term "binary string". 😉
 
Triniboy, please give us an example of your input string.
0 Kudos
Message 4 of 11
(6,013 Views)
Also, I am not so sure that "numerical binary array" really means "boolean array". 😉
 
0 Kudos
Message 5 of 11
(6,005 Views)
Ya, I too... ! Smiley Wink
- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 6 of 11
(5,997 Views)

tbob

 

Only a question: What means the constant 49 in the equal input?? Why 49??

0 Kudos
Message 7 of 11
(5,315 Views)

Hi kantabra,

 

"49" is the ASCII code for the character "1"...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 11
(5,313 Views)

ohhhhh jaja, that's true. Now, I understand all.

Thank you very much!!!

0 Kudos
Message 9 of 11
(5,309 Views)

Regardless of points altenbach brought up, i would follow the convention for boolean representations and do a compare against "not-equal 48".

 

hope this helps,

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 10 of 11
(5,305 Views)