This content is not available in your preferred language.

The content is shown in another available language. Your browser may include features that can help translate the text.

# Why Doesn't the Hexadecimal String to Number VI Convert Data Properly?

Updated Nov 12, 2018

• LabVIEW

## Issue Details

I am using the Hexadecimal String to Number VI to convert my Hexadecimal Data and I either get a zero or the wrong answer. Why is my Hex value not being converted properly?

## Solution

The Hexadecimal String to Number VI expects a number without the ‘0x’ prefix, which is present in raw hexadecimal data.
• For example, if you input “5555”, it will return the decimal value 21845, which is the correct decimal representation of the hexadecimal value 0x5555.
• However, if you input “0x5555”, it will return 0. This is because the raw hex value 0x5555 actually corresponds to an ASCII string of “UU” which is not a number, thus it returns a 0.
If you want to resolve this, while keeping raw hexadecimal input, you can Type Cast the value using the Type Cast VI. You will need to type cast it as a 16-bit integer.