Libraries
9.3 Modbus RTU library
S7-200 SMART
System Manual, V2.3, 07/2017, A5E03822230-AF
491
9.3.3.2
MBUS_INIT instruction (initialize slave)
Table 9- 8
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 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
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.
Содержание SIMATIC S7-200
Страница 30: ...Product overview 1 7 Programming software S7 200 SMART 30 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 267: ...Program instructions 7 6 Counters S7 200 SMART System Manual V2 3 07 2017 A5E03822230 AF 267 HSC modes 3 and 4 ...
Страница 394: ...Program instructions 7 18 Subroutine S7 200 SMART 394 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 425: ...Communication 8 5 PROFIBUS S7 200 SMART System Manual V2 3 07 2017 A5E03822230 AF 425 ...
Страница 786: ...Technical specifications A 11 S7 200 SMART cables S7 200 SMART 786 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 798: ...Error codes C 4 PLC fatal error codes S7 200 SMART 798 System Manual V2 3 07 2017 A5E03822230 AF ...
Страница 848: ...Ordering information F 6 Human Machine Interface devices S7 200 SMART 848 System Manual V2 3 07 2017 A5E03822230 AF ...