MB_SERVER (Communicate using PROFINET as Modbus TCP server) instruction
Table 13- 62 MB_SERVER instruction
LAD / FBD
Table 13- 63 Data types for the parameters
Parameter and type
DISCONNECT
IN
CONNECT
IN
MB_HOLD_REG
IN_OUT
NDR
OUT
DR
OUT
ERROR
OUT
STATUS
OUT
Note
CPU firmware version requirement
The Modbus TCP instructions described in this section of the manual require firmware
release V4.1 or later.
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
SCL
"MB_SERVER_DB"(
DISCONNECT:=_bool_in_,
CONNECT:=_variant_in_,
NDR=>_bool_out_,
DR=>_bool_out_,
ERROR=>_bool_out_,
STATUS=>_word_out_,
MB_HOLD_REG:=_variant_inout_);
Data type
Description
Bool
MB_SERVER attempts to make a "passive" connection with a partner device.
This means that the server is passively listening for a TCP connection request
from any requesting IP address.
If DISCONNECT = 0 and a connection does not exist, then a passive connec-
tion can be initiated.
If DISCONNECT = 1 and a connection exists, then a disconnect operation is
initiated. This parameter allows your program to control when a connection is
accepted. Whenever this input is enabled, no other operation will be attempt-
ed.
Variant
Reference to a Data block structure that contains connection parameters in
the system data type "TCON_IP_v4".
Variant
Pointer to the MB_SERVER Modbus holding register: The holding register
must either be a non-optimized global DB or an M memory address. This
memory area is used to hold the data a Modbus client is allowed to access
using Modbus register functions 3 (read), 6 (write), and 16 (write).
Bool
New Data Ready: 0 = No new data, 1 = Indicates that new data has been
written by a Modbus client
Bool
Data Read: 0 = No data read, 1 = Indicates that data has been read by a
Modbus client.
Bool
The ERROR bit is TRUE for one scan, after MB_SERVER execution ended
with an error. The error code at the STATUS parameter is valid only during
the single cycle where ERROR = TRUE.
Word
Execution condition code
Communication processor and Modbus TCP
13.5 Modbus communication
Description
MB_SERVER communicates as a Modbus
TCP server through the PROFINET port on
the S7-1200 CPU. No additional communi-
cation hardware module is required.
MB_SERVER can accept a request to con-
nect with Modbus TCP client, receive a
Modbus function request, and send a re-
sponse message.
1179