Slave-Diagnose
DP-State
Each DP slave has a status variable that indicates the current state of that DP slave. This status is maintained in real time, so that it is always adapted to the current DP slave data, and can be linked to a PLC variable (-> DpState of the slave):
Diagnostic data
Any DP slave can acyclically report DP diagnostic data during data exchange operation. The slave here sets the Diag_Flag in the response to the cyclic Data_Exchange telegram, as a result of which the DP master automatically reads the DP diagnostic data from the slave. This does not affect the Data-Exchange cycle in the Beckhoff DP master, because the DP diagnostic telegram is sent at the end of the cyclic Data-Exchange cycle, and before the beginning of the next cycle. If the DP diagnostic data read from the slave has changed from its previous state, the DP master sets the ExtDiagFlag variable, which can be linked to a variable in the controller program.
The DP slave's current diagnostic data is displayed in the system manager on the slave's Diag tab. It can also be read by the controller program via ADS, which will cause the "ExtDiagFlag" flag to be reset once more:
ADS-Read parameters | Meaning |
---|---|
Net-ID | Net-ID of the master (see the device's ADS tab) |
Port | 200 |
IndexGroup | 0x00yyF181 (yy = station address of the slave) |
IndexOffset | Offset within the diagnosis data |
Length | Length of the diagnostic data that is to be read |
Data | Diagnostic data |
The diagnostic data contains the slave statistics (32 bytes) and the DP diagnostic data sent by the slave (up to 244 bytes), and is constructed as follows:
Offset | Meaning |
---|---|
Slave statistics | |
0 | Receive Error Counter (WORD): The number of faulty telegrams occurring while communicating with this slave. |
2 | Repeat counter[8] (WORD): The repeat counters indicate how many repeats have had to be made, and how often. Repeat Counter[0] indicates how often it has been necessary to repeat a telegram for this slave once, Repeat Counter[1] shows how often a telegram for this slave has had to be repeated twice, and so on. The maximum number of retries is set with the parameter Max Retry Limit (see Bus parameters dialog). The value range is from 0 to 8, therefore there are 8 repeat counters (for 1 to 8 retries) |
18 | reserved for extensions |
20 | NoAnswer Counter (DWORD): The number of telegrams in communication with this slave that have not received an answer. The first time that a slave fails to answer, the telegram is repeated up to MaxRetryLimit times, but if it does not answer even then, further telegrams are not repeated. |
24-27 | Last-DPV1-Error[4] (BYTE): The most recent faulty DPV1 response is entered here (byte 0: DPV1 service (bit 7 is set, thus indicating an error), byte 1: Error_Decode, byte 2: Error_Code_1 (Error_Class/Error_Code), byte 3: Error_Code_2), see description of the DPV1 error codes |
27-31 | reserved for extensions |
from 32 | DP diagnostic data |
There follows a description of the DP diagnostic data
Offset | Meaning |
---|---|
0x00.0 | StationNonExistent: slave did not reply to the last telegram |
0x00.1 | StationNotReady: slave still processing the Set_Prm / Chk_Cfg telegram |
0x00.2 | CfgFault: slave signaling a configuration error |
0x00.3 | ExtDiag: extended DiagData available and valid |
0x00.4 | NotSupported: slave does not support a feature requested via Set_Prm or Global_Control |
0x00.5 | InvalidSlaveResponse: slave response not DP-compatible |
0x00.6 | PrmFault: slave reports a paramétrisation error |
0x00.7 | MasterLock: slave currently exchanging data with another master |
0x01.0 | PrmReq: re-parameterize and reconfigure slave |
0x01.1 | StatDiag: slave signaling static diagnosis / DPV1 slave application not yet ready for data exchange |
0x01.2 | PROFIBUS DP slave |
0x01.3 | WdOn: DP watchdog on |
0x01.4 | FreezeMode: DP slave in freeze mode |
0x01.5 | SyncMode: DP slave in sync mode |
0x01.6 | reserved |
0x01.7 | Deactivated: DP slave has been deactivated |
0x02.0 | reserved |
0x02.1 | reserved |
0x02.2 | reserved |
0x02.3 | reserved |
0x02.4 | reserved |
0x02.5 | reserved |
0x02.6 | reserved |
0x02.7 | ExtDiagOverflow: too much extended data present |
0x03 | MasterAdd: station address of master with which slave is exchanging data |
0x04,0x05 | IdentNumber |
ab 0x06 | Extended DiagData |
Extended DiagData
A distinction is made in the Extended DiagData between identification diagnosis, channel diagnosis and manufacturer-specific diagnosis. The first byte indicates the type of the diagnosis and the length of the associated data. Several diagnostic types can also follow one another in the Extended DiagData.
Header-Byte
Bit | Meaning |
---|---|
0-5 | Length of the associated diagnostic data, including header byte |
6-7 | 0 = manufacturer-specific diagnosis (DPV1 is not supported) or DPV1 diagnosis (DPV1 is supported (DPV1_Enable = 1) in associated GSD file) |
Module diagnosis | |
Channel diagnosis | |
Revision number |
Manufacturer-specific diagnosis
The structure of the manufacturer-specific diagnosis may be found in the documentation for the DP slave.