• No results found

Example of Configuring an S7-400 as I-Slave Below we shall create the following configuration:

2 Configuring Central Racks 2.1 Rules for Arranging Modules (SIMATIC 300)

3 Configuring the Distributed I/O (DP)

3.7 Intelligent DP Slaves

3.7.2 Example of Configuring an S7-400 as I-Slave Below we shall create the following configuration:

• Master Station (Name "DP Master") with CPU 417-4 as DP Master (DPV1). S7-400-CPUs with integrated DP interface can only be customized as DPV1 Master as of Firmware Version 3.0.

• Slave Station (Name "DP Slave") with CPU 414-3 DP as DP I-Slave

As usual for the configuration of intelligent DP Slaves, proceed with the following steps:

Step Procedure Explanation

1 Creating the Master Station with the CPU 417-4. Name: DP Master

The PROFIBUS address should be 2.

2 Creating the Slave Station with the CPU 414- 3 DP. Name: DP Slave.

The operating mode of the DP interface of the CPU 414-3 DP must be set to "DP Slave". The PROFIBUS address should be 3.

3 Filling out the first row in the "Configuration" tab of the slave station. To create new line, click on the "New" button

If this line is not filled out, the data will be inconsistent. In the properties dialog, select the "MS" (master-slave) mode and apply the default settings.

4 Inserting the DP I-Slaves into the Master Station from the folder "Configured Stations".

From the hardware catalog under PROFIBUS DP select a CPU 41x from the folder

"Configured Stations" and drag-and-drop this "Representative" symbol for the DP Slave station created to the DP Master System. 5 Coupling the inserted DP I-Slaves to the

configured Slave Station.

Coupling is prerequisite for assigning the "Representative" symbol to the configured station, or for assigning the DP Slave inputs to the DP-Master outputs and vice versa.

Configuring the Distributed I/O (DP)

Arrange the Master Station and Slave Station configuration to view them side-by- side. The result is shown in the screenshot below:

Configuring the Distributed I/O (DP)

How to Assign Addresses

Step Procedure Explanation

A double-click on the DP interface of the DP Master in the Master Station opens a dialog and a number of tabs

"General" tab:

Name of the interface and PROFIBUS address with network assignment. The PROFIBUS address should be set to 2.

"Address" tab:

Logic address of the DP interface (system messages identify the interface via this address).

"Operating mode" tab:

The option "DP Master" must be selected. Also, DP mode "DPV1" must be set.

The other tab contents are not relevant for this example. A double-click on

the DP Slave symbol in the Master Station opens a dialog with several tabs

"General" tab:

Editable designation of the DP Slave symbols and diagnostic address(es). Here, two diagnostic addresses are assigned to a DPV1 Master:

The first diagnostic address is assigned to the virtual slot 0 of the DP Slave. Via this address the DP Master receives diagnostic data and/or interrupts that are not assigned to a DP Slave slot. In our example, this is the address 16381.

The second diagnostic address is assigned to the virtual slot 2 of the DP Slave. Via this address the DP Master receives diagnostics or interrupts that are assigned to the DP interface. In our example, this is the address 16380.

(Also refer to the section "DP Slave from the view of the DP Master").

"Coupling" tab:

Assigning the DP Slave symbol in the Master station to the configured Slave station. Once the assignment is made, the designation of the configured Slave station appears in the lower section of the tab under "Active Coupling".

"Configuration" tab:

Assignment of I/O areas for the data exchange between the Master station and the Slave station. Double-click the first line, and in the dialog that is displayed, fill out the fields completely.

A double-click on the DP Slave interface in the Slave station opens a dialog that contains a number

"General" tab:

Name of the interface and PROFIBUS address with network assignment. The PROFIBUS address should be set to 3.

"Address" tab:

Configuring the Distributed I/O (DP)

Step Procedure Explanation

(also refer to the section "DP Master from the view of the DP Slave "). DP mode: Here, DPV1 should also be selected if "DPV1" mode is set for the DP Master. Otherwise, the "Address for the virtual slot 2" cannot be selected.

