Mb_Slave (Communicate Via The Ptp Port As Modubus Slave) Instruction - Siemens S7-1200 System Manual

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

Advertisement

Table 12- 72 MB_MASTER execution condition codes (Modbus protocol errors)
STATUS (W#16#)
8380
8381
8382
8383
8384
8385
8386
8387
8388
In addition to the MB_MASTER errors listed above, errors can be returned from the underlying PtP communication
1
instructions.
12.5.3.3

MB_SLAVE (Communicate via the PtP port as Modubus slave) instruction

Table 12- 73 MB_SLAVE instruction
LAD / FBD
Table 12- 74 Data types for the parameters
Parameter and type
MB_ADDR
IN
MB_HOLD_REG
IN
S7-1200 Programmable controller
System Manual, 03/2014, A5E02486680-AG
Response code from
slave
-
01
03
02
Greater than 03
03
-
-
-
SCL
"MB_SLAVE_DB"(
MB_ADDR:=_uint_in_,
NDR=>_bool_out_,
DR=>_bool_out_,
ERROR=>_bool_out_,
STATUS=>_word_out_,
MB_HOLD_REG:=_variant_inout_);
Data type
V1.0: USInt
V2.0: UInt
Variant
Communication processor and Modbus TCP
Modbus protocol errors
CRC error
Function code not supported
Data length error
Data address error or address outside the valid range of the
DATA_PTR area
Data value error
Data diagnostic code value not supported (function code 08)
Function code in the response does not match the code in the request.
Wrong slave responded
The slave response to a write request is incorrect. The write request
returned by the slave does not match what the master actually sent.
Description
The station address of the Modbus slave:
Standard addressing range (1 to 247)
Extended addressing range (0 to 65535)
Pointer to the Modbus Holding Register DB: The Modbus holding
register can be M memory or a data block.
12.5 Modbus communication
1
Description
The MB_SLAVE instruction allows your
program to communicate as a Modbus slave
through a PtP port on the CM (RS485 or
RS232) and CB (RS485). When a remote
Modbus RTU master issues a request, your
user program responds to the request by
MB_SLAVE execution. STEP 7 automatically
creates an instance DB when you insert the
instruction. Use this MB_SLAVE_DB name
when you specify the MB_DB parameter for
the MB_COMM_LOAD instruction.
755

Advertisement

Table of Contents
loading

Table of Contents