Modbus RTU Data Tables and Formats
Modbus Message Examples
Follow the links in this table to see examples of Modbus requests and responses.
| Table Name | Data size | Read Function codes |
Write Single Function codes |
Write Multiple Function codes |
|---|---|---|---|---|
| Discrete Inputs | 1 bit | FC02 | read only | read only |
| Coils | 1 bit | FC01 | FC05 | FC15 |
| Input Registers | 16 bit | FC04 | read only | read only |
| Holding Registers | 16 bit | FC03 | FC06 | FC16 |
Coils and Registers
In Modbus protocol, data is organized into coils and registers,
each accessed using specific function codes as shown above.
Coils represent single-bit values (ON/OFF), zero or one.
Registers store 16-bit values.
When reading or writing coils, up to 8 coils can be included in one data byte in the message.
When a message is reading or writing any amount of coils not a multiple of 8,
unused bits are padded with zeroes.
Data Types
In the example above for Function code 03,
the master requested 3 registers, 40108 through 40110.
The slave's response shows 40108 contains
AE41 in hexadecimal
which is equal to these 16 bits
1010 1110 0100 0001 in binary.
Great! But what does it mean?
Well, it depends on the data type assigned to the register.
| Data Type | Possible values | Value |
|---|---|---|
| 16-bit unsigned integer | whole number 0 to 65535 | AE41 = 44,609 |
| 16-bit signed integer | whole number -32768 to 32767 | AE41 = -20,927 |
| two character ASCII string | any 2 ASCII characters | AE41 = ® A |
| discrete on/off value | 0 or 1 | can only be 0000 or 0001 |
Register 40108 can also be combined with 40109 to form any of these 32-bit data types:
| Data Type | Possible values | Value |
|---|---|---|
| 32-bit unsigned integer | whole number 0 to 4,294,967,295 |
AE41 5652 = 2,923,517,522 |
| 32-bit signed integer | whole number -2,147,483,648 to 2,147,483,647 |
AE41 5652 = -1,371,449,774 |
| 32-bit IEEE Single precision Floating point number |
any real number | AE41 5652 = -4.395978 E-11 |
| four character ASCII string | any 4 ASCII characters | AE41 5652 = ® A V R |
| discrete on/off value | 0 or 1 | can only be
0000 0000 or 0000 0001 |
More registers can be combined to form longer ASCII strings. Each 16 bit register being used to store two ASCII characters (two bytes). This can be useful for storing model numbers or serial numbers
Floating Point
The IEEE 754 Floating Point Standard is a mathematical formula that allows a real number (a number with decimal points) to be represented by 32 bits with an accuracy of about seven digits. A 32-bit Single precision floating point number allows for a wide range of values, from very large to very small. For even higher resolution, a 64-bit Double precision floating point number is possible using four 16 bit registers.Here is a spreadsheet for for inputs of 4 bytes or 2 words. Download IEEE float calculator
Byte and Word order
The Modbus specification doesn't define exactly how the data is stored in the registers. Therefore, some manufacturers implemented modbus in their devices to store and transmit the more significant byte (high byte) first followed by the less significant low byte. ( AE before 41). Alternatively, others store and transmit the low byte first ( 41 before AE).
Similarly, when registers are combined to represent 32-bit data types,
Some devices store the more significant 16 bits (high word) in the first register
and the remaining less significant low word in the second register(
AE41
before 5652)
while others do the opposite (
5652
before AE41).9:38 PM 2026-04-09
| Byte order | Word order | also known as | Value |
|---|---|---|---|
| High byte first | High word first | "big endian" | AE41 5652 = 2,923,517,522 |
| High byte first | Low word first | 5652 AE41 = 1,448,259,137 | |
| Low byte first | High word first | 41AE 5256 = 1,101,943,382 | |
| Low byte first | Low word first | "little endian" | 5256 41AE = 1,381,384,622 |
It doesn't matter which order the bytes or words are sent in, as long as the receiving device knows which way to expect it. You can see the error is signicant if it's not correct.
What is a Modbus Map?
A modbus map is simply a document or list for a specific Modbus slave device
that defines how its data is organized, incuding:
- what the data is (eg. pressure or temperature readings)
- where the data is stored (which coils and register tables and the data addresses)
- how the data is stored (data types, byte and word ordering)
Some devices are built with a fixed map that is defined by the manufacturer. While other devices allow the operator to configure or program a custom map to fit their needs.
What else?
If you read this page, We would love to hear your comments. Please send an email to info@simplymodbus.ca and let us know what you found helpful and what topics we could add, expand or clarify.