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