engineering

PLC Troubleshooting: Narrow Down Systematically Instead of Guessing

How to troubleshoot PLC programs: rule out hardware first, narrow down with watch tables and cross-references, recognise the common fault classes — and why forcing is rarely the answer.

David Prybisch
9 min read
PLC Troubleshooting: Narrow Down Systematically Instead of Guessing

1.Why trial and error is the most expensive route

A plant is down. Production is waiting, the phone is ringing, and TIA Portal is showing you a program that was running yesterday. The reflex in that situation is almost always the same: look somewhere you suspect the fault.

That is precisely the most expensive route. Not because guesses are inherently wrong – but because a refuted guess leaves nothing behind. You know no more than before and have lost twenty minutes. After the fifth guess an hour is gone and the pressure has risen.

Systematic narrowing works the other way round: every step halves the search space, regardless of whether the assumption held. A negative result is still a result.

2.The sequence that holds up under pressure

Every efficient troubleshooting session follows the same chain:

Symptom → hardware or software? → affected block → signal path → cause

The first step is the one most often skipped – and the one that then costs most.

2.1.Step 1: Rule out hardware before you look at code

The CPU diagnostic buffer is the first place to look during any fault, not the last. It logs module failures, peripheral errors, STOP causes and cycle time errors with timestamps. If it shows a module failure, searching the program code is pure waste.

In addition: the LEDs on the CPU and peripherals say in seconds what the code will not reveal in minutes. A red SF LED on an ET 200 ends the discussion about program logic.

2.2.Step 2: Find the responsible block

State the symptom as concretely as possible: not "the plant isn't working" but "conveyor 3 does not start after the start command, fault message appears after 5 seconds".

From that phrasing the block follows almost by itself – provided the program is cleanly structured. If every plant section is encapsulated in its own, meaningfully named function block, you know immediately where to look. If everything is wired into OB1, this is where the laborious part begins.

2.3.Step 3: Trace the signal path backwards

Take the output that is not switching and work back to its conditions. Which interlock prevents it from being set? Which of those partial conditions is false? And why?

This backwards walk is the core of the method. It always ends at one of three points: an input condition that never arrives (hardware or upstream logic), an interlock that is engaging (usually intentionally), or an assignment being overwritten from elsewhere.

3.The TIA Portal tools

ToolWhat it is good forTypical use
Watch tableRead live values without disturbing the processThe standard tool. Collect the suspect block's signals and observe them running
Cross-referencesWhere is a tag written, where read?First remedy against double assignments and orphaned blocks
Call structureIs the block being called cyclically at all?When a block "does nothing" although the logic is correct
Diagnostic bufferHardware events with timestampsAlways first. Settles hardware vs. software in seconds
Online/offline comparisonDoes the CPU deviate from the documented state?Uncovers undocumented changes "from last night shift"
PLCSIMReproduce logic without the plantFor reproducible faults and safely playing through variants

3.1.Forcing: the tool you almost never need

Forcing overwrites physical inputs and outputs and stays active until explicitly cleared – across a CPU restart too. On a running plant with moving axes that is a safety risk, not a diagnostic tool.

For pure observation the watch table is enough. If you genuinely have to set a value, do it deliberately, documented, and with a colleague watching the plant – and clear it before you leave. A forgotten force is a time bomb that goes off at the next startup, when nobody remembers it was set.

4.Five fault classes that account for most cases

4.1.1. Double assignments

The same tag is written in two blocks. In the cyclic sequence the last processed assignment "wins" – the output flickers or stubbornly stays at one value although the visible logic says otherwise.

Detection: cross-references. Any tag with more than one writing location is suspect.

4.2.2. Edge detection faults

An action fires continuously instead of once, or not at all. The cause is usually a missing rising edge (R_TRIG) or an edge memory bit used in several places – the first evaluation consumes the edge and the second never sees one.

Detection: watch table on the edge memory bit plus cross-references to it.

4.3.3. Timing and cycle problems

A timer whose start condition is reset within the same cycle never expires. Conversely, excessive cycle times trigger the cycle time error OB (OB80) – visible in the diagnostic buffer.

Detection: check cycle time in the CPU diagnostics, observe the timer input in the watch table.

4.4.4. Data block mix-ups

With multiply instantiated function blocks, the wrong instance DB is passed. The logic is correct, but drive 2 reacts to drive 1's values.

Detection: look at the call structure – which block receives which DB?

