PLC Programming · Lab Manual

Siemens PLC Troubleshooting: Diagnostic Buffer, Cross Reference and Watch Table Lab Manual

Fault finding is a method, not luck. This lab manual prepares a project for diagnosis through all six stages – mapped I/O, diagnostic DB, HMI diagnostics screen – then lets you inject four classic faults and find each with the right tool in the right order.

2,500+ engineers trained 4.9/5 Google rating 21+ years, Chinchwad, Pune Next batch: contact for dates
Quick answer

Work in a fixed order: CPU LEDs, diagnostic buffer, online block and cross reference, watch table, and force only as a last resort – then remove every force. A project built with one input mapping, one output mapping and a diagnostic DB makes each step faster, because every physical signal and every fault has exactly one place.

  • LEDs, then the diagnostic buffer – always.
  • An output that ignores its rung is a double write: use the cross reference.
  • Modify is temporary, force is not: delete every force before leaving.

Work in This Order

StepToolWhat it tells you
1CPU and module LEDsRUN/STOP, ERROR, MAINT (forces) at a glance
2Diagnostic bufferEvery event with timestamp, including why the CPU stopped
3Online block + cross referenceLive logic and every place a tag is written
4Watch tableObserve and modify values
5Force (last resort)Overrides the signal until deleted

Lab Flow: A Project Built to Be Diagnosed

Every lesson in the Softwell PLC lab manual series follows the same six stages and the same address rule, so the code you write here plugs straight into the HMI lessons.

Lab manual flow: field input to tested HMI screenSix stages: field device and PLC tag, input mapping to DB_IO, PLC logic, HMI tags, graphics linking, and perform and test.1Field + tagschannel diag.wire break on2Input mappingone placeper signal3LogicDB_Diagcycle, first-out4HMI tagsDB_Diag_*diagnostics5GraphicsLevel 4 screensystem diag. view6Perform + testSimulator4 injected faultsAddress rule for every lesson: %I only in FC_InputMapping, %Q only in FC_OutputMapping, symbolic DB members everywhere else – including the HMI.
Figure 1 – Six-stage lab flow for this lesson.

Stage 1Hardware and Channel Diagnostics

In device configuration enable wire break and overflow/underflow diagnostics on analog channels and no supply voltage on digital modules where available. These faults then appear in the diagnostic buffer with module and channel, and the ERROR LED shows them.

PLC tagAddressTypeDevice / comment
AI_Ch0%IW96IntAnalog channel with wire-break diagnostics
B80_Door%I8.0BoolDoor switch
K80_Lamp%Q4.1BoolIndicator lamp

Stage 2Input Mapping: One Place per Signal

With all physical addresses in FC_InputMapping and FC_OutputMapping, a watch table on DB_IO shows the whole machine, and the cross reference of any output has exactly one write. This is the structure used in the first lesson and every lesson since.

Stage 3Logic: DB_Diag for the Operator and the Engineer

// DB_Diag: CycleTime_ms, CycleMax_ms : Real; FirstOut : Int; AnyFault : Bool; ForceActive : Bool;
// cycle time: see the scan cycle lesson; first-out: see the interlocks lesson
"DB_Diag".AnyFault := "DB_Alarm".Alarm <> 16#0000;

Cycle time measurement is in the scan cycle lesson, first-out capture in PLC interlocks.

Stage 4Link PLC Tags to the HMI

HMI tagPLC memberUsed by
DB_Diag_CycleTime_ms / _CycleMax_ms"DB_Diag".CycleTime_ms / CycleMax_msDiagnostics fields
DB_Diag_FirstOut"DB_Diag".FirstOutFirst-out text
DB_Alarm_Alarm"DB_Alarm".AlarmAlarm view

Stage 5Link the Graphics: a Level 4 Diagnostics Screen

#ObjectPropertiesTag / event
①System diagnostics viewShows modules and their state from the CPUSystem object
②Output fields cycle timeCurrent and maximumDB_Diag_*
③Symbolic field first-outText list of alarm textsDB_Diag_FirstOut

