beautypg.com

Communications protocols – Dynasonics TFX Ultra Transit Time Flow Meters User Manual

Page 72

background image

COMMUNICATIONS PROTOCOLS

MODBUS

Available Data Formats

Bits

Bytes

Modbus Registers

Long Integer

32

4

2

Single Precision IEEE754

32

4

2

Double Precision IEEE754

64

8

4

Table 13: Available data formats

Modbus Register / Word Ordering

Each Modbus Holding Register represents a 16-bit integer value (2 bytes). The official Modbus standard defines Modbus as a

‘big-endian’ protocol where the most significant byte of a 16-bit value is sent before the least significant byte. For example,

the 16-bit hex value of ‘1234’ is transferred as ‘12’ ‘34’.
Beyond 16-bit values, the protocol itself does not specify how 32-bit (or larger) numbers that span over multiple registers

should be handled. It is very common to transfer 32-bit values as pairs of two consecutive 16-bit registers in little-endian word

order. For example, the 32-bit hex value of ‘12345678’ is transferred as ‘56’ ‘78’ ‘12’ ‘34’. Notice the Register Bytes are still sent in

big-endian order per the Modbus protocol, but the Registers are sent in little-endian order.
Other manufacturers, store and transfer the Modbus Registers in big-endian word order. For example, the 32-bit hex value of

‘12345678’ is transferred as ‘12’ ‘34’ ‘56’ ‘78’. It doesn’t matter which order the words are sent, as long as the receiving device

knows which way to expect it. Since it’s a common problem between devices regarding word order, many Modbus master

devices have a configuration setting for interpreting data (over multiple registers) as ‘little-endian’ or ‘big-endian’ word order.

This is also referred to as swapped or word swapped values and allows the master device to work with slave devices from

different manufacturers.
If, however, the endianness is not a configurable option within the Modbus master device, it’s important to make sure it

matches the slave endianess for proper data interpretation. The flow meter actually provides two Modbus Register maps to

accommodate both formats. This is useful in applications where the Modbus Master cannot be configured for endianness.

Communication Settings

Baud Rate

9600

Parity

None

Data Bits

8

Stop Bits

1

Handshaking

None

COMMUNICATIONS PROTOCOLS

Page 72

March 2014