4 Modbus
TCP
Festo – GDCP-CMMO-ST-LK-C-HP-EN – 2017-05b – English
19
4
Modbus TCP
Modbus is an open communication protocol based on the master-slave architecture. It is an estab
lished standard for communication via Ethernet-TCP/IP in automation technology.
The basic function of Modbus TCP is described in IEC 61158.
The standard port for Modbus TCP is 502.
The Ethernet control interface is used parallel to the Ethernet parameterisation interface (FCT, web
server). A maximum of
one
Modbus TCP connection at a time is possible.
After the TCP connection has been made, it is normally kept open and only disconnected by the motor
controller in case of error, with a timeout set or through the counterpart station.
Communication with the FCT and the web server remains possible.
Data Encoding
Modbus TCP uses “Big Endian” transmission sequence. The “most significant byte” is sent first. The
actual data (Modbus: “tab”) are processed word-by-word (2 bytes). It may therefore be necessary to
“turn” these 2 bytes on the controller. This applies to the operations (function codes): 0x03, 0x10,
0x17
è
This already takes place through the module if provided by Festo.
Modbus telegram
In general, a Modbus telegram is constructed correspondingly
è
Tab. 4.1 (the higher-value byte is
always sent first).
If, for example, the CMMO is to be accessed by the computer via Modbus, the transaction identifier,
protocol identifier, message length and unit identifier must additionally be sent at the beginning before
the function code is sent.
The assignment can be visualised and tested with the help of the “Modbus TCP Client”.
è
www.festo.com/sp, search for “Modbus TCP Client”
Byte no.
Number
of bytes
Function
Comment
1
2
Transaction number
Freely selectable. Returned
again in the answer.
High-order byte
2
Low-order byte
3
2
Protocol identifier
Always 0
High-order byte
4
Low-order byte
5
2
Number of bytes still to
follow
= n + 2, whereby n is the num
ber of data points from byte 9.
High-order byte
6
Low-order byte
7
1
Address (unit identifier,
slave ID)
Can be ignored (e.g. set to 0). –
8
1
Function code
è
–
9 ...
n
Data
è
–
Tab. 4.1
Structure of Modbus telegram
Summary of Contents for CMMO-ST-C5-1-LKP
Page 182: ......