Program Example - Siemens SIMATIC S7-200 System Manual

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

Advertisement

S7-200 Programmable Controller System Manual
Table 12-11 Modbus Master MBUS_MSG Execution Error Codes, continued
Error Codes
6
7
8
101
102
103
105
106
107
108

Program Example

This example program shows how to use the Modbus Master instructions to write and then read 4
holding registers to and from a Modbus slave each time input I0.0 is turned on.
The S7-200 CPU will write 4 words starting at VW100 to the Modbus slave. The data will be
written to 4 holding registers in the slave starting at address 40001.
The S7-200 CPU will then read 4 holding registers from the Modbus slave. The data will come
from holding registers 40010 -- 40013 and be placed into the V--memory of the S7-200 CPU
starting at VW200.
S7-200 CPU
Memory
VW100
VW102
VW104
VW106
VW200
VW202
VW204
VW206
Figure 12-3
Example Program Data Transfers
360
Description
Modbus is busy with another request: Only one MBUS_MSG instruction can be
active at a time.
Error in response: The response received does not correspond to the request. This
indicates some problem in the slave device or that the wrong slave device answered
the request.
CRC error in response: The transmission was disturbed and possibly incorrect data
was received. This error is usually caused by an electrical problem such as incorrect
wiring or electrical noise affecting the communication.
Slave does not support the requested function at this address: See the required
Modbus slave function support table in the "Using the Modbus master Instructions"
help topic.
Slave does not support the data address: The requested address range of Addr plus
Count is outside the allowed address range of the slave.
Slave does not support the data type: The Addr type is not supported by the slave
device.
Slave accepted the message but the response is delayed:: This is an error for
MBUS_MSG and the user program should resend the request at a later time.
Slave accepted the message but the response is delayed:: This is an error for
MBUS_MSG and the user program should resend the request at a later time. Slave
is busy and rejected the message: You can try the same request again to get a
response.
Slave rejected the message for an unknown reason
Slave memory parity error: There is an error in the slave device.
Modbus Slave
Holding Registers
....
....
40001
40002
40003
40004
....
....
....
....
40010
40011
40012
40013
....
....

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents