• 沒有找到結果。

Diagnostics Using LEDs – CPU 41x

The following table explains the meaning of the BUSF LEDs. The BUSF LED assigned to the interface configured as the PROFIBUS DP interface is always lit or flashing.

Table 5-9 Meaning of the "BUSF" LEDs of the CPU 41x as DP slave

BUSF Meaning Remedy

Off Configuration correct

Flashing The parameter settings of the CPU 41x are incorrect. There is no data exchange between the DP master and the CPU 41x.

Causes:

The response monitoring timeout.

Bus communication over PROFIBUS DP was interrupted.

The PROFIBUS address is incorrect.

Check the CPU 41x.

Check to make sure that the bus connector is properly inserted.

Check whether the bus cable to the DP master has been disconnected.

Check the configuration and parameter settings.

on Bus short-circuit Check the bus configuration

Detection of the Bus Topology in a DP Master System With the SFC103 "DP_TOPOL"

The diagnostic repeater is available to improve the ability to locate faulty modules or an interruption on the DP cable when failures occur in ongoing operation. This module operates as a slave and can identify the topology of a DP subnet and record any faults originating from it.

You can use SFC103 "DP_TOPOL" to trigger the identification of the bus topology of a DP master system by the diagnostic repeater. For information on SFC 103, refer to the corresponding Online Help and to the System and Standard Functions manual The diagnostic repeater is described in the Diagnostic Repeater for PROFIBUS DP manual, order number 6ES7972-0AB00-8BA0.

Diagnostics with STEP 5 or STEP 7 Slave Diagnostics

The slave diagnostics complies with the EN 50170, Volume 2, PROFIBUS standard.

Depending on the DP master, diagnostic information can be read with STEP 5 or STEP 7 for all DP slaves that comply with the standard.

The display and structure of the slave diagnostics is described in the following sections.

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

PROFIBUS DP

5.1 CPU 41x as DP master / DP slave

S7-400 Automation System, CPU Specifications

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

S7 Diagnostics

S7 diagnostic information can be requested in the user program from all diagnostic-capable modules in the SIMATIC S7/M7 range of modules. You can find out which modules have diagnostic capability in the module information or in the catalog. The structure of the S7 diagnostic data is the same for both central and distributed modules.

The diagnostic data of a module is located in data records 0 and 1 of the system data area of the module. Data record 0 contains 4 bytes of diagnostic data describing the current status of a module. Data record 1 also contains module-specific diagnostic data.

You will find the structure of the diagnostic data described in the Standard and System Functions reference manual.

Reading the Diagnostics

Table 5-10 Reading the diagnostic data with STEP 5 and STEP 7 in the master system Automation system with

DP master Block or tab in STEP 7 Application Reference

"DP Slave Diagnostics"

tab Show slave diagnostics in clear

text on the STEP 7 user interface

See the section on hardware diagnostics in the STEP 7 Online Help and in the Programming with STEP 7 manual

SFC13 "DP NRM_DG" Read slave diagnostics (save to data area of the user program)

SFC, see System Software for S7-300/400, System and Standard Functions reference manual.

SFC 51 "RDSYSST" Read partial SSL lists.

Call SFC51 in the diagnostic interrupt using the SSL ID W#16#00B3 and read the SSL of the slave CPU.

SFB54 "RDREC" The following applies to the DPV1 environment: To read out interrupt information within the associated interrupt OB

System Software for S7-300/400, System and Standard Functions reference manual.

SIMATIC S7

FB125/FC125 Analyzing slave diagnostic data on the Internet at

http://www.ad.siemens.d e/simatic-cs

ID 387 257 SIMATIC S5 with IM

308-C as the DP master FB 192 "IM308C"

SIMATIC S5 with the S5-95U programmable controller as the DP master

FB 230 "S_DIAG"

Read slave diagnostics (save to data area of the user program)

For structure, see "Diagnostics of the CPU 41x as a DP slave"

section; for the FBs see the Distributed I/O Station ET 200 manual

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

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

Example of Reading Slave Diagnostic Data, Using FB 192 "IM 308C"

Here you will find an example of how to use FB 192 to read the slave diagnostics for a DP slave in the STEP 5 user program.

Assumptions

For this STEP 5 user program, the following is assumed:

• The IM 308-C assigned as the DP master mode uses page frames 0 to 15 (number 0 of IM 308-C).

• The DP slave is assigned PROFIBUS address 3.

• Slave diagnostics data should be stored in DB 20. You can also use any other data block for this.

• The slave diagnostic data has a length of 26 bytes.

STEP 5 User Program

Table 5-11 STEP 5 User Program

STL Description

:A DB 30 Default address area for the IM 308-C

:SPA FB 192 IM no. = 0, PROFIBUS address of the DP slave = 3

Name :IM308C Function: Read slave diagnostic data

DPAD : KH F800 is not evaluated

IMST : KY 0, 3 S5 data area: DB 20

FCT : KC SD Diagnostic data from data word 1

GCGR : KM 0 Length of diagnostic data = 26 bytes

TYPE KY 0, 20 Error code storage in the DW 0 of the DB 30

STAD KF +1

LENG KF 26

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

PROFIBUS DP

5.1 CPU 41x as DP master / DP slave

S7-400 Automation System, CPU Specifications

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

Diagnostic Addresses in Connection with DP Master Functionality

You assign diagnostic addresses for the PROFIBUS DP in the CPU 41x. Verify in your configuration that the DP diagnostic addresses are assigned once to the DP master and once to the DP slave.

Table 5-12 Diagnostic addresses for the DP master and DP slave

S7 CPU as DP master S7 CPU as DP slave

During configuration of the DP master, specify (in the associated project of the DP master) a diagnostic address for the DP slave. This diagnostic address is identified as assigned to the DP master below.

The DP master uses this diagnostic address to receive information about the status of the DP slave or a bus interruption (see also table "Event detection of the CPUs 41x as DP master").

During configuration of the DP slave, also specify (in the associated project of the DP slave) a diagnostic address that is assigned to the DP slave. This diagnostic address is identified as assigned to the DP slave below.

The DP master uses this diagnostic address to receive information about the status of the DP master or a bus

interruption (see also table "Event detection of the CPUs 41x as DP slave").

Event Detection

The following table shows you how the CPU 41x as DP slave detects any operating mode changes or interruptions in data transfer.

Table 5-13 Event detection of the CPUs 41x as DP slave

Event What happens in the DP slave?

Bus interruption (short-circuit, connector removed)

Calls OB86 with the message Station failure (incoming event;

diagnostic address of the DP slave, assigned to the DP slave)

With I/O access: call of OB 122 (I/O access error)

DP master RUN → STOP • Calls OB82 with the message Module faulty(incoming event;

diagnostic address of the DP slave assigned to the DP slave; tag 2_MDL_STOP=1)

DP master STOP → RUN • OB82 is called with the message Module OK(event exiting state;

diagnostic address of the DP slave that is assigned to the DP slave;

tag OB82_MDL_STOP=0)

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

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

Evaluation in the User Program

The table below shows an example of you how you can evaluate RUN-STOP transitions of the DP master in the DP slave (see also the previous table).

Table 5-14 Evaluating RUNSTOP transitions in the DP Master/DP Slave

In the DP master In the DP slave (CPU 41x)

Diagnostic addresses: (example) Master diagnostic address=1023 Slave diagnostic address in the master system=1022

Diagnostic addresses: (example) Slave diagnostic address=422

Master diagnostic address=not relevant

CPU: RUN → STOP The CPU calls OB82 with at least the following

information:

OB82_MDL_ADDR:=422

OB82_EV_CLASS:=B#16#39 (incoming event)

OB82_MDL_DEFECT:=module fault

Tip: The CPU diagnostic buffer also contains this information

Structure of Slave Diagnostics

Byte 0 Byte 1 Byte 2

Byte 3

Byte 4

Byte 5 Low byte

High byte

Station statuses 1 to 3

Master PROFIBUS address

Manufacturer ID

Module diagnostics

(The length depends on the number of configured address areas in the intermediate memory1)

(The length depends on the number of configured address areas in the intermediate memory) Station diagnosis

1) Exception: In the case of invalid configuration of the DP master, the DP slave interpretes 35 configured address areas (46H).

to to

Figure 5-3 Structure of slave diagnostics

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

PROFIBUS DP

5.1 CPU 41x as DP master / DP slave

S7-400 Automation System, CPU Specifications

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