LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Decimal to Hexadecimal Conversion

Solved!
Go to solution

Hello, I've to input a hexadecimal number as input to a VI. This hexadecimal numbers is to be converted from a binary string. So far I've converted the binary string to a decimal number. How do I convert a decimal number to a hexadecimal number? (I've searched the forums and most examples I found instructed about 'DISPLAYING' the hexadecimal number in an indicator. However, I need a hexadecimal number for inputting into a VI.)

 

I'm using the scan value function to convert the binary string to a decimal number. How do I convert it to a hexadecimal number? Also, I'm attaching the VI here. Thanks!

0 Kudos
Message 1 of 4
(3,141 Views)

So you have a number and you want a string that shows the hexadecimal value?  Just use the Number To Hexadecimal String function.  You are already using the similar function to convert into a decimal string.


GCentral
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 4
(3,127 Views)

Thanks for the reply!

I am using the 'scan value' funciton to convert a binary 'string' into a decimal 'numeric'. The words in quotes are data types. If I convert the decimal 'numeric' into a hexadecimal 'string', my VI won't accept the input, as it requires a hexadecimal 'numeric' input. So how do I convert my decimal 'numeric' into a hexadecimal 'numeric'?

0 Kudos
Message 3 of 4
(3,108 Views)
Solution
Accepted by topic author vedsoni1996

There is no difference between a decimal numeric and a hexadecimal numeric.  All numerics are numbers.  You can set the display style to show the value as a binary, octal, decimal, or hexadecimal format.  But the underlying value is always a numeric.

 

If you want the output to be a string, then the messages you have already gotten will help you.  (Number to Decimal String, or Number to Hexadecimal String.)

Message 4 of 4
(3,102 Views)