97
SCADA-Modbus® System Guidelines
D.13 Complications with Floating Point Values
The manufacturer’s implementation of the Modbus protocol was based on the idea that we
would enable our flow meters to emulate a Modicon
®
, Compact 984 PLC. Consequently,
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.
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.
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.
Table 20 IEEE Floating Point Representation
First Register (i.e., 4001)
Second Register (i.e., 4002)
High Word, High Byte
High Word, Low Byte
Low Word, High Byte
Low Word, Low Byte
Table 21 Floating Point Values Representation
First Register (i.e., 4001)
Second Register (i.e., 4002)
Low Word, High Byte
Low Word, Low Byte
High Word, High Byte
High Word, Low Byte
Summary of Contents for 911
Page 2: ......
Page 14: ...12 General Information...
Page 16: ...14 Getting Started...
Page 42: ...40 Meter Installation...
Page 44: ...42 Software and Communications...
Page 58: ...56 Sensor Installation...
Page 68: ...66 Maintenance...
Page 72: ...70 Replacement Parts and Accessories...
Page 76: ...74...
Page 88: ...86 Channel Installation Options...
Page 92: ...90 Batteries and Chargers...