Siemens Simatic S7-200 System Manual page 182

Programmable controller
Hide thumbs Also See for Simatic S7-200:
Table of Contents

Advertisement

Network Communications and the S7-200 CPU
Sample Program for DP Communication to a CPU 215 Slave
Table 9-14 provides a listing for a sample program in statement list for a CPU 215 that uses
the DP port information in SM memory. Figure 9-12 shows the same program in ladder logic.
This program determines the location of the DP buffers from SMW112 and the sizes of the
buffers from SMB114 and SMB115. This information is used in the program to copy the data
in the DP output buffer to the process-image output register of the CPU 215. Similarly, the
data in the process-image input register of the CPU 215 are copied into the DP input buffer.
Table 9-14 Sample Statement List Program for DP Communication to a CPU 215 Slave
Program Listing
//The DP configuration data in the SM memory area indicate how the
//master has configured the DP slave. The program uses the following data:
//
SMB110
//
SMB111
//
SMB112
//
SMB114
//
SMB115
//
VD1000
//
VD1004
NETWORK
LD
SM0.0
MOVD
&VB0, VD1000
MOVW
SMW112, VW1002
MOVD
&VB0, VD1004
MOVW
SMW112, VW1006
MOVW
+0, AC0
MOVB
SMB114, AC0
+I
AC0, VW1006
NETWORK
LDB>=
SMB114, 9
MOVB
8, VB1008
NOT
MOVB
SMB114, VB1008
NETWORK
LDB>=
SMB115, 9
MOVB
8, VB1009
NOT
MOVB
SMB115, VB1009
NETWORK
LD
SM0.0
BMB
*VD1000, QB0, VB1008
BMB
IB0, *VD1004, VB1009
NETWORK
MEND
9-26
DP status
Master address
V memory offset of outputs (word value)
Number of output bytes
Number of input bytes
Output data pointer
Input data pointer
//On every scan:
//create an output pointer,
//add in the output offset,
//create an input pointer,
//add in output offset,
//clear the accumulator,
//load the number of output bytes.
//Offset pointer
//If the number of output bytes > 8,
//output count = 8
//Else
//output count = number of output bytes.
//If the number of input bytes > 8,
//input count = 8
//Else
//input count = number of input bytes.
//On every scan:
//copy the DP outputs to the outputs,
//copy the inputs to the DP inputs.
S7-200 Programmable Controller System Manual
C79000-G7076-C230-02

Advertisement

Table of Contents
loading

Table of Contents