Specifications

Technical Specifications Appendix A
445
Sample Program for DP Communications to a CPU
A sample program in Statement List for the PROFIBUS--DP module in slot 0 for a CPU that uses
the DP port information in SM memory is shown below. The program determines the location of
the DP buffers from SMW226 and the sizes of the buffers from SMB228 and SMB229. This
information is used to copy the data in the DP output buffer to the process-image output register of
the CPU. Similarly, the data in the process-image input register of the CPU are copied into the V
memory input buffer.
In the following sample program for a DP module in position 0, 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