PLC, HMI, SCADA, INVERTERS, TUTORIALS, INDUSTRIAL AUTOMATION

13:29
SIEMENS Modbus/TCP with instructions "MB_CLIENT" and "MB_SERVER" S7-1500 CPU and S7-1200 CPU

Modbus/TCP with instructions

net_modbus_tcp_s7-1500_s7-1200_en.pdf (1,0 MB)

ModbusTCP_S71500_V15-1.zip (2,9 MB) - TIA Portal V15.1


Modbus/TCP with instructions "MB_CLIENT" and "MB_SERVER" S7-1500 CPU and S7-1200 CPU 

Modbus/TCP communication between S7-1500 CPUs and S7-1200 CPUs is presented. The instructions "MB_CLIENT" and "MB_SERVER" are called and parameterized in the user program of the S7-1500 CPU and the S7-1200 CPU.

The "MB_CLIENT" instruction communicates as Modbus/TCP client via the PROFINET interface of the CPU. You use the "MB_CLIENT" instruction to establish a connection between the client and the server, send requests and receive responses, and control disconnection of the connection. The "MB_CLIENT" instruction is called in a separate function block "ModbusClient".

The "MB_SERVER" instruction communicates as Modbus/TCP server via the PROFINET interface of the CPU. The "MB_SERVER" instruction processes connection requests of a Modbus/TCP client, receives requests from Modbus functions and sends response messages. The "MB_SERVER" instruction is called in a function block "ModbusServer".

In this example two Modbus functions are demonstrated via two Modbus/TCP connections.
The S7-1500 CPU establishes the first connection as Modbus TCP client. The S7-1200 CPU is Modbus TCP server.
The S7-1200 CPU establishes the second connection as Modbus TCP client. The S7-1500 CPU is Modbus TCP server.

The Modbus/TCP connections are established each via a Modbus block pair (MB_CLIENT and MB_SERVER). The "MB_CLIENT" and "MB_SERVER" instructions are each called in a separate function block ("ModbusClient" and "ModbusServer").

The following document describes:

  • The call and parameterization of the function block "ModbusClient", that internally calls the "MB_CLIENT" instruction, in the user program of the S7-1500 CPU and S7-1200 CPU.
  • The call and parameterization of the function block "ModbusServer", that internally calls the "MB_SERVER" instruction, in the user program of the S7-1500 CPU and S7-1200 CPU.

Download
The download includes the "ModbusTCP_S71500_V15-1.zip" project.
Copy the "ModbusTCP_S71500_V15-1.zip" file into a separate folder and then start the file with a double-click. You then use STEP 7 to open and process the unpacked project data.

Note
The "MB_CLIENT" and "MB_SERVER" instructions are in the "MODBUS TCP" library. For the S7-1200 with firmware version V4.0 you can use the "MB_CLIENT" and "MB_SERVER" instructions from up to and including library version V3.1. For S7-1200 with firmware version V4.1 and higher and for S7-1500 you can use the "MB_CLIENT" and "MB_SERVER" instructions from all library versions.

Категория: SIEMENS | Просмотров: 228 | Добавил: gt7600 | Рейтинг: 0.0/0
Всего комментариев: 0
avatar