04-26-2006 08:55 AM
04-26-2006 09:45 AM
Your instrument sends back measures in little-endian format, that is with the most significant byte first. BTW, the number is a 4-byte one: an additional 00 byte must be at the end the string. You can reverse bytes order and simply cast the string into a float, this way ("tmp" is the variable into which you read back from the instrument):
static char tmp[4];
tmp[0] = 0x0;
tmp[1] = 0x0;
tmp[2] = 0x48;
tmp[3] = 0x42;
DebugPrintf ("%f\n", *(float *)tmp);
For a small reference on IEEE754 format, you can look at this page: it's useful to validate conversion algorithms you develop to translate instrument raw data.
04-26-2006 02:49 PM
04-26-2006 03:22 PM
04-27-2006 07:45 AM