Mbus_Ctrl Instruction (Initialize Master) - Siemens Simatic S7 Series System Manual

Hide thumbs Also See for Simatic S7 Series:
Table of Contents

Advertisement

Table 9- 21
Modbus address
00001 – 09999 discrete outputs
10001 – 19999 discrete inputs
30001 – 39999 input registers
40001 – 49999 holding registers
400001 - 465535
9.3.2.2

MBUS_CTRL instruction (initialize master)

Table 9- 22
MBUS_CTRL instruction
LAD / FBD
STL
CALL MBUS_CTRL, Mode, Baud,
Parity, Port, Timeout, Done,
Error
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
Mode
Baud
Parity, Port
Timeout
Done
Error
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.
S7-200 SMART
System Manual, 09/2015, A5E03822230-AC
Required Modbus slave function support
Data type
Operands
BOOL
I, Q, M, S, SM, T, C, V, L
DWORD
VD, ID, QD, MD, SD, SMD, LD, AC, Constant, *VD, *AC, *LD
BYTE
VB, IB, QB, MB, SB, SMB, LB, 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
Read or write
Modbus slave function required
Read
Function 1
Write
Function 5 for a single output point
Function 15 for multiple output points
Read
Function 2
Write
not possible
Read
Function 4
Write
not possible
Read
Function 3
Write
Function 6 for a single register
Function 16 for multiple registers
Description
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.
Libraries
9.3 Modbus library instructions
437

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart series

Table of Contents