11-28-2019 01:09 PM
Hi forums,
I'm trying to convert the binary output from an IMU sensor to a float. The sensor I'm using is a VectorNav VN100 (PDF user manual can be found here). The example given in the user manual (pg 41) is shown in the image below.
In the example the binary output stream from the sensor displayed in hex 0x422E5093 converts to a float value of +43.578686.... how??? When I convert using "Scan Value" I get a float value of 1110331539 - Google confirms this.
I must be missing something here? Is there an intermediate step in converting from Hex to Binary, and then on to decimal? Would this not give me the same value? Or is the manual wrong?
The VI attached shows my current workings and illustrates the problem I'm having.
Any help greatly appreciated,
~AVD
Solved! Go to Solution.
11-28-2019 02:25 PM - edited 11-28-2019 02:41 PM
0x422E5093 in decimal base is 1110331539
You have to scan as u32 and then type cast to float.
Alternatively, use unflatten from string. You can set the endianness to little-endian so you don't have to reverse the string.
11-28-2019 03:41 PM
Problem solved - thank you cordm!