4.5.5. Hardware disguised as software

A wobbling proximity switch, a cable break in the drag chain area, a module with sporadic dropout. The symptom is visible in the program, the cause is not.

Detection: sporadic behaviour is the warning sign. A fault that cannot be reproduced rarely lies in the logic – logic is deterministic.

5.When the plant is down: the sequence under pressure

When production is waiting, a fixed sequence helps more than intuition:

  1. Read the diagnostic buffer. 30 seconds, settles hardware vs. software.
  2. State the symptom precisely. What exactly does not happen, since when, under which conditions?
  3. Ask about the last change. "It ran yesterday" is the single most valuable piece of information – the online/offline comparison shows whether anyone touched anything.
  4. Build a watch table for the suspect area instead of clicking through networks.
  5. Work backwards from the output to the conditions.
  6. Document the finding before releasing the plant again – otherwise the whole search repeats next time.

Point 6 is almost always dropped under pressure and is the only one that prevents the same search starting from scratch in three months.

6.Clean code is diagnostic infrastructure

Most of the points above presuppose something: a clear block structure, meaningful names, a commented symbol table. That is not an end in itself and not a question of aesthetics.

A program in which every plant section is encapsulated and named turns hours of guesswork into minutes of targeted narrowing. A commented block tells you at a glance what it is supposed to do – and therefore where it deviates. A block full of M0.0 and DB1.DBX0.0 tells you nothing, and troubleshooting starts from zero.

7.Conclusion

Troubleshooting is method, not talent. Three things carry most of it:

  • Rule out hardware first – the diagnostic buffer answers in 30 seconds whether searching the code makes sense at all.
  • Work backwards from the symptom rather than forwards from a guess – every step shrinks the search space, even when the assumption was wrong.
  • Reproducible or sporadic? – this distinction separates software from hardware and timing problems before you open the first network.

8.Further reading

Tags

FehlersucheSPS-ProgrammierungStörungsanalyseTIA PortalDiagnosepufferBeobachtungstabelleQuerverweisePLCSIMInstandhaltungAnlagenstillstandDebuggingS7-1500DoppelzuweisungFlankenauswertung

Questions about your automation project?

As an automation engineer based in Stadtbredimus, Luxembourg, I offer free initial consultations for companies in the Greater Region Saar-Lor-Lux.

David Prybisch · PLC · HMI · Commissioning

Related Articles

Frequently Asked Questions

How do I troubleshoot a PLC program?

In a fixed sequence: read the CPU diagnostic buffer to rule out hardware; state the symptom precisely; identify the responsible block; trace the signal path backwards from the output that is not switching to its conditions. Every step shrinks the search space — unlike a refuted guess, which leaves nothing behind.

How do I tell hardware faults from software faults?

The CPU diagnostic buffer is the fastest route: it logs module failures, peripheral errors and STOP causes with timestamps. In addition, the rule of thumb is that reproducible faults are usually software and sporadic faults are usually hardware or timing — logic is deterministic and does not behave differently from one run to the next.

Which TIA Portal tools help with troubleshooting?

Watch tables for reading live values without disturbing the process, cross-references to find every writing and reading location of a tag, the call structure to check whether a block is called cyclically, the diagnostic buffer for hardware events, the online/offline comparison for undocumented changes, and PLCSIM for safe reproduction.

Why should I be careful with forcing?

Forcing overwrites physical inputs and outputs and stays active until explicitly cleared — across a CPU restart too. On running plants with moving axes that is a safety risk. For pure observation the watch table is enough; a forgotten force takes effect at the next startup, when nobody remembers it was set.

What is a double assignment and how do I find it?

A double assignment occurs when the same tag is written in two blocks. In the cyclic sequence the last processed assignment prevails, so an output flickers or stays at one value despite apparently correct logic. It is found via cross-references: any tag with more than one writing location is suspect.

Why does my action fire continuously instead of once?

That is the classic edge detection fault. Either the rising edge (R_TRIG) is missing, so the condition is true again every cycle, or an edge memory bit is evaluated in several places — the first evaluation consumes the edge and the second never sees one. A watch table on the memory bit plus cross-references settles it.

What do I do when the plant is down and production is waiting?

A fixed sequence rather than intuition: read the diagnostic buffer, state the symptom precisely, ask about the last change and check it with the online/offline comparison, build a watch table for the suspect area, work backwards from the output — and document the finding before releasing the plant again.