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.