EasyManua.ls Logo

Siemens Simatic S7 Series

Siemens Simatic S7 Series
726 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Libraries
9.3 Modbus library instructions
S7-200 SMART
System Manual, 09/2015, A5E03822230-AC
445
9.3.3.2
MBUS_INIT instruction (initialize slave)
Table 9- 27 MBUS_INIT instruction
LAD/ FBD
STL
Description
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
Inputs/outputs
Data type
Operands
Mode, Addr, Parity, Port
BYTE
VB, IB, QB, MB, SB, SMB, LB, AC, Constant, *VD, *AC, *LD
Baud, HoldStart
DWORD
VD, ID, QD, MD, SD, SMD, LD, AC, Constant, *VD, *AC, *LD
Delay, MaxIQ, MaxAI, MaxHold
WORD
VW, IW, QW, MW, SW, SMW, LW, AC, Constant, *VD, *AC, *LD
Done
BOOL
I, Q, M, S, SM, T, C, V, L
Error
BYTE
VB, IB, QB, MB, SB, SMB, LB, AC, *VD, *AC, *LD
The value for the
Mode
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
Addr
sets the address at inclusive values between 1 and 247.
Parameter
Baud
sets the baud rate at 1200, 2400, 4800, 9600, 19200, 38400, 57600, or
115200.
Parameter
Parity
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
Port
sets the physical communication port (0 = RS-485 integrated in CPU, 1 =
RS-485 or RS-232 located on an optional signal board).
Parameter
Delay
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.

Table of Contents

Other manuals for Siemens Simatic S7 Series

Related product manuals