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
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.
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.
LD SM0.0
CALL MBUS_SLAVE, M0.2, MB2
Modbus RTU slave execution error codes
Illegal baud rate or parity
Illegal value for Modbus parameter
Holding registers overlap Modbus Slave symbols
7 Receive CRC error
Illegal function request/function not supported
9 Illegal memory address in request
Slave function not enabled
Signal board port 1 missing or not configured