Siemens SIMATIC S7-200 System Manual page 371

Programmable controller
Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

Table 12-8
Modbus Slave Protocol Execution Error Codes
Error Codes
0
1
2
3
4
MBUS_MSG Instruction
The MBUS_MSG instruction (or MBUS_MSG_P1 for port 1)
is used to initiate a request to a Modbus slave and process
the response.
The MBUS_MSG instruction initiates a request to a Modbus
slave when both the EN input and the First inputs are on.
Sending the request, waiting for the response, and
processing the response usually requires several scans.
The EN input must be on to enable the sending of the
request, and should remain on until the Done bit is set.
Note: Only one MBUS_MSG instruction can be active at a
time. If there is more than one MBUS_MSG instruction
enabled, the first MBUS_MSG instruction executed will be
processed and all subsequent MBUS_MSG instructions will
abort with an error code 6.
The parameter First should be on for only one scan when
there is a new request to send. The First input should be
pulsed on through an edge detection element (i.e. Positive
Edge) which will cause the request to be transmitted one
time. See the example program.
The parameter Slave is the address of the Modbus slave
device. The allowed range is 0 through 247. Address 0 is
the broadcast address and can only be used for write
requests. There is no response to a broadcast request to
address 0. Not all slave devices will support the broadcast
address. The S7-200 Modbus Slave Library does not
support the broadcast address.
The parameter RW specifies if this message is to be a read or a write. The following two values
are allowed for RW.
0 -- Read
-
1 -- Write
-
Discrete outputs (coils) and holding registers support both read and write requests. Discrete
inputs (contacts) and input registers only support read requests. The parameter Addr is the
starting Modbus address. The following ranges of values are allowed:
00001 to 09999 for discrete outputs (coils)
-
10001 to 19999 for discrete inputs (contacts)
-
30001 to 39999 for input registers
-
40001 to 49999 for holding registers
-
The specific range of values for Addr are based on the addresses that the Modbus slave device
supports.
Description
No Error
Parity selection is not valid
Baud rate selection is not valid
Timeout selection is not valid
Mode selection is not valid
Using the Modbus Protocol Library
Chapter 12
357

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents