0% found this document useful (0 votes)
67 views14 pages

Service & Support: Configuration of An S7-300 CPU As DP Slave To A CP 342-5 As DP Master

The document provides instructions for configuring an S7-300 CPU as a DP slave to a CP 342-5 configured as a DP master. The steps include assigning PROFIBUS addresses, selecting the operating modes as DP slave or DP master, and configuring input and output addresses for data transfer between the devices. The S7 programs in the DP slave and DP master are also outlined for reading and writing data using load/transfer commands or system functions.

Uploaded by

justin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
67 views14 pages

Service & Support: Configuration of An S7-300 CPU As DP Slave To A CP 342-5 As DP Master

The document provides instructions for configuring an S7-300 CPU as a DP slave to a CP 342-5 configured as a DP master. The steps include assigning PROFIBUS addresses, selecting the operating modes as DP slave or DP master, and configuring input and output addresses for data transfer between the devices. The S7 programs in the DP slave and DP master are also outlined for reading and writing data using load/transfer commands or system functions.

Uploaded by

justin
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 14

Cover sheet

Configuration of an S7-300 CPU as DP


Slave to a CP 342-5 as DP Master
PROFIBUS DP

FAQ  May 2010

Service & Support


Answers for industry.
Question

This entry originates from the Service&Support Portal of Siemens AG, Sector
Industry, Industry Automation and Drive Technologies. The conditions of use
specified there apply (www.siemens.com/nutzungsbedingungen).

Go to the following link to download this document.


http://support.automation.siemens.com/WW/view/de/6518938

Question
How do you configure an S7-300 CPU as DP slave to a CP 342-5 as DP master?

Answer
Follow the instructions and notes listed in this document for a detailed answer to
the above question.

S7-300 CPU als DP-Slave am CP342-5 als DP-Master


2 V1.0, Entry ID: 6518938
Contents

Contents
1 Configuration of an S7-300 CPU as DP Slave................................................. 4
2 Configuration of the CP342-5 as DP Master ................................................... 8
3 S7 Program in the DP Slave ........................................................................... 11
3.1 Data transfer with load and transfer commands ................................ 11
3.2 Data transfer with system functions ................................................... 11
Parameterization of SFC14 "DPRD_DAT"......................................... 11
Parameterization of SFC14 "DPWR_DAT" ........................................ 11
4 S7 Program in the DP Master ......................................................................... 13
Parameterization of FC1 "DP_SEND"................................................ 13
Parameterization of FC2 "DP_RECV"................................................ 13

S7-300 CPU als DP-Slave am CP342-5 als DP-Master


V1.0, Entry ID: 6518938 3
1 Configuration of an S7-300 CPU as DP Slave

1 Configuration of an S7-300 CPU as DP


Slave
This example shows how to configure a CPU 315-2DP as DP slave to a CP 342-5
as DP master. Proceed as follows to configure CPU 315-2DP as DP slave.

Table 1-1
No. Action Note
1. In the SIMATIC Manager, you create a
new STEP 7 project via the menu "File
> New".

2. Add a SIMATIC 300 station via "Insert >


Station".

3. Mark the SIMATIC 300 station "315-


2DP". Then double-click on Hardware
to open the hardware configuration of
the SIMATIC 300 station.

S7-300 CPU als DP-Slave am CP342-5 als DP-Master


4 V1.0, Entry ID: 6518938
1 Configuration of an S7-300 CPU as DP Slave

No. Action Note


4. In the Hardware Catalog, under
SIMATIC 300, select the mounting
channel and drag-and-drop this into the
Hardware Configuration.

drag & drop

5. In the Hardware Catalog, select the


CPU being and drag-and-drop this to
slot 2 of the mounting channel.
Double-click on the DP interface of the
drag & drop
CPU to open the "Properties" dialog of
the DP interface.

6. In the Properties dialog of the DP


interface, select the "General" tab and
click on the "Properties" button.

7. Specify a PROFIBUS address for the


CPU and assign a PROFIBUS
subnetwork to the CPU. If you have not
yet created a PROFIBUS subnetwork,
click on the "New" button to create a
new PROFIBUS subnetwork.
Confirm the settings with "OK".

