Mbus_Init Instruction (Initialize Slave) - Siemens SIMATIC S7 System Manual

Hide thumbs Also See for SIMATIC S7:
Table of Contents

Advertisement

9.3.3.2

MBUS_INIT instruction (initialize slave)

Table 9- 8
MBUS_INIT instruction
LAD/ FBD
STL
CALL MBUS_INIT, Mode, Addr, Baud,
Parity, Port, Delay, MaxIQ, MaxAI,
MaxHold, HoldStart, Done, Error
The program must execute MBUS_INIT instruction exactly once for each change in
communications state. Therefore, pulse the EN input through an edge detection element, or
execute MBUS_INIT only on the first scan.
Table 9- 9
MBUS_INIT parameters
Inputs/outputs
Mode, Addr, Parity, Port
Baud, HoldStart
Delay, MaxIQ, MaxAI, MaxHold
Done
Error
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.
S7-200 SMART
System Manual, V2.3, 07/2017, A5E03822230-AF
Data type
Operands
BYTE
VB, IB, QB, MB, SB, SMB, LB, AC, Constant, *VD, *AC, *LD
DWORD
VD, ID, QD, MD, SD, SMD, LD, AC, Constant, *VD, *AC, *LD
WORD
VW, IW, QW, MW, SW, SMW, LW, AC, Constant, *VD, *AC, *LD
BOOL
I, Q, M, S, SM, T, C, V, L
BYTE
VB, IB, QB, MB, SB, SMB, LB, AC, *VD, *AC, *LD
9.3 Modbus RTU library
Description
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.
Libraries
491

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart

Table of Contents