15
3 Modbus protocol description
means that the device responds at the maximum possible speed.
The minimum response time is required by the master in order to switch the interface drivers from trans-
mitting to receiving.
NOTE!
During t
1
and t
2
and during the response time of the slave, no data requests may be generated by the
master. Requests during t
1
and t
2
are ignored by the slave. Requests during the response time invalidate
all the data currently on the bus.
3.4 Structure of a Modbus telegram
Modbus-RTU
All telegrams have the same structure:
Each telegram has four fields:
Modbus-TCP
Modbus-TCP is a standardized procedure in which a Modbus telegram is transmitted encapsulated in a
TCP segment via Ethernet. The Modbus telegram (without CRC) is transmitted with an additional 6 or 7
byte MBAP header (Modbus Application Header). The seventh byte corresponds to the first byte of the
Modbus RTU, but here it is called differently.
For comparison: The "normal" Modbus telegram:
Slave address Function code Data field Checksum
CRC
1 byte 1 byte x bytes 2 bytes
Slave address Device address of a specific slave
Function code Function selection (read/write words)
Data field Contains information (according to the function code)
• Word address
• Number of words
• Word value(s)
Checksum Detection of transmission errors
MBAP header Modbus telegram
2 bytes
Transaction ID
2 bytes
Protocol ID
2 bytes
Length
1 byte
Unit ID
Additional bytes as below,
however, without CRC
Identical in re-
quest and re-
sponse
Must be 0 for
Modbus
Length of re-
quest/re-
sponse in
bytes starting
with (incl.)
"Unit ID"
Corresponds to
device address
and must be TCP
0xFF or 0 (0 =
broadcast)
Slave
Address
1 byte
Function code
1 byte
Data field
x bytes
CRC16
2 bytes