LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to convert string to 0 and 1

Hi

How can I convert this string "11110000" to this number (16bit or 8 bit) 11110000. Could you please help me with this?

 

Thanks?

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

Scan from String using %b as format specifier should work.

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

well I use %8b and %b but it converts the following string "11110110" to 246! 

0 Kudos
Message 3 of 5
(2,219 Views)

Change your display format on your indicator to binary. Decimal 246 is b11110110.

EDIT: I read too fast and posted the wrong binary representation originally, sorry.

 

 

0 Kudos
Message 4 of 5
(2,214 Views)

Decimal 246 = 11110110 binary.  You just need to change the display format of your indicator to binary.  Representation should probably be U8.

 

Kelly Bersch
Certified LabVIEW Developer
Kudos are always welcome
0 Kudos
Message 5 of 5
(2,212 Views)