// Sample DP program
// The DP configuration data in the SM memory area provides the
// configuration of the DP slave.
// following data:
//
//
SMW220
DP Module Error Status
//
SMB224
DP STATUS
//
SMB225
Master Address
//
SMW226
V memory offset of outputs
//
SMB228
Number of bytes of output data
//
SMB229
Number of bytes of input data
//
VD1000
Output Data Pointer
//
VD1004
Input Data Pointer
//
NETWORK 1
//
// Calculate the Output data pointer into V memory.
//
LDB= SMB224, 2
MOVD
&VB0, VD1000
ITD
SMW226, AC0
+D
AC0, VD1000
NETWORK 2
//
// Calculate the Input data pointer into V memory.
//
LDB=
SMB224, 2
MOVD
VD1000, VD1004
BTI
SMB228, AC0
ITD
AC0, AC0
+D
AC0, VD1004
NETWORK 3
//
// Set amount of data to be copied.
//
LDB=
SMB224, 2
MOVB
SMB228, VB1008
MOVB
SMB229, VB1009
NETWORK 4
//
// Transfer Masters Outputs to CPU's Outputs. Copy CPU's inputs
// to the Master's inputs.
//
LDB= SMB224, 2
BMB *VD1000, QB0, VB1008
BMB IB0, *VD1004, VB1009
Figure A-32
STL Sample Program for DP Communication to a CPU 224
S7-200 Programmable Controller System Manual
A5E00066097-02
The program uses the
// if ( in data exchange mode )
// Output buffer is an offset from VB0.
// Add Vmem offset to get output
// buffer offset
// if ( in data exchange mode )
// Get the output pointer address
// Add the number of output bytes
// to the output pointer to get
// the starting input pointer.
// if ( in data exchange mode )
// Get number of output bytes to copy
// Get number of input bytes to copy
// if ( in data exchange mode )
// Copy master outputs to CPU outputs
// Copy CPU inputs to Master's Inputs
S7-200 Specifications
A-65