×
Siemens Industry Online Support
Siemens AG
Тип сообщения: Часто задаваемые вопросы, ID сообщения: 102020340, Дата сообщения: 05.07.2017
(5)
Оценить

How do you program and parameterize Modbus/TCP communication between S7-1500 CPUs and S7-1200 CPUs?

  • Сообщение
  • Относится к продукту(ам)
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").



Fig. 1

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.

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

Download
The download includes the "ModbusTCP_S71500_V14.zip" project.
Copy the "ModbusTCP_S71500_V14.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.

Archive
The archive includes a sample program and the documentation for STEP 7 V13.


Further Information
Detailed information about the "MB_CLIENT" and "MB_SERVER" instructions is available in the manual in Entry ID 109742272.

Creation Environment

The screens and downloads in this FAQ response were created with STEP 7 Professional V14 and "MODBUS TCP" library V4.1.
Указания по безопасности
Для того чтобы обеспечить кибербезопасность установок, систем, машин и сетей, необходимо внедрить и постоянно поддерживать в работоспособнобном состоянии комплексную концепцию по обеспечению секретности на промышленных объектах, которая соответствует современному техническому уровню. Продукция и решения Сименс являются лишь частью такой концепции. Более подробно о мерах обеспечения секретности на промышленных объектах можно узнать на
http://www.siemens.com/industrialsecurity.
Поддержка статистики
Данная функция позволяет выдавать идентификаторы (ID) результата поиска согласно желаемому количеству (формат .txt)

Генерировать список
Копировать URL
Отобразить эту страницу в новом дизайне
Панель управления mySupport
Ссылки по теме
    Тематические страницы для данных записей