Example – Fluke 2625A User Manual

Page 184

Advertising
background image

2620A/2625A

Users Manual

E-4

The floating point format used is 32-bit with a 1-bit sign, 8-bit exponent, and 24-bit
mantissa with the most significant bit hidden under the LSB of the exponent. The
number is formatted as shown in Table F-1.

Table E-1. Floating Point Format

sign 1 bit

exponent 8 bits

mantissa 23 bits (plus one hidden bit)

high byte (MMSB)

hi-mid byte (MLSB)

low mid byte (LMSB)

low byte (LLSB)

For all other measurement queries, Hydra Series II returns the string "+9E+9" for open
thermocouple (OTC) measurement values. However, for the LOG_BIN?query, NaN (not
a number) is returned instead. The IEEE floating point standard defines NaN as a
positive, maximum exponent number with non-zero mantissa bits. Hydra Series II sets
just the most significant mantissa bit, so the raw binary byte stream value is 7f c0 00 00
(hex).

For all other measurement queries, Hydra Series II usually returns ±1e9 for overload
(OL) measurement values. However, for the LOG_BIN? query, Hydra Series II returns
Inf (infinity) instead. The IEEE floating point standard defines Inf as a positive or
negative maximum exponent number with a zero mantissa. Hydra Series II returns +Inf
as the byte stream 7f 80 00 00 (hex) and -Inf as ff 80 00 00 (hex).

The C code in Figure F-2 converts raw data into a useful format for the Intel x86 (IBM
PC) architecture. The BCD time stamp is converted to integers, and floating point
numbers created for the totalizer and measurement values.

Example

Figure F-3 is a short example that uses the routines in Figures F-1 and F-2 to decode a
fixed (pre-computed) LOG_BIN? response string.

When compiled and run on an Intel architecture computer, the program should print
"Conversion worked".

Although this example is useful for educational purposes, it is not very efficient. If
desired, the decoding and conversion processes can be combined into a single, fast
algorithm.

Advertising
This manual is related to the following products: