MOULDLKnowledge BaseElectrical Knowledge Base3D Model DownloadsMembership
中文版Model Store »
Knowledge Base › Electrical Knowledge Base › How do you read diagnostic data from a DP slave in TIA Portal?
HomeModels
Table of contents

On this page

PLC & Programming (100 articles)

Quick Reference

  • PLC & Programming
  • Electrical & Electronic Basics (monthly)(每月更新中)
  • Electrical Control & Drawings (monthly)(每月更新中)
  • Drives & Actuators (monthly)(每月更新中)
  • Sensors & Detection (monthly)(每月更新中)
  • Industrial Communication & Networks (monthly)(每月更新中)
  • HMI & Host Systems (monthly)(每月更新中)
  • Industrial Robots & Motion Control (monthly)(每月更新中)
  • Mechatronic System Integration (monthly)(每月更新中)
  • Fault Diagnosis & Standards (monthly)(每月更新中)

How do you read diagnostic data from a DP slave in TIA Portal?

When a PROFIBUS DP slave misbehaves, the slave itself often only drops off the bus or flashes a red LED, and the real cause has to be found in the diagnostic data. Reading DP slave diagnostics in TIA Portal means reaching the diagnostic frame the slave reports, through system diagnostics or diagnostic instructions, and translating it into device-level, module-level or channel-level fault information.

There are several layers of diagnostics

DP diagnostics run from coarse to fine in three layers. Device level states whether the slave as a whole is available, for example a broken cable or a dropped station. Module level states which module or slot is at fault. Channel level goes down to a single channel, for example one input shorted, broken or over-range. When troubleshooting, check first that communication at device level is sound, then locate the slot at module level, and only then look at channel level — this order pins the scope down fastest.

What system diagnostics show directly

In the device view and the online diagnostics of TIA Portal you can see the slave's communication status, module status and some diagnostic information directly, and standardised diagnostic data is even given a text explanation. This is intuitive and good for quickly judging whether this is where the problem lies. It only shows the parts already interpreted from the configuration, though; vendor-specific diagnostics usually have to be read another way.

Reading the frame with diagnostic instructions

Reading slave diagnostics from the program usually means a system function block or diagnostic instruction that reads the individual bytes of the standard diagnostic frame. That frame has a fixed structure: address and station status and similar common information first, then bit-coded error types, and the vendor-specific part after that. The bytes read must be parsed by structure, not taken as one integer.

How to interpret the station status bits

The frame contains a number of status bits. The common ones indicate that the station is not present or not ready, that a diagnostic frame has arrived, a parameterisation error, a configuration error, or that the slave requires re-parameterisation. The bits differ in priority: some point to a communication-layer problem, others to a configuration mismatch. Grouping the bits by meaning is easier to learn than memorising each one, and lets you decide faster whether to reset or to check the configuration.

Combining the online view with program alarms

Diagnostics can be read by eye in the TIA Portal online view, or read cyclically by the program to raise alarms. In practice the two go together: the online view for quick confirmation during commissioning, program alarms for putting faults onto the HMI and into the record at run time. Diagnostic information read by the program has to be displayed on the HMI, otherwise only an engineer standing at the panel sees it while the machine runs.

Common diagnostic bits, their meaning and the usual action

Diagnostic informationLayerMeaningUsual action
Station not presentDeviceSlave offline or unpoweredCheck supply, bus connector and terminating resistor
Slave not readyDeviceSlave power-up not completeWait, or check the slave self-test
Diagnostic frame arrivedDeviceNew diagnostics waitingRead and parse the frame
Parameterisation errorDeviceDownloaded parameters rejectedCross-check parameters and firmware version
Configuration mismatchDeviceActual setup differs from the configurationCompare module types and slots
Re-parameterisation requiredDeviceSlave asks for parameters againRun re-parameterisation
Module faultModuleA slot module reports an errorLocate the slot, then replace or check wiring
Channel wire breakChannelOpen circuit on a channelCheck that channel's wiring and sensor
Channel over-rangeChannelSignal beyond the rangeCheck the range and sensor specification

Notes

When reading diagnostics, separate "standard diagnostics", which parse by a uniform structure, from "vendor-specific diagnostics", which need the maker's documentation. Reading diagnostics cyclically consumes communication load, so the read cycle need not be fast; refining the read when an alarm occurs is more economical. Bus faults and slave faults sometimes appear together: restore communication first, then look at the remaining diagnostics, so that slave hardware is not misjudged while the bus is still unhealthy.

References

The PROFIBUS DP protocol and diagnostic frame structure follow the GB/T 20540 series (equivalent to the PROFIBUS DP specification); the fieldbus architecture follows the IEC 61158 and IEC 61784 series; the programming conventions for PLC programs and diagnostic function blocks follow GB/T 15969.3 (identical to IEC 61131-3); the electrical connection, protection and earthing of the equipment follow GB 5226.1 and the equivalent international standard IEC 60204-1.

Points to watch

⚠️ Three common traps:
(1) Reading the diagnostic frame bytes as one whole value, so every bit meaning is out of place;
(2) Looking at diagnostics online only and not raising a program alarm, so no one knows when the fault occurs at run time;
(3) Concluding at once that the slave is faulty on a communication error, without first checking the bus connectors, terminating resistors and screening.

Stop the machine, isolate, prove dead and apply lock-out/tag-out before checking the bus or slaves. Both terminating resistors at the ends of a PROFIBUS segment must be correctly engaged, and connectors must not be plugged or unplugged under power, to avoid damaging the transceivers.

Related reading

Related 3D models: Ready to build it? Download free 3D models & CAD drawings at MOULDL »
MOULDL · Electrical Knowledge Base · free self-study reference for electrical & automation engineers, 3D CAD models at MOULDL