Modbus TCP communication
Modbus TCP (Transmission Control Protocol) is a standard network communication protocol
that uses the PROFINET connector on the CPU for TCP/IP communication. No additional
communication hardware module is required.
Modbus TCP uses Open User Communications (OUC) connections as a Modbus
communication path. Multiple client-server connections may exist, in addition to the
connection between STEP 7 and the CPU. Mixed client and server connections are
supported up to the maximum number of connections allowed by the CPU model
(Page 511).
Each MB_SERVER connection must use a unique instance DB and IP port number. Only 1
connection per IP port is supported. Each MB_SERVER (with its unique instance DB and IP
port) must be executed individually for each connection.
A Modbus TCP client (master) must control the client-server connection with the
DISCONNECT parameter. The basic Modbus client actions are shown below.
1. Initiate a connection to a particular server (slave) IP address and IP port number
2. Initiate client transmission of a Modbus messages and receive the server responses
3. When desired, initiate the disconnection of client and server to enable connection with a
Modbus RTU instructions in your program
● MB_COMM_LOAD: One execution of MB_COMM_LOAD is used to set up PtP port
● MB_MASTER: The Modbus master instruction enables the CPU to act as a Modbus RTU
● MB_SLAVE: The Modbus slave instruction enables the CPU to act as a Modbus RTU
Modbus TCP instructions in your program
● MB_CLIENT: Make client-server TCP connection, send command message, receive
● MB_SERVER: Connect to a Modbus TCP client upon request, receive Modbus message,
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
different server.
parameters like baud rate, parity, and flow control. After a CPU port is configured for the
Modbus RTU protocol, it can only be used by either the MB_MASTER or MB_SLAVE
instructions.
master device and communicate with one or more Modbus slave devices.
slave device and communicate with a Modbus master device.
response, and control the disconnection from the server
and send response
Communication processor and Modbus TCP
12.5 Modbus communication
729