• 沒有找到結果。

Introduction

This section describes the properties and technical specifications of the CPU if you use it as a DP slave.

Reference

You can find the features and technical specifications of the 41x CPUs in the section Technical Specifications.

长沙工控帮教育科技有限公司整理

PROFIBUS DP 5.1 CPU 41x as DP master / DP slave

Requirements

• Only one DP interface of a CPU can be configured as a DP slave.

• Will the MPI/DP interface be a DP interface? If so, you must configure the interface as a DP interface.

Before commissioning you must configure the CPU as a DP slave. In other words, you must do the following in STEP 7

– Activate the CPU as a DP slave, – Assign a PROFIBUS address, – Assign a slave diagnostic address

– Define the address areas for data transfer to the DP master

Configuration and Parameter Assignment Frame

When you configure and assign parameters to CPU 41x, you are supported by STEP 7. If you need a description of the configuration and parameter assignment frame in order to use a bus monitor, for example, you can find it on the Internet at

http://support.automation.siemens.com under article ID 1452338.

Monitor/Modify and Programming via PROFIBUS

As an alternative to the MPI interface, you can use the PROFIBUS DP interface to program the CPU or execute the programming device functions Monitor and Modify. To do this, you must enable these functions when you configure the CPU as DP slave in STEP 7.

Note

The use of Programming or Monitor and Modify via the PROFIBUS DP interface extends the DP cycle.

Data Transfer Via a Transfer Memory

As a DP slave the CPU 41x makes a transfer memory available to PROFIBUS DP. Data transfer between the CPU as DP slave and the DP master always takes place via this transfer memory. Configure the following address areas: 244 bytes per input / output with a maximum of 32 bytes per module.

That is, the DP master writes its data to these transfer memory address areas, the CPU reads these data in the user program, and vice versa.

长沙工控帮教育科技有限公司整理

PROFIBUS DP

5.1 CPU 41x as DP master / DP slave

S7-400 Automation System, CPU Specifications

5-12 Manual, 11/2006, A5E00850746-02

PROFIBUS

I/O

DP master

I/O

CPU 41x as DP Slave

Intermediate memory in the I/O address area

Figure 5-2 Transfer memory in the CPU 41x as DP slave

Address Areas of the Transfer Memory

Configure the input and output address areas in STEP 7:

• You can configure up to 32 input and output address areas.

• Each of these address areas can be up to 32 bytes in size.

• You can configure a maximum of 244 bytes of inputs and 244 bytes of outputs in total.

An example for the configuration of the address assignments of the transfer memory is provided in the table below. You will also find this in the online help for STEP 7 configuration.

Table 5-8 Configuration example for the address areas of the transfer memory

Type Master address Type Slave address Length Unit Consistency

E 222 O 310 2 Byte Unit

Address areas in the

DP master CPU Address areas in the

DP slave CPU These parameters of the address areas must be the same for the DP master and DP slave

Rules

You must adhere to the following rules when working with the transfer memory:

• Assignment of the address areas:

– Input data for the DP slave is always output data from the DP master – Output data from the DP slave is always input data for the DP master

• You can assign the addresses as you choose. You access the data in the user program with load/transfer commands or with SFCs 14 and 15. You can also specify addresses from the process image input and output table (see also section "DP address areas of the 41x CPUs").

长沙工控帮教育科技有限公司整理

PROFIBUS DP 5.1 CPU 41x as DP master / DP slave

Note

You assign addresses for the transfer memory from the DP address area of the CPU 41x.

You must not reassign the addresses you have already assigned to the transfer memory to the I/O modules on the CPU 41x.

• The lowest address in each address area is the start address of that address area.

• The length, unit and consistency of address areas for the DP master and DP slave that belong together must be the same.

S5 DP Master

If you use an IM 308 C as a DP master and the CPU 41x as a DP slave, the following applies to the exchange of consistent data:

You must program FB192 in the IM 308-C so that consistent data can be transferred between the DP master and DP slave. The data of the CPU 41x is only output or displayed contiguously in a block with FB192.

AG S5-95 as a DP Master

If you use an AG S5-95 as a DP master, you must also set its bus parameters for the CPU 41x as DP slave.

长沙工控帮教育科技有限公司整理

PROFIBUS DP

5.1 CPU 41x as DP master / DP slave

S7-400 Automation System, CPU Specifications

5-14 Manual, 11/2006, A5E00850746-02

Sample Program

The small sample program below illustrates data transfer between the DP master and DP slave. This example contains the addresses from the table "Configuration example for the address areas of the transfer memory".

In the DP slave CPU In the DP master CPU

RECORD:= P#M60.0 Byte20 RET_VAL:= MW 22

RECORD:=P#M30.0 Byte20

Receive data

Data Transfer in STOP Mode

The DP slave CPU changes to STOP mode: The data in the transfer memory of the CPU is overwritten with "0". In other words, the DP master reads "0".

The DP master changes to STOP mode: The current data in the transfer memory of the CPU is retained and can continue to be read by the CPU.

PROFIBUS Address

You must not set 126 as the PROFIBUS address for the CPU 41x as DP slave.

长沙工控帮教育科技有限公司整理

PROFIBUS DP 5.1 CPU 41x as DP master / DP slave