Siemens SIMATIC S7-300 Hardware And Installation Manual page 152

Hide thumbs Also See for SIMATIC S7-300:
Table of Contents

Advertisement

Commissioning
Sample program
Below you will see a small sample program for data exchange between DP master
and DP slave. The addresses used in the example are found in the table above.
In the DP slave CPU
L
2
T
MB
6
L
IB
0
T
MB
7
L
MW
6
T
PQW
310
CALL
SFC
14
LADDR:=W#16#D
RET_VAL:=MW 20
RECORD:=P#M30.0 byte 20
L
MB
30
L
MB
7
+
I
T
MW
100
9-34
//Data pre-
processing in
the
DP slave
// Forward data
to the
DP master
L
T
L
L
+
T
L
+
T
CALL
LADDR:= W#16#0
RECORD:= P#M60.0 Byte 20
RET_VAL:=MW 22
//receive data
from DP master
//Reprocess
received data
S7-300 Programmable Controller Hardware and Installation
In the DP master CPU
PIB
222
// processing data
received
MB
50
in the DP master
PIB
223
B#16#3
I
MB
51
10
//Data preparation in
DP master
3
MB
60
SFC
15
//Send data to
DP slave
A5E00105492-02

Advertisement

Table of Contents
loading

Table of Contents