Individual diagnostic data

The controller enables sending of diagnostic data from the PLC. You can write your own diagnostic message for the master and fill it individually with data (see Device-specific diagnostic data below).

DP Diagnostic Data (DiagData)

Individual diagnostic data 1:

Transmission of the diagnostic telegram

A diagnostic telegram is only transferred to the controller when the diagnostic data have changed.

The DP diagnostic data consists of 6 bytes of DP standard diagnosis, along with up to 238 bytes of device-specific diagnostic data.

When the DP diagnostic data changes, the slave reports this fact to the master, and the master will automatically fetch the changed diagnostic data. This means that DP diagnostic data is not included in the DP process data in real-time, but is always sent to the controller a few cycles later.

In TwinCAT the DP diagnostic data are read by the DP master connection via ADS

DP standard diagnostic data

Offset

Meaning

0x00.0

StationNonExistent: Slave did not respond to the last telegram

0x00.1

StationNotReady: Slave is still processing the Set_Prm or Chk_Cfg telegram

0x00.2

CfgFault: Slave reports a configuration error

0x00.3

ExtDiag: Extended DiagData are available and valid

0x00.4

NotSupported: Slave does not support a feature that was requested with Set_Prm or Global_Control

0x00.5

InvalidSlaveResponse: Slave does not respond in accordance with DP

0x00.6

PrmFault: Slave reports a parameterization error

0x00.7

MasterLock: Slave is exchanging data with another master

0x01.0

PrmReq: Slave must be re-parameterized and reconfigured

0x01.1

StatDiag: Slave reports static diagnosis or application of DPV1 slave not yet ready for data exchange

0x01.2

PROFIBUS DP slave

0x01.3

WdOn: DP watchdog is switched on

0x01.4

FreezeMode: DP slave is in freeze mode

0x01.5

SyncMode: DP slave is 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 DiagData available

0x03

MasterAdd: Address of the master that exchanges data with the slave

0x04,0x05  

IdentNumber

from 0x06  

Device-specific diagnostic data (Extended DiagData)

Device-specific diagnostic data

Individual diagnostic data 2:

Transmission of user-specific diagnostic data

Byte[0] of the data must contain 0x08. Byte [1..5] are overwritten by the CX. You can enter your own diagnostic data from byte 6. Ensure that your own diagnostic data complies with the PROFIBUS standard for user-specific diagnostics.

The ADSWRITE function block is used for sending diagnostic data. The current DP diagnostics as sent to the bus can be read via ADSREAD. When reading, make sure that you take 6 bytes (the PROFIBUS standard DP diagnostics) into account, i.e. read 6 bytes more than you have written. The ADS parameters are identical to reading.

Input parameters

Description

NETID

local NetId of the Profibus device

PORT number

0x1000+slave address

IDXGRP

16#F481

IDXOFFS

0

LEN

max. 244

SRCADDR

Pointer to diagnostic data