Libraries
9.3 Modbus RTU library
S7-200 SMART
System Manual, V2.3, 07/2017, A5E03822230-AF
493
The Error output (Page 493) contains the result of executing the instruction. This output is
only valid if Done is ON. If Done is OFF, the error parameter is not changed.
Table 9- 12 Example program of S7-200 SMART CPU operating as a Modbus slave
LAD
STL
Initialize the Modbus Slave protocol on
the first scan. Set the slave address to
1, set port 0 to 9600 baud with even
parity, all access to all I, Q and AI val-
ues, allow access to 1000 holding reg-
isters (2000 bytes) starting at VB0.
Network 1
LD SM0.1
CALL MBUS_INIT, 1, 1, 9600,
2, 0, 128, 32, 1000, &VB0,
M0.1, MB1
Execute the Modbus Slave protocol on
every scan.
Network 2
LD SM0.0
CALL MBUS_SLAVE, M0.2, MB2
9.3.3.4
Modbus RTU slave execution error codes
Error code
Description
0
No error
1
Memory range error
2
Illegal baud rate or parity
3
Illegal slave address
4
Illegal value for Modbus parameter
5
Holding registers overlap Modbus Slave symbols
6
Receive parity error
7
Receive CRC error
8
Illegal function request/function not supported
9
Illegal memory address in request
10
Slave function not enabled
11
Invalid port number
12
Signal board port 1 missing or not configured