The Field_Status screen in HMI alarm configuration is a ready-made example of a Level 4 screen.

Stage 6Perform and Test: Diagnose Injected Faults

Inject the four classic faults and find each one with the right tool: CPU LEDs, diagnostic buffer, cross reference, watch table and force list.

CPU and signals
TIA Portal online tools (simplified)
Online & diagnosticsPLC_1
Diagnostic buffer (newest first)

Troubleshooting

SymptomToolTypical finding
ERROR LED flashingDiagnostic bufferWire break on a channel
Output ignores its rungCross referenceSecond write later in the program
MAINT LED onForce tableA forgotten force
CPU in STOPDiagnostic bufferCycle time exceeded, programming error

Hands-On Lab: Diagnose Four Injected Faults

Hands-on
Before you start
  • TIA Portal with an S7-1200 or PLCSIM (some module diagnostics need real hardware)
  • Estimated time: 75 minutes
1

Enable channel diagnostics

In device configuration, enable wire-break diagnostics on analog channels and note module addresses.

Channel diagnostics enabled and documented.
2

Map I/O once

Keep every %I and %Q in the mapping FCs so cross references have one hit.

Every %I and %Q has one cross reference hit.
3

Create DB_Diag

Store cycle time, fault codes and first-out for the HMI.

DB_Diag updates every scan.
4

Link HMI tags

Publish DB_Diag and the alarm word.

HMI shows cycle time and first-out.
5

Build a diagnostics screen

Add system diagnostics view and DB_Diag fields on a Level 4 screen.

The diagnostics screen shows module states.
6

Diagnose injected faults

Inject a wire break, double write, force and cycle-time error and find each with the right tool.

Each injected fault is found with the right tool and all forces are removed.
Checkpoint—how to know you did it right

You find each fault with the right tool in the right order, explain the diagnostic buffer entry, and leave the PLC with no forces active.

Frequently asked questions

Where do I start when a Siemens PLC faults?

The CPU LEDs, then the diagnostic buffer. It timestamps every event the CPU recorded, including the cause of a stop, and it is the step most often skipped.

What is the difference between modify and force?

Modify writes a value that the program can immediately overwrite. Force overrides the signal at the module so the program cannot change it, and it stays active until explicitly removed.

How do I find why an output ignores its logic?

Open cross references for that tag. The output is almost certainly written in a second place later in the program, and the later write wins.

Why does the CPU go to STOP under load?

Usually the cycle monitoring time is exceeded, often by a loop or a heavy calculation. The diagnostic buffer records the time error and its timestamp.

How does the IO mapping structure help troubleshooting?

Every physical signal appears once, in FC_InputMapping or FC_OutputMapping, so one watch table on DB_IO shows the whole machine and the cross reference of any %I or %Q address has exactly one hit.

Can the HMI show PLC diagnostics?

Yes. Comfort panels offer system diagnostics views, and your own DB_Diag values (cycle time, fault codes, first-out) can be shown on a Level 4 diagnostics screen.

Reviewed by Bhawesh Kumar SinghIndustrial Automation Trainer and Industry 4.0 Consultant · Softwell Automation · 21+ years industry experience

Get the full syllabus + free demo class

Share your details—a Softwell training advisor will contact you with batch dates, fees and hardware-practice options.

No spam. Used only to share course details for this enquiry.

Learn with practical industrial examples

Join live online, Pune classroom or corporate in-plant automation training.

Request Course Details
Verified learning pathway

Discuss Siemens PLC Troubleshooting

Explore practical curriculum, software, hardware and batch options for this technology.

Content reviewed: 16 October 2026

Siemens PLC & TIA Portal Learning Path

Continue with the related Siemens PLC tutorials in this practical learning series.

  1. SCL vs Ladder Logic
  2. Upload PLC Program
  3. TIA Selection Tool
  4. Analog Input Scaling
  5. PLC Counters
  6. PLC Timers
  7. Addressing & Data Types
  8. Hardware & PLC Tags
  9. OB, FB, FC & DB
☎ Call WhatsApp ✉ Email Enquire Now