Hach 911 User Manual page 99

Intrinsically safe flow meters
Table of Contents

Advertisement

D.13 Complications with Floating Point Values
First Register (i.e., 4001)
High Word, High Byte
First Register (i.e., 4001)
Low Word, High Byte
The manufacturer's implementation of the Modbus protocol was based on the idea that we
would enable our flow meters to emulate a Modicon
we follow the exact same format that Modicon uses for the storing and processing floating
point numbers. Additionally, the Modbus protocol does not define how floating point values
are packed (stored) into the internal memory addresses or "Registers" of the flow meter.
When integrating the Modbus-capable flow meters, be aware that these meters store and
process floating point numbers in the exact same format as the Modicon Compact 984
PLC.
All current models of Modicon PLCs, including the Compact 984, pack two bytes of data
into each register. This alone presents no problems. Unsigned two-byte (16-bit) integer
values in the range of 0 to 65535 can be stored and retrieved from these registers without
any problems or complications. The complications arise when the stored value is a floating
point value, which by IEEE definition, require 4 bytes (32 bits). The IEEE standard for
floating point values states in part that the 8 most significant bits represent the exponent
and the remaining 23 bits (plus one assumed bit) represent the mantissa and the sign of
the value.
Since a data "word" consists of two bytes, a floating point value is represented by two data
words. Because a single Modicon register consists of one word (or 2 bytes), two
consecutive Modicon registers are needed to store one floating point value.
The representation of a floating point value can be broken down into a "High Order" and a
"Low Order" word. Additionally, each word can be broken down into a high order byte and
a low order byte.
Table 20
and
Table 21
depict how a IEEE floating point value is usually represented and
how the Modicon stores a floating-point value.
The complications arise because Modicon doesn't store floating point values in this
standard (IEEE) format. Modicon stores floating point values the opposite way with the
"Low-order" word in the first register and the "High-order" word in the second register.
Table 20 IEEE Floating Point Representation
High Word, Low Byte
Table 21 Floating Point Values Representation
Low Word, Low Byte
Since the Modbus protocol doesn't define how floating point values are handled or stored,
some Modbus-capable servers incorrectly use the normal, "High word — Low word"
format for converting the Modbus message response to the client application. Since
Modicon stores the floating point values in the opposite order, the result is that the client
application may receive an incorrect representation of the floating point value from the
Modbus-capable server.
SCADA-Modbus® System Guidelines
®
, Compact 984 PLC. Consequently,
Second Register (i.e., 4002)
Low Word, High Byte
Second Register (i.e., 4002)
High Word, High Byte
Low Word, Low Byte
High Word, Low Byte
97

Advertisement

Table of Contents
loading

This manual is also suitable for:

940

Table of Contents