LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

string to binary

Hello

 

             I have a string 000F45FF i want to convert into binary , how to do that

 

             result : 11110100010111111111

 

0 Kudos
Message 1 of 8
(3,436 Views)

I would have a look at the 'Hexadecimal Sting to Number' VI or 'Scan from string' VI...  binary display can be set through right clicking on the indicator, Display Format, Binary.

Message Edited by BlueTwo on 01-27-2009 10:16 AM
0 Kudos
Message 2 of 8
(3,431 Views)

That may not work if the string goes beyond a 64-bit integer. To OP: Are the ones and zeros supposed to be the characters "1" and "0", or something else? Any reason you're dropping the zeros at the beginning? Does the string have a maximum length, or any length?

 

Also, does the input string consist of the characters "F", "4", etc., or are you displaying the string in hex mode?

Message Edited by smercurio_fc on 01-27-2009 10:16 AM
0 Kudos
Message 3 of 8
(3,422 Views)

Hello

           0 and 1,s are not character actually in my application i am getting the data from controller if 0 that channel is off and 1 is On. So i have total of 20 channels depends on data i can show which bit is on and off

0 Kudos
Message 4 of 8
(3,414 Views)
You might like to convert the number to a boolean array, then you could have individual indicators showing if the channel was on or off.
0 Kudos
Message 5 of 8
(3,411 Views)
if a convert the string to number and then number to boolean array i am not getting the result. Can u put it is a small ex.
0 Kudos
Message 6 of 8
(3,409 Views)

here an ex , but i don't know if it's the best method

 

wow !!!so much posts , yes you have to take care if you need more than 32bit resolution !

 

 

Message Edité par tinnitus le 01-27-2009 10:46 AM
CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 7 of 8
(3,400 Views)

i forgot FP

 

 

CLAD / Labview 2011, Win Xp
------------------------------------------------------
Mission d'une semaine- à plusieurs mois laissez moi un MP...
RP et Midi-pyrénées .Km+++ si possibilité de télétravail

Kudos always accepted / Les petits clicks jaunes sont toujours appréciés
Don't forget to valid a good answer / pensez à valider une réponse correcte
0 Kudos
Message 8 of 8
(3,386 Views)