Ext_Diag_Data; EXT_DIAG_DAT   ARRAY \ [1..238] OF BYTE

The six bytes of standard diagnostic data described above have to be supported by each DP slave. Optionally, a DP slave can additionally provide extended diagnostic data. This is the case if a value greater than 6 is assigned to the item Max_Diag_Data_Len in the GSD file of the DP slave. The format of the extended diagnosis is defined by the standard. Since the extended diagnostic data are not static on the one side and can contain manufacturer-specific entries on the other side, no automatic data evaluation can be performed by the Function Block DM_SLV_DIAG.

The evaluation of extended diagnostic data must be performed by the user with the aid of the GSD file for the particular DP slave and the description of the general data format given below.

The extended diagnostic data are divided into three parts (sections):

  • device-related diagnosis
  • module-related diagnosis
  • channel-related diagnosis

Device-related diagnosis

The device-related diagnosis section contains general diagnostic information, such as overtemperature or undervoltage. This section starts with a header byte, the highest two bits of which are permanently set to 00. The lower six bits indicate the length of the following Function Block, including the header byte itself.

0 0 L e n g t h
7 6 5 4 3 2 1 0

The device-related diagnostic data are defined by the manufacturer. For detailed information about their meaning please refer to the particular device documentation.

Module-related diagnosis

The module-related diagnosis section contains diagnostic information, which can be assigned directly to the particular I/O modules of the device. This section containing the module-related diagnosis starts with a header byte, the highest two bits of which are permanently set to 01. The lower six bits indicate the length of the following Function Block, including the header byte itself.

0 1 L e n g t h
7 6 5 4 3 2 1 0

In the following Function Block, one single bit is assigned to each module. The module index is represented by the bit offset within the Function Block (please refer to the example). A bit which is set to TRUE means that diagnosis is required for the related I/O module.

Channel-related diagnosis

In the channel-related diagnosis section, the diagnosed channels and the cause for the diagnosis are entered in sequence. Each entry consists of three bytes and starts with a header byte, the highest two bits of which are permanently set to 10. The lower six bits contain the index of the module for which the following diagnosis was made.

1 0 M o d u l e
7 6 5 4 3 2 1 0

The lower six bits of the following byte contain the number of the channel which reports a diagnosis. The highest two bits indicate whether the specific channel is an input channel, an output channel or an I/O channel.

I O C h a n n l
7 6 5 4 3 2 1 0

The direction identifier in the bits 6 and 7 is encoded as follows:

0 0 Reserved
0 1 Input
1 0 Output
1 1 Input / Output

The third byte of each entry contains the channel type in its upper three bits and the error type in the lower five bits.

C h n E r r o r
7 6 5 4 3 2 1 0

The channel type (channel width) is encoded as follows:

0 0 0 Reserved
0 0 1 Bit
0 1 0 2 Bit
0 1 1 4 Bit
1 0 0 Byte
1 0 1 Word
1 1 0 2 Word
1 1 1 Reserved

The encoding of the error type is as follows:

0 Reserved 0 0 0 0 0
1 Short circuit 0 0 0 0 1
2 Undervoltage 0 0 0 1 0
3 Overvoltage 0 0 0 1 1
4 Overload 0 0 1 0 0
5 Overtemperature 0 0 1 0 1
6 Cable brake 0 0 1 1 0
7 Upper limit exceeded 0 0 1 1 1
8 Lower limit exceeded 0 1 0 0 0
9 Error 0 1 0 0 1
10 Reserved 0 1 0 1 0
: : 0 1 x x x
15 Reserved 0 1 1 1 1
16 Manufacturer-specific 1 0 0 0 0
: : 1 x x x x
31 Manufacturer-specific 1 1 1 1 1

The valid length of the complete extended diagnostic data is indicated at output EXT_DIAG_LEN of the Function Block DPM_SLV_DIAG. When evaluating the diagnosis, only data have to be considered which are contained in the range EXT_DIAG_DAT[1] to EXT_DIAG_DAT[EXT_DIAG_LEN].