Modbus Instructions - Siemens SIMATIC S7-1200 Manual

Easy book
Hide thumbs Also See for SIMATIC S7-1200:
Table of Contents

Advertisement

Easy to communicate between devices
7.10 PtP, USS, and Modbus communication protocols
7.10.4

Modbus instructions

The CPU supports Modbus communication over different networks:
● Modbus RTU (Remote Terminal Unit) is a standard network communication protocol that
● Modbus TCP (Transmission Control Protocol) is a standard network communication
Note
Modbus TCP will only operate correctly with CPU firmware release V1.02 or later. An
attempt to execute the Modbus instructions on an earlier firmware version will result in an
error.
Table 7- 15
Modbus instructions
Type of communication
Modbus RTU (RS232 or RS485)
Modbus TCP (PROFINET)
The Modbus instructions do not use communication interrupt events to control the
communication process. Your program must poll the MB_MASTER / MB_SLAVE or
MB_Client / MB_Server instructions for transmit and receive complete conditions.
160
uses the RS232 or RS485 electrical connection for serial data transfer between Modbus
network devices. You can add PtP (Point to Point) network ports to a CPU with a RS232
or RS485 CM or a RS485 CB.
Modbus RTU uses a master/slave network where all communications are initiated by a
single Master device and slaves can only respond to a master's request. The master
sends a request to one slave address and only that slave address responds to the
command.
protocol that uses the PROFINET connector on the CPU for TCP/IP communication. No
additional communication hardware module is required.
Modbus TCP uses client-server 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. 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.
Instruction
MB_COMM_LOAD: One execution of MB_COMM_LOAD is used to set up PtP port
parameters like baud rate, parity, and flow control. After the CPU port is configured
for the Modbus RTU protocol, it can only be used by either the MB_MASTER or
MB_SLAVE instructions.
MB_MASTER: The Modbus master instruction enables the CPU to act as a Modbus
RTU master device and communicate with one or more Modbus slave devices.
MB_SLAVE: The Modbus slave instruction enables the CPU to act as a Modbus RTU
slave device and communicate with a Modbus master device.
MB_CLIENT: Make client-server TCP connection, send command message, receive
response, and control the disconnection from the server.
MB_SERVER: Connect to a Modbus TCP client upon request, receive Modbus
message, and send response.
Easy Book
Manual, 11/2011, A5E02486774-04

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents