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
437
Table 9- 21 Required Modbus slave function support
Modbus address
Read or write
Modbus slave function required
00001 09999 discrete outputs
Read
Function 1
Write Function 5 for a single output point
Function 15 for multiple output points
10001 19999 discrete inputs
Read
Function 2
Write
not possible
30001 39999 input registers
Read
Function 4
Write
not possible
40001 49999 holding registers
400001 - 465535
Read
Function 3
Write Function 6 for a single register
Function 16 for multiple registers
9.3.2.2
MBUS_CTRL instruction (initialize master)
Table 9- 22 MBUS_CTRL instruction
LAD / FBD
STL
Description
CALL MBUS_CTRL, Mode, Baud,
Parity, Port, Timeout, Done,
Error
The MBUS_CTRL instruction is used to initialize, monitor,
or to disable Modbus communications.
Before the MBUS_MSG instruction can be used, the
MBUS_CTRL instruction must be executed without er-
rors. The instruction completes and the Done bit is set
ON, before continuing to the next instruction.
This instruction is executed on each scan when the EN
input is on.
The MBUS_CTRL instruction must be called every scan (including the first scan) to allow it to
monitor the progress of any outstanding messages initiated with the MBUS_MSG instruction.
The Modbus master protocol will not operate correctly unless MBUS_CTRL is called every
scan.
Table 9- 23 Parameters for the MBUS_CTRL instruction
Parameter
Data type
Operands
Mode
BOOL
I, Q, M, S, SM, T, C, V, L
Baud
DWORD
VD, ID, QD, MD, SD, SMD, LD, AC, Constant, *VD, *AC, *LD
Parity, Port
BYTE
VB, IB, QB, MB, SB, SMB, LB, AC, Constant, *VD, *AC, *LD
Timeout
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 the CPU port to Modbus protocol and enables the protocol. An input value of 0
assigns the CPU port to PPI system protocol and disables Modbus protocol.

Table of Contents

Other manuals for Siemens Simatic S7 Series

Related product manuals