"Configuration" tab:

For the meaning of this tab refer to

Difference: The "Local: ..." column can be edited, even if the

intelligent DP Slave has not yet been assigned to a DP Master (refer to the "Coupling" tab).

Configuring the Distributed I/O (DP)

DP Slave from the View of the DP Master

You can use the DP Master CPU user program to obtain DP Slave status information via the configured diagnostic address 16381 which is assigned to virtual slot 0 (Slot 0) of the DP Slave. Slot 0 is, subordinate to DPV1, representative for the entire Slave station. SFB 54 "RALRM", for example, uses the output

parameter ID as a pointer to this address if an interrupt is triggered by this Slave and if this interrupt is not assigned to a slot. If the virtual slot 2 of this DP Slave triggers the interrupt (that is, the CPU section) it can be identified via diagnostic address 16380. '30DVWHU'39PRGH 8VHUSURJUDP 352),%86 '36ODYH '39 PRGH 'LDJQRVWLFDGGUHVV IRUVWDWLRQ IDLOXUHYLUWXDOVORW 'LDJQRVWLFDGGUHVV IRUGLDJQRVWLFLQWHUUXSWVZLWK PRGHWUDQVLWLRQDQGIRU KDUGZDUHLQWHUUXSWV YLUWXDOVORW 6ORW 6ORW IUHH 6ORW 6ORW IUHH 6ORW

Configuring the Distributed I/O (DP)

DP Master from the View of the DP-Slave

You can use the DP-Slave CPU user program, for example, to read DP Master failure information via the configured diagnostic address 8189.

If you have set the DP Slave to DPV1 mode you can, for example, trigger a Hardware Interrupt. Here, in the DP Slave user program you must utilize SFC 7 "DP_PRAL" to trigger the interrupt in the DP Master via the configurable address for the virtual slot 2 (Slot 2). This address is 8188 in our example. The sample below shows user program segments of the DP Slave that has triggered the hardware interrupt and user program segments of the DP Master that evaluate this interrupt. '30DVWHU '39PRGH 352),%86 8VHU SURJUDP '36ODYH '39 PRGH 6ORW 6ORW IUHH 6ORW 6ORW IUHH 6ORW <RXFDQWULJJHUDKDUGZDUHLQWHUUXSWDWWKHDVVLJQHGPDVWHUIRUDQ\ FRQILJXUHGVORWRIWKH,6ODYHEHFDXVHHYHU\YLUWXDOVORWKDVDQ DGGUHVVDYDLODEOH 'LDJQRVWLFDGGUHVV IRUVWDWLRQIDLOXUH YLUWXDOVORWDGGUHVV $GGUHVVIRUYLUWXDO6ORW KDUGZDUHDQGGLDJQRVWLF LQWHUUXSWV

Configuring the Distributed I/O (DP)

DP-Slave Program (in the I-Slave CPU) for Triggering a Hardware Interrupt //

// ...

L DW#16#F0F0 //Constant for the identification of the I-Slave event //that triggered the Hardware Interrupt

T MD 100 //...

CALL "DP_PRAL"

REQ :=M1.0 //trigger Hardware Interrupt if REQ=1 IOID :=B#16#54 //Input area (configured address = E 8188) LADDR :=W#16#8189 //Address (configured address = E 8188)

AL_INFO:=MD100 //MD 100 is an interrupt info directed towards the //DP Master (can be read from the start info of //OB 40 in the Master as OB40_POINT_ADDR) RET_VAL:=MW10 //Return value (0000, if no error)

BUSY :=M1.1 //If BUSY =1 the Hardware Interrupt is not yet //acknowledged by the Master

// ...

DP Master Program (in the DP Master station CPU) for the Evaluation of a Hardware Interrupt

// ...

L #OB40_POINT_ADDR //load interrupt info

L DW#16#F0F0 //compare with the constant which the I-Slave has //"passed on" when it generated the interrupt ==I //Interrupt info from I-Slave?

SPB m001 //if yes, jump to respective program segment BEB

Configuring the Distributed I/O (DP)