Professional Documents
Culture Documents
SITRAIN
IK-PBSYS / DP Master CP342-5 DP Page 1 03/2007
Siemens AG 2007 - Subject to change without prior notice
Contents Page
Differences between the CP342-5 and the integral DP interface ....................................................... 2
Basic procedure ................................................................................................................................ 3
Configuring with STEP 7 .................................................................................................................. 4
Properties of CP 342-5 DP: General .................................................................................................. 5
Characteristics of the PROFIBUS DP network .................................................................................. 6
Properties of CP 342-5 DP: Addresses ........................................................................................... 7
Properties of CP 342-5 DP: DPM operating mode ............................................................................ 8
Properties of CP 342-5 DP: Options .................................................................................................. 9
CP 342-5 DP (master station without slaves) .................................................................................... 10
Data exchange: DP master and CPU (1) ............................................................................................ 11
Data exchange: DP master and CPU (2) ........................................................................................... 12
Data exchange: DP master and CPU (3) .......................................................................................... 13
Data areas on the ET 200M ............................................................................................................... 14
Data areas on the ET 200S ............................................................................................................... 15
Exercise 1: Configure the CP342-5 DP as a DPM ............................................................................ 16
Exercise 2: Configure the ET200M and ET200S ............................................................................... 17
Exercise 3: Program a data exchange ............................................................................................. 18
SITRAIN
IK-PBSYS / DP Master CP342-5 DP Page 2 03/2007
Siemens AG 2007 - Subject to change without prior notice
Configuration The DP master system is set up when the CP is configured and not
when the CPU is configured. The IO areas of the DP slaves configured during this
process are not IO areas of the CPU, but merely mailboxes of the DP master.
Programming The CP342-5 does not simulate IO areas. In other words, the CPU does not "see"
the IO areas configured for the master system and consequently does not
automatically transfer data to the process image areas.
This data exchange must be explicitly programmed in the S7 program using the
two blocks FC1 "DP_SEND" and FC2 "DP_RECV" from the library
SIMATIC_NET_CP.
Data consistency Using blocks FC1 and FC2 always ensures automatic data consistency,
regardless of the number of IO bytes transferred.
Performance parameters
There are no longer any differences in the data volume of the maximum possible
baud rate with the later versions of the CP342-5 (see Equipment Manual).
Basic procedure
Configuring
CP 342-5 DP
Use of
library blocks
SITRAIN
IK-PBSYS / DP Master CP342-5 DP Page 3 03/2007
Siemens AG 2007 - Subject to change without prior notice
Configuration 1.Configure the DP master system, i.e. specify the DP master and associated DP
slaves in the configuration table.
2.Assign the DP master system parameters (IO addresses, groups, etc).
Library The functions described here (blocks of type FC) plus the STEP 7 basic package
and the loadable option NCM S7 for PROFIBUS are all supplied as a library.
Instructions on how to use these blocks can be found below.
SITRAIN
IK-PBSYS / DP Master CP342-5 DP Page 4 03/2007
Siemens AG 2007 - Subject to change without prior notice
Properties You open the properties dialog of the CP 342-5 by double clicking on the CP
module.
"General" tab The "General" tab specifies the type and location of the module as well as
information relevant to the network in the case of modules with interfaces,
e.g. the node address. You will also find information in this tab sheet regarding
the STEP 7 project in which the relevant module is integrated.
Interface You configure the PROFIBUS address and the assignment to a PROFIBUS
subnet of the CP in this field.
You can edit the properties of the subnet by clicking on the Properties button
(see following page).
Backplane bus AS300 modules have an independent MPI address for ONLINE access. This can
be adjusted in the MPI address field. The default setting is the next higher value
from the CPU MPI address. If this station is operated on an MPI network on which
the default address setting has already been assigned (second CPU), then the
default value must be changed on this tab.
SITRAIN
IK-PBSYS / DP Master CP342-5 DP Page 5 03/2007
Siemens AG 2007 - Subject to change without prior notice
Interface Click on the Properties button on the General tab to enter settings for the subnet.
Network settings You can change the PROFIBUS address and select the PROFIBUS subnet to
which the interface of the node is connected.
Subnet This field specifies the PROFIBUS subnet via which the node is networked.
Select either an existing (previously configured subnet), or
New... click the "New" button if you want to create another PROFIBUS subnet.
Delete If you want to delete a subnet, select it and click on the Delete button. The subnet
is deleted but not the nodes. You can connect the nodes of a previous subnet to
another subnet.
Address If you assign the subnet before you configure the bus address, you will
automatically avoid duplicate address assignments because STEP7 will now
"know" the addresses already used on the assigned subnet.
The transmission rate set and the "highest address
are displayed for information purposes (can be changed by clicking the
"Properties" button).
Properties Click on the Properties button if you want to display or edit the properties of the
selected subnet.
Apart from the bus address itself, the main properties of a subnet includes the
baud rate, the profile and other data required to calculate internal bus parameters.
Network configuration
SITRAIN
IK-PBSYS / DP Master CP342-5 DP Page 6 03/2007
Siemens AG 2007 - Subject to change without prior notice
Network settings You can change the PROFIBUS address and select the PROFIBUS subnet to
which the interface of the node is connected.
Subnet This field specifies the PROFIBUS subnet via which the node is networked.
Select either an existing (previously configured subnet), or
New... click the New button if you want to create another PROFIBUS
subnet.
Delete If you want to delete a subnet, select it and click on the Delete button. The subnet
is deleted but not the nodes. You can connect the nodes of a previous subnet to
another subnet.
Address If you assign the subnet before you configure the bus address, you will
automatically avoid duplicate address assignments because STEP7 will now
"know" the addresses already used on the assigned subnet.
The transmission rate set and the "highest address are displayed for information
purposes (can be changed by clicking the "Properties" button).
Properties Click on the Properties button if you want to display or edit the properties
of the selected subnet.
Apart from the bus address itself, the main properties of a subnet include the
baud rate, the profile and information about other network components, such as
cable lengths, optical element, etc. which are required to calculate internal bus
parameters.
SITRAIN
IK-PBSYS / DP Master CP342-5 DP Page 7 03/2007
Siemens AG 2007 - Subject to change without prior notice
Addresses tab This value is passed as parameter CPLADDR to blocks FC1 "DP_SEND" and
FC2 "DP_RECV" in the S7 program. It specifies the address which can be used
to access the CP342-5 via the backplane bus.
This address is dependent on the CP slot and is calculated in exactly the same
way, for example, as the address of an analog module:
This formula is automatically applied when the box System selection is checked.
When this box is unchecked, any address value can be input, but it should be
outside the PII and PIO areas.
Example
SITRAIN
IK-PBSYS / DP Master CP342-5 DP Page 8 03/2007
Siemens AG 2007 - Subject to change without prior notice
- No DP The CP342-5 is used only for the FDL protocol, i.e. it is neither
a DP master nor a DP slave (default setting).
Via the FDL protocol, for example, it can exchange data with
an S5 control.
- DP master The CP generally operates in this mode. The module is the DP
master, i.e. the entire DP master system is configured on this CP.
- DP slave The CP342-5 is operated as a DP slave. It is then coupled to a
master system as a "configured station".
If the CP must also be capable of using the STEP7 ONLINE
access, the box Module is active node on
PROFIBUS subnet must be checked.
DP delay time The start of the next DP cycle in each case is delayed by the value configured
here. Within this time period, the CP can exchange data via the S7 protocol
(STEP7 online) and/or the FDL protocol.
The DP data exchange is "braked" by this delay period.
SITRAIN
IK-PBSYS / DP Master CP342-5 DP Page 9 03/2007
Siemens AG 2007 - Subject to change without prior notice
DP master
mode
SITRAIN
IK-PBSYS / DP Master CP342-5 DP Page 10 03/2007
Siemens AG 2007 - Subject to change without prior notice
Result The master station is preconfigured and comprises a CPU 315-2 DP (without
configured DP function) and a CP342-5 as the DP master.
FC blocks The following blocks are made available for the S7 program in library SIMATIC_
NET_CP:
- FC1 "DP_SEND"
This block transfers the entire DP output area from the CPU to the DP master
(CP).
- FC2 "DP_RECV"
This block transfers the entire DP input area from the DP master (CP) to the
CPU.
- FC3 "DP_DIAG"
This block enables the DP master to scan the diagnostic data of DP slaves.
- FC4 "DP_CTRL"
This block manages check functions for the distributed I/Os, such as Sync,
Freeze, activate/deactivate slave, etc.
CPU cycle A possible processing sequence for the DP FC function blocks in combination
with organization and program blocks in the CPU cycle is shown in the diagram
above. The example shows a case in which, at the beginning of every CPU cycle,
process data are read in and following execution of the user programs, the
created output data are output to the process I/O. An independent diagnostic
program is provided for DP slave monitoring.
Slot 2 4 5 7
SITRAIN
IK-PBSYS / DP Master CP342-5 DP Page 11 03/2007
Siemens AG 2007 - Subject to change without prior notice
I/O areas Unlike a CP with an integrated DP master interface or a CP443-5, the CP342-5
does not make any I/O areas available to the CPU.
This means that the IO areas programmed with HW Config here have nothing to
do with the IO address space on the CPU, in other words, they are "invisible" to
the CPU.
These address areas are presented as IO areas within the HW configuration
merely to represent the functional aspect of the data exchange between the DP
master and the DP slaves. The areas which access these I/Os from the viewpoint
of STEP7 are not configured until the S7 program is created and cannot be
identified in the DP master system configuration.
Accordingly, no data are exchanged between the process images PII/PIO and the
CPU.
This data exchange must be programmed explicitly. The two blocks FC1 "DP-
SEND" and FC2 "DP-RECV" are provided for this purpose.
Advantages There are some functional advantages to using these two functions:
1. Data are always transferred consistently, i.e. in one block, between the CPU
and the DP master
2. In addition to process images, data blocks or bit memories can also be used as
data areas on the CPU.
Slot 2 4 5 7
SITRAIN
IK-PBSYS / DP Master CP342-5 DP Page 12 03/2007
Siemens AG 2007 - Subject to change without prior notice
Slot 2 4 5 7
SITRAIN
IK-PBSYS / DP Master CP342-5 DP Page 13 03/2007
Siemens AG 2007 - Subject to change without prior notice
SITRAIN
IK-PBSYS / DP Master CP342-5 DP Page 14 03/2007
Siemens AG 2007 - Subject to change without prior notice
ET200M The addresses set here (2 to 5) have no connection whatsoever to the address
areas on the CPU, i.e. they are not used as address areas in the S7 program.
They merely represent the source and destination areas for data exchanges with
the CPU.
However, the address value itself can also be used as an offset to the start value
of the address for the source or destination area of the DP-SEND/DP-RECV
blocks.
SITRAIN
IK-PBSYS / DP Master CP342-5 DP Page 15 03/2007
Siemens AG 2007 - Subject to change without prior notice
Address areas The addresses set here (0 to 4) have no connection whatsoever to the address
areas on the CPU, i.e. they are not used as address areas in the S7 program.
They merely represent the source and destination areas for data exchanges with
the CPU.
However, the address value itself can also be used as an offset to the start value
of the address for the source or destination area of the DP-SEND/DP-RECV
blocks.
Online diagnosis
(cyclical)
DP master
mode
SITRAIN
IK-PBSYS / DP Master CP342-5 DP Page 16 03/2007
Siemens AG 2007 - Subject to change without prior notice
Task description: Your task is to use the CP342-5 as a DP master instead of the integrated CPU
interface. You must use the ET200M (with analog module) and the ET 200S as
DP slaves.
Procedure 1.Install the CP342-5 module in the rack of the master station
2.Disconnect the bus cable from the integrated CPU interface (DP master)
and connect it to the interface of the CP
3.Use the bus cable to connect up the ET200M (address 4) and theET200S
(address 8) as DP slaves (switch over terminating resistors)
4.Switch the ONLINE interface of STEP7 over to MPI
5.Configure the CP342-5 DP as the DP master
6.Use the Save and compile function to create new system data blocks and load
them to the CPU.
7.Monitor the boot process and correct any errors that might occur
8.Open the properties dialog of the CP342-5 and click on command
Execute on the Diagnosis tab
9.In the left-hand window, open the folder PROFIBUS and select Nodes
Result Even though no DP slave has yet been configured, the stations networked on the
bus cable are displayed with their bus address and the active/passive status. This
view is updated dynamically if you activate monitoring mode (spectacles symbol).
SITRAIN
IK-PBSYS / DP Master CP342-5 DP Page 17 03/2007
Siemens AG 2007 - Subject to change without prior notice
Task Your task is to configure the ET 200M and ET 200S as DP slaves on the CP342-5
DP master system.
Procedure 1.Configure the ET 200S with the following parameters as a DP slave on the
master system:
- Bus address: 8
- I address: 0.0 - 0.7 (compress addresses)
- O address: 0.0 - 0.7 (compress addresses)
Result The two slaves are still displayed as "faulted". The reason for this is that the
master does not commence a cyclic data exchange with the two slaves until a
data exchange using blocks DP_SEND and DP_RECV is already in progress
between the CPU and DP master.
This will be programmed in the next exercise.
304(dec) = 130(hex)
304(dec) = 130(hex)
SITRAIN
IK-PBSYS / DP Master CP342-5 DP Page 18 03/2007
Siemens AG 2007 - Subject to change without prior notice
S7 program Programming the data interface between the S7 program (CPU) and the DP
master (CP).
Result The two slaves are now displayed as "o.k.". The master system itself is also
displayed as functioning correctly: BF LEDs on the DP master and slaves have
now gone out.
The belt model function and analog value display on the simulator should now
work exactly the same as if the CPU interface had been used as the DP master.