Libraries
9.3 Modbus library instructions
S7-200 SMART
System Manual, 09/2015, A5E03822230-AC
445
MBUS_INIT instruction (initialize slave)
Table 9- 27 MBUS_INIT instruction
CALL MBUS_INIT, Mode, Addr, Baud,
Parity, Port, Delay, MaxIQ, MaxAI,
MaxHold, HoldStart, Done, Error
The MBUS_INIT instruction enables, initializes,
or disables Modbus communications. Before an
MBUS_SLAVE instruction can be used,
MBUS_INIT must be executed without errors.
The instruction completes and the Done bit is
set immediately, before continuing to the next
instruction.
The instruction is executed on each scan when
the EN input is ON.
The MBUS_INIT instruction should be executed exactly once for each change in
communications state. Therefore, the EN input should be pulsed on through an edge
detection element, or executed only on the first scan.
Table 9- 28 MBUS_INIT parameters
VB, IB, QB, MB, SB, SMB, LB, AC, Constant, *VD, *AC, *LD
VD, ID, QD, MD, SD, SMD, LD, AC, Constant, *VD, *AC, *LD
Delay, MaxIQ, MaxAI, MaxHold
VW, IW, QW, MW, SW, SMW, LW, AC, Constant, *VD, *AC, *LD
I, Q, M, S, SM, T, C, V, L
VB, IB, QB, MB, SB, SMB, LB, AC, *VD, *AC, *LD
The value for the
input selects the communications protocol: an input value of 1
assigns Modbus protocol and enables the protocol, and an input value of 0 PPI protocol and
disables Modbus protocol.
Parameter
sets the address at inclusive values between 1 and 247.
Parameter
sets the baud rate at 1200, 2400, 4800, 9600, 19200, 38400, 57600, or
115200.
Parameter
is set to match the parity of the Modbus master. All settings use one stop
bit. The accepted values are: 0 (no parity), 1 (odd parity), and 2 (even parity).
Parameter
sets the physical communication port (0 = RS-485 integrated in CPU, 1 =
RS-485 or RS-232 located on an optional signal board).
Parameter
extends the standard Modbus end-of-message timeout condition by adding
the assigned number of milliseconds to the standard Modbus message timeout. The typical
value for this parameter should be 0 when operating on a wired network. If you are using
modems with error correction, set the delay to a value of 50 to 100 milliseconds. If you are
using spread spectrum radios, set the delay to a value of 10 to 100 milliseconds. The Delay
value can be 0 to 32767 milliseconds.