Communication processor and Modbus TCP
13.5 Modbus communication
S7-1200 Programmable controller
1188 System Manual, V4.2, 09/2016, A5E02486680-AK
Example: MB_CLIENT 2: Multiple requests with different TCP connections
Modbus TCP client requests can be sent over different connections. To accomplish this,
different instance DBs and connection IDs must be used.
The RemotePort (IP port) number must be different, if the connections are established to the
same Modbus server. If the connections are on different servers, there is no IP port number
restriction.
The example shows two Modbus TCP clients transferring remote data from two different
Modbus TCP servers to the same local CPU memory area, starting at address M1000.0.
Also, a returned error is captured which is optional.
Modbus function 4 - Read input process image words from a Modbus TCP server
CONNECT parameter = "Modbus connections".TCPactive_1: Connection
= 1,
= 192.168.2.241,
= 502
Modbus function 3 - Read holding register words from a Modbus TCP server
CONNECT parameter = "Modbus connections".TCPactive_2: Connection
= 2,
= 192.168.2.242,
= 502