• 沒有找到結果。

Station status 1 to 3

Station status 1 to 3 provides an overview of the status of a DP slave.

Table 5-15 Structure of station status 1 (Byte 0)

Bit Meaning Remedy

0 1:The DP slave cannot be addressed by the DP

master. Correct DP address set on the DP slave?

Bus connector connected?

Voltage at DP slave?

RS-485 repeater set correctly?

Execute reset on the DP slave 1 1:The DP slave is not yet ready for data exchange. • Wait while the DP slave powers up.

2 1:The configuration data sent by the DP master to the DP slave does not match the configuration of the DP slave.

Correct station type or correct configuration of the DP slave entered in the software?

3 1:Diagnostic interrupt, triggered by RUN-STOP change on the CPU

0:Diagnostic interrupt, triggered by STOP-RUN change on the CPU

You can read the diagnostic information.

4 1:Function is not supported, e.g. changing the DP

address via software Check the configuration.

5 0:The bit is always "0". 6 1:The DP slave type does not correspond to the

software configuration. Correct station type entered in the software? (Parameter assignment error)

7 1:Parameters have been assigned to the DP slave by a different DP master to the one that currently has access to the DP slave.

The bit is always 1, for example, if you access the DP slave with the programming device or another DP master.

The DP address of the parameter assignment master is in the "master PROFIBUS address" diagnostic byte.

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

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

Table 5-16 Structure of station status 2 (Byte 1)

Bit Meaning

0 1:The DP slave must be assigned new parameters and reconfigured.

1 1:There is a diagnostic message pending. The DP slave cannot continue until the problem has been eliminated (static diagnostic message).

2 1:The bit is always set to "1" if the DP slave with this DP address is present.

3 1:Watchdog monitoring is enabled for this DP slave.

4 0:The bit is always set to "0".

5 0:The bit is always set to "0".

6 0:The bit is always set to "0".

7 1:The DP slave is disabled; in other words, it has been removed from cyclic processing.

Table 5-17 Structure of station status 3 (Byte 2)

Bit Meaning

0 to 6

0:The bits are always set to "0".

7 1: • There are more diagnostic messages than the DP slave can store.

The DP master cannot enter all the diagnostic messages sent by the DP slave in its diagnostic buffer.

Master PROFIBUS Address

The master PROFIBUS address diagnostic byte contains the DP address of the DP master that:

• Assigned parameters to the DP slave and

• has read and write access to the DP slave

Table 5-18 Structure of the master PROFIBUS address (byte 3)

Bit Meaning

DP address of the DP master that configured the DP slave and that has read and write access to the DP slave.

0 to 7

FFH: DP slave has not been assigned parameters by any DP master.

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

PROFIBUS DP

5.1 CPU 41x as DP master / DP slave

S7-400 Automation System, CPU Specifications

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

Identifier-related diagnostics

The ID-related diagnostic data tells you for which of the configured address areas of the transfer memory an entry has been made.

Byte 6

Length of the module diagnosis including byte 6 (depends on the number of configured address areas up to 6 bytes)

Code for module diagnosis Bit no.

Set 0 actual configuration

Set 0 actual configuration and slave CPU in STOP Set 0 actual configuration

Entry for 1st configured address area Entry for 2nd configured address area Entry for 3rd configured address area Entry for 4th configured address area Entry for 5th configured address area

Bit no.

Entry for 6th to 13th configured address area

Entry for 14th to 21st configured address area Bit no.

Bit no.

Bit no.

Entry for 22nd to 29th configured address area

Entry for 30th configured address area Entry for 31st configured address area Entry for 32nd configured address area

Figure 5-4 Structure of the ID-related diagnostic data of the CPU 41x

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

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

Device-Related Diagnostics

Device-related diagnostics provides detailed information about a DP slave. Device-related diagnostics starts at byte x and can include up to 20 bytes.

The figure below illustrates the structure and contents of the bytes for a configured address area of the transfer memory.

Byte x +1

Length of the station diagnosis incl. byte x (=

maximum 20 bytes) Code for station diagnosis

01H: Code for diagnostic interrupt 02H Code for process interrupt Number of the configured address area of the intermediate memoryThe following applies:

General rule: Number+3 (Example: CPU = 02H 1st. adress area = 04H

2nd Address area = 05H and so on)

(Fixed to 0)

Diagnostics data and

interrupt data Figure 5-5 Structure of the device-related diagnostics

Starting at byte x +4

The meaning of the bytes starting at byte x+4 depends on byte x +1 (see figure "Structure of device-related diagnostics").

In byte x +1, the code stands for...

Diagnostic interrupt (01H) Hardware interrupt (02H) The diagnostic data contains the 16 bytes of status

information of the CPU. The figure below shows the allocation of the first four bytes of diagnostic data. The following 12 bytes are always 0.

You can program 4 bytes of interrupt information any way you wish for the process interrupt. You transfer these 4 bytes to the DP master in STEP 7 using SFC7 "DP_PRAL".

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

PROFIBUS DP

5.1 CPU 41x as DP master / DP slave

S7-400 Automation System, CPU Specifications

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

Bytes x +4 to x +7 for Diagnostic Interrupts

The following figure illustrates the structure and content of bytes x +4 to x +7 for the diagnostic interrupt. The data in these bytes correspond to the contents of data record 0 of the diagnostic data in STEP 7 (not all bits are used in this case).

Byte x +4

Identifier for address area of the Intermediate memory (constant)

0: RUND mode 1: STOP mode

Figure 5-6 Bytes x +4 to x +7 for diagnostic and hardware interrupts

Interrupts with the S7 DP Master

In the CPU 41x as a DP slave you can trigger a process interrupt in the DP master from the user program. You can trigger an OB40 in the user program of the DP master by calling SFC7 "DP_PRAL". Using SFC7, you can forward interrupt information in a double word to the DP master and evaluate it in OB40 in the OB40_POINT_ADDR variable. You can program the interrupt information as required.. You will find a detailed description of SFC7

"DP_PRAL" in the System Software for S7-300/400, System and Standard Functions reference manual.

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

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

Interrupts with a Different DP Master

If you are using the CPU 41x with a different DP master, these interrupts are simulated in the device-related diagnostic data of the CPU 41x. You will have to process the relevant

diagnostic events in the DP master's user program.

Note

Note the following in order to be able to evaluate diagnostic interrupts and hardware interrupts using device-related diagnostics when using a different DP master:

• the DP master should be able to save the diagnostic messages, i.e. the diagnostic messages should be stored within the DP master in a ring buffer. If there are more diagnostic messages than the DP master can store, then, for example, only the last diagnostic message received would be available for evaluation.

• You must scan the relevant bits in the device-related diagnostic data in your user program at regular intervals. You must also take the PROFIBUS DP bus cycle time into consideration so that, for example, you can query the bits at least once synchronized with the bus cycle time.

• With an IM 308-C operating in DP master mode, you cannot utilize process interrupts in device-specific diagnostics, because only incoming events are reported, rather than outgoing events.