01-09-2019 11:43 PM
Hi,
I have hexadecimal data that I am receiving using Bluetooth. I want to convert this hexadecimal 2 byte data into a numerical value so I can plot it in a waveform as the data I am receiving is an analog voltage from a sensor.
The data format is like this: 020F so the numerical (decimal) value I need would be 527. I can them manipulate this and convert it to a useful voltage value.
Help please, I tried converting it to a string first and then using the "Hexadecimal string to number" function but it didn't work.
Cheers,
David
01-11-2019 10:10 AM
dadest100,
How are you displaying the hexadecimal values? I was trying to reproduce what you are seeing and having a hard time. Is it possible for you to post your VI?
-Michael
02-26-2019 11:47 AM - edited 02-26-2019 12:23 PM
It depends if you have a hexadecimally formatted string of 4 bytes containing the characters 0..F excusively or if you have a binary string of two bytes that, if set to hex display mode displays what you describe.
Once you know what you have, you can do one of the following (Seems the byte order is big endian).
(The function at the bottom is "unflatten from string")