S7-300 CPU als DP-Slave am CP342-5 als DP-Master


V1.0, Entry ID: 6518938 5
1 Configuration of an S7-300 CPU as DP Slave

No. Action Note


8. In the Properties dialog of the DP
interface, you switch to the "Operating
Mode" tab. Select "DP slave" as the
operating mode.

9. In the Properties dialog of the DP


interface, you switch to the
"Configuration" tab. Click on the "New"
button to configure the inputs and
outputs for the DP slave and DP
master.

10. Define the input and output addresses,


the length, the unit and the consistency.
Specify "All" for "Consistency" to
transfer the data consistently in the
block.
Confirm the settings with "OK".
Then close the Properties dialog of the
DP interface with "OK".

S7-300 CPU als DP-Slave am CP342-5 als DP-Master


6 V1.0, Entry ID: 6518938
1 Configuration of an S7-300 CPU as DP Slave

No. Action Note


11. Save and compile the hardware
configuration of the S7-300 station.
Load the configuration into the CPU.

download
Save and compile

S7-300 CPU als DP-Slave am CP342-5 als DP-Master


V1.0, Entry ID: 6518938 7
2 Configuration of the CP342-5 as DP Master

2 Configuration of the CP342-5 as DP Master


In the example, a CP342-5 is configured as a DP master. Please follow the
instructions below for configuring the CP342-5 as DP master.
Table 2-1
No. Action Note
1. If you have configured the S7-300 CPU
as DP slave, add another S7-300
station to your STEP 7 project.

2. Mark the SIMATIC 300 station "Master".


Then double-click on Hardware to open
the hardware configuration of the
SIMATIC 300 station.

3. In the Hardware Catalog, under


SIMATIC 300, select the mounting
channel, the appropriate CPU and the
CP342-5 and drag-and-drop them into
the Hardware Configuration.
Double-click on the CP342-5 to open drag & drop

the Properties dialog of the CP342-5.

4. In the Properties dialog of the CP342-5,


select the "General" tab and click on the
"Properties" button.

S7-300 CPU als DP-Slave am CP342-5 als DP-Master


8 V1.0, Entry ID: 6518938
2 Configuration of the CP342-5 as DP Master

No. Action Note


5. Specify a PROFIBUS address for the
CP342-5 and assign a PROFIBUS
subnetwork to the CP342-5.
The DP slave and the DP master are
assigned to the same PROFIBUS
subnetwork.
Confirm the settings with "OK".

6. In the Properties dialog of the CP342-5,


you switch to the "Operating Mode" tab.
Select "DP master" as the operating
mode.
Confirm the settings with "OK".

7. In the Hardware Catalog, under


PROFIBUS DP > Configured Stations,
select the CPU 31x and drag-and-drop
it into the Hardware Configuration.
Double-click on the DP slave to open drag & drop

the Properties dialog.

8. In the Properties dialog of the DP slave,


select the "Connection" tab and click on
the "Connect" button.

S7-300 CPU als DP-Slave am CP342-5 als DP-Master


V1.0, Entry ID: 6518938 9
2 Configuration of the CP342-5 as DP Master

No. Action Note


9. In the Properties dialog of the DP
interface, you switch to the
"Configuration" tab. Click on the "New"
button to configure the inputs and
outputs for the DP slave and DP
master.

10. Define the input and output addresses,


the length, the unit and the consistency.
Specify "All" for "Consistency" to
transfer the data consistently in the
block.
Confirm the settings with "OK".
Then close the Properties dialog of the
DP slave with "OK".

11. Save and compile the hardware


configuration of the S7-300 station.
Load the configuration into the CPU.
download

save and compile

S7-300 CPU als DP-Slave am CP342-5 als DP-Master


10 V1.0, Entry ID: 6518938
3 S7 Program in the DP Slave

3 S7 Program in the DP Slave


3.1 Data transfer with load and transfer commands
You use the load and transfer commands to send data to the configured outputs of
the DP slave and receive data from the configured inputs of the DP slave. The load
and transfer commands support consistent read/write transfer of a maximum of 4
bytes.
1 byte from the marker area is written with the transfer command to the output area
of the DP slave and transferred to the DP master.
1 byte is read with the load command from the input area of the DP slave and
received by the DP master.
Figure 3-1

Load and
transfer
commands

3.2 Data transfer with system functions


To transfer more than 4 bytes of data consistently you call the system functions
SFC14 "DPRD_DAT" and SFC15 "DPWR_DAT" in the S7 program of the CPU.
These system functions are available in the Standard Library > System Function
Blocks > Blocks.
At the LADDR parameter of system functions SFC14 and SFC15 you specify the
start address of the inputs and outputs in accordance with the hardware
configuration.
In this example a maximum of 5 bytes are transferred.

Parameterization of SFC14 "DPRD_DAT"


At the RECORD input parameter of SFC14 "DPRD_DAT" you specify the address
and length of the data area in which the receive data is to be stored. The length of
the data area must be at least the total length of the input address area.
In this example the SFC14 "DPRD_DAT" transfers 5 bytes from the input area of
the DP slave into DB2 as from address 0.

Parameterization of SFC14 "DPWR_DAT"


At the RECORD input parameter of SFC15 "DPWR_DAT" you specify the address
and length of the data area in which the send data is to be stored. The length of the
data area must be at least the total length of the output address area.

S7-300 CPU als DP-Slave am CP342-5 als DP-Master


V1.0, Entry ID: 6518938 11
3 S7 Program in the DP Slave

In this example the SFC15 "DPWR_DAT" transfers 5 bytes from DB1 as of address
0 into the output area of the DP slave for transfer to the DP master.
Figure 3-2

Start address of inputs

Start address of outputs

S7-300 CPU als DP-Slave am CP342-5 als DP-Master


12 V1.0, Entry ID: 6518938
4 S7 Program in the DP Master

4 S7 Program in the DP Master


The CP342-5 always transfers the data consistently. For data exchange via
PROFIBUS you call functions FC1 "DP_SEND" and FC2 "DP_RECV" in the user
program of the CPU.
Functions FC1 and FC2 are available in the SIMATIC_NET_CP > CP 300 > Blocks
library.

Parameterization of FC1 "DP_SEND"


FC1 "DP_SEND" transfers the data of a specified output area to the CP342-5 for
output to the S7-300 CPU.
In this example, the output address area for the CP342-5 is configured as from
address 10 with a length of 5 bytes (QB0 up to QB14), i.e. the total length of the
output address area is 15 bytes.
At the SEND input parameter of FC1 you specify the address and length of the
data area in which the send data are to be stored. The length of the data area must
be at least the total length of the output address area.
In this example FC1 "DP_SEND" transfers 15 bytes from DB1 as of address 0 into
the output area of the CP342-5 for transfer to the DP slave.
The following table shows the assignment of the data area in which the send data
are to be stored and the configured output address area.
Table 4-1
Data area of send data Output address area
DB1.DBB0 QB0
DB1.DBB1 QB1

DB1.DBB14 QB14

Parameterization of FC2 "DP_RECV"


FC1 "DP_RECV" reads the process data of the S7-300 CPU into a specified input
address area.
In this example, the input address area for the CP342-5 is configured as from
address 10 with a length of 5 bytes (IB0 up to IB14), i.e. the total length of the input
address area is 15 bytes.
At the RECV input parameter of FC2 you specify the address and length of the
data area in which the received data are to be stored. The length of the data area
must be at least the total length of the output address area.
In this example FC1 "DP_RECV" reads 15 bytes from the input area of the CP342-
5 into DB2 as from address 0.
The following table shows the assignment of the data area in which the received
data are to be stored and the configured input address area.
Table 4-2
Data area of received data Input address area
DB2.DBB0 IB0
DB2.DBB1 IB1

DB2.DBB14 IB14

S7-300 CPU als DP-Slave am CP342-5 als DP-Master


V1.0, Entry ID: 6518938 13
4 S7 Program in the DP Master

Figure 4-1

Address and length of data area


for the send send data

Address and length of data area


for the receive data

S7-300 CPU als DP-Slave am CP342-5 als DP-Master


14 V1.0, Entry ID: 6518938

You might also like