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: 

hex to binary

Solved!
Go to solution

I've searched and found examples of exactly what it is I want to do, but for whatever reason, I'm not getting the correct values I want. 

 

All I need to do is take a hex value...1F4EF5, and translate it into simple BCD so that I can take it apart at the bit level.  I'm currently following a few examples that simply take the hex string, convert it to an integer then to binary and I'm getting wrong results for the binary.  Any help would be appreciated.

0 Kudos
Message 1 of 6
(6,579 Views)
Solution
Accepted by In-Use

Are you going for something like this?



There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 6
(6,569 Views)

Hi crossrulz,

 

Mostly yes, except the output I would like to be a string that way I can search it.

 

-Ben

0 Kudos
Message 3 of 6
(6,497 Views)
Solution
Accepted by In-Use

Hi InUse,

 

why do you need a string to "search" it?

 

My approach:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 6
(6,480 Views)

Hi Gerd,

 

String is needed or preferred rather because that is the format from the original vi that I'm modifying.  It's not necessarily required.  That said, I was able to use your example and now have working code...finaly!  Thank you to you two for the help.

 

-Ben

0 Kudos
Message 5 of 6
(6,469 Views)

You need to be very careful with the lenght.

 

For example if the first two digits of your input string are "00", you would get a short result with the given code. Maybe that's OK?

0 Kudos
Message 6 of 6
(6,447 Views)