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: 

Converting a Hexadecimal String to a Binary String

Hello NG,

I would like to convert an 8 Bit Hexadecimal String (example C0034000)
to it´s equivalent in binary (in this case---> 1100 0000 0000 0011...
and so on), I didn´t find any possible way to do this. I´am not
talking about the simple representation on the front pannel. Some
Postings say that this ist possible with the "Format Value" Function
adding an "%b" to the entring, but in my case it does not function.
Could someone help me, thanks in advance!
0 Kudos
Message 1 of 5
(4,734 Views)
Try this LabView 6.1 example which uses the Format Value function.
0 Kudos
Message 2 of 5
(4,734 Views)
> I would like to convert an 8 Bit Hexadecimal String (example C0034000)
> to it´s equivalent in binary (in this case---> 1100 0000 0000 0011...
> and so on), I didn´t find any possible way to do this. I´am not
> talking about the simple representation on the front pannel. Some
> Postings say that this ist possible with the "Format Value" Function
> adding an "%b" to the entring, but in my case it does not function.

The task here is to convert a string to a different string. The easiest
way to do this is to convert the string to a numer, then format the
number as a binary string.

On the string palette the Scan from String using %x can be used to
change a hex string into a numeric integer. The Format to String with
%b and other nodes can take a numeric i
nteger and return a string of
binary characters. These two nodes wired together with the correct
constants should do what you want.

Greg McKaskle
0 Kudos
Message 3 of 5
(4,734 Views)
Yes it works fine!!
Thanks!
0 Kudos
Message 4 of 5
(4,734 Views)
Yes it works fine!!
Thanks!
0 Kudos
Message 5 of 5
(4,734 Views)