The Xentara Modbus Driver v1.2
User Manual
|
Modbus natively only supports two data formats: single bits, and 16-bit registers. To allow for other data types, Modbus devices often combine multiple 16-bit registers into a single value.
Data formats are only used for input and holding registers. Coils and discrete inputs are always interpreted as single bits.
Xentara supports the following data formats for input and holding registers:
A single 16-bit register is interpreted as an unsigned 16-bit integer value.
The value 23,456 (5BA0HEX) will be encoded as as follows:
Register 0: 5BA0 |
A single 16-bit register is interpreted as an signed 16-bit integer value.
The value -23,456 (A460HEX) will be encoded as as follows:
Register 0: A460 |
Two 16-bit registers are combined to form an unsigned 32-bit integer value using big endian register order (most significant bits first).
The value 123,456,789 (075B CD15HEX) will be encoded as as follows:
Register 0: 075B | Register 1: CD15 |
Two 16-bit registers are combined to form a signed 32-bit integer using big endian register order (most significant bits first).
The value -123,456,789 (F8A4 32EBHEX) will be encoded as follows:
Register 0: F8A4 | Register 1: 32EB |
Four 16-bit registers are combined to form an unsigned 32-bit integer using big endian register order (most significant bits first).
The value 1,234,567,890,123,456,789 (1122 10F4 7DE9 8115HEX) will be encoded as as follows:
Register 0: 1122 | Register 1: 10F4 | Register 2: 7DE9 | Register 3: 8115 |
Four 16-bit registers are combined to form a signed 32-bit integer using big endian register order (most significant bits first).
The value -1,234,567,890,123,456,789 (EEDD EF0B 8216 7EEBHEX) will be encoded as as follows:
Register 0: EEDD | Register 1: EF0B | Register 2: 8216 | Register 3: 7EEB |
Two 16-bit registers are combined to form an unsigned 32-bit integer value using little endian register order (least significant bits first).
The value 123,456,789 (075B CD15HEX) will be encoded as as follows:
Register 0: CD15 | Register 1: 075B |
Two 16-bit registers are combined to form a signed 32-bit integer using little endian register order (least significant bits first).
The value -123,456,789 (F8A4 32EBHEX) will be encoded as follows:
Register 0: 32EB | Register 1: F8A4 |
Four 16-bit registers are combined to form an unsigned 32-bit integer using little endian register order (least significant bits first).
The value 1,234,567,890,123,456,789 (1122 10F4 7DE9 8115HEX) will be encoded as as follows:
Register 0: 8115 | Register 1: 7DE9 | Register 2: 10F4 | Register 3: 1122 |
Four 16-bit registers are combined to form a signed 32-bit integer using little endian register order (least significant bits first).
The value -1,234,567,890,123,456,789 (EEDD EF0B 8216 7EEBHEX) will be encoded as as follows:
Register 0: 7EEB | Register 1: 8216 | Register 2: EF0B | Register 3: EEDD |
Two 16-bit registers are combined to form a 16-bit IEEE single precision floating point value in big endian register order (most significant bits first).
The value 1234.5 (449A 5000HEX) will be encoded as as follows:
Register 0: 449A | Register 1: 5000 |
Two 16-bit registers are combined to form a 16-bit IEEE single precision floating point value in little endian register order (least significant bits first).
The value 1234.5 (449A 5000HEX) will be encoded as as follows:
Register 0: 5000 | Register 1: 449A |
Two 16-bit registers are combined to form a 16-bit IEEE single precision floating point value in big endian register order (most significant bits first), but with the bytes swapped within each register.
The value 1234.5 (449A 5000HEX) will be encoded as as follows:
Register 0: 9A44 | Register 1: 0050 |
Two 16-bit registers are combined to form a 16-bit IEEE single precision floating point value in little endian register order (least significant bits first), but with the bytes swapped within each register.
The value 1234.5 (449A 5000HEX) will be encoded as as follows:
Register 0: 0050 | Register 1: 9A44 |