MOULDLKnowledge BaseElectrical Knowledge Base3D Model DownloadsMembership
中文版Model Store »
Knowledge Base › Electrical Knowledge Base › Why can you not set a breakpoint with the debugging tool?
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)(每月更新中)

Why can you not set a breakpoint with the debugging tool?

You want a breakpoint to step through the logic, but it will not set — the icon is grey, it sets but never hits, or setting it drops the connection. The causes are not mysterious; they fall in five classes: platform/model does not support it, wrong online mode, unbreakable code position, task-type limits, and version/licence issues. Work the classes and it resolves in minutes.

1. The cause classes and how to tell them apart

ClassTypical signJudge / handle
Model unsupportedA compact PLC (FX etc.) has no breakpoint menu at allCheck the manual; switch to monitoring + flag tracing
Wrong modeOffline breakpoints are meaningless; monitor mode (not debug mode) refusesEnter the platform's debug / online-edit mode
Position unbreakableCertain network types, comment lines, optimised-away empty rungs refuseMove to a valid instruction line
Task limitsInterrupts / high-speed tasks refuse or stop chaoticallyUse variable-recording there instead
Version / licenceThe whole debug menu is greyUpgrade the software / confirm the licence

First establish whether the model has breakpoints at all: most Mitsubishi FX series lack program breakpoints (monitoring and pulse-chasing instead), Q/iQ-R have them; Siemens S7-1500 has them (with matching firmware and licence), S7-300 partially; CODESYS/TwinCAT generally do. Never force what does not exist.

2. Mode and precondition checklist

PreconditionDetail
Online connection healthyCommunication test passes; in online/debug mode
Project matches the PLC programSome platforms disable breakpoints on mismatch (a comparison is required first)
PLC in a debuggable stateSome platforms need a run-time-debug licence, others STOP
Debug support enabled"Debug support" ticked in project/target settings (TwinCAT: build includes debug info)
Licence covers itFull/professional editions carry complete debugging; entry editions may not

Walk the list — "project mismatch" and "debug support off" are the two most frequent hits.

3. Task-environment limits: interrupts and high-speed tasks

Breakpoints in interrupt programs, motion tasks and high-speed cyclic tasks have a structural problem: halting freezes the whole task's timing, which can trip the watchdog, time out the bus and alarm the servos — so many platforms forbid or restrict breakpoints there. Alternatives: ① variable recording: at the suspect point write key variables into a circular array (a black box), read back after the run; ② Trace/oscilloscope curves to locate; ③ temporarily move the suspect logic into the main task to verify, then move it back.

4. Substitute techniques: debugging without breakpoints

TechniqueMethodFits
Status-flag tracingEach flow step sets a numbered flag; watch the flags to see "how far it got"Flow hunts on breakpoint-less models
Black-box arrayKey variables written into a ring buffer each cycle, read back after faultsSporadic faults, interrupt contexts
Trace / oscilloscopeCurves for timing and value changesProcess-type problems
Binary eliminationShort-circuit half the suspect code with a flag/jump, watch the behaviour changeNarrowing the range
Simulator steppingSimulators usually support full breakpointsLogic questions answered before the machine

The "simulator stepping" route has the best value-for-effort: the breakpoint problem usually does not exist in simulation (full debugging there), so logic doubts are settled before the machine — no breakpoints needed on site.

5. Common problems

SymptomCauseFix
Breakpoint icon greyNot in debug mode / licence insufficientEnter debug mode / upgrade the licence
Set but never hitsThat code path never executes / task not runningConfirm the flow truly reaches it
Bus alarms the moment it stopsBreakpoint froze the task; comms timed outVariable recording instead; no live breakpoints on buses
"Program mismatch" refusedOffline project differs from the PLCRead out / compare first, then debug
Breakpoints forgottenLeftovers download with the programBreakpoint deletion joins the closing checklist

6. Notes

A refused breakpoint is usually not a fault but an unmet environment: model lacks it, mode wrong, task restricted. What to really cultivate is the substitutes — flag tracing, black boxes, Trace — which are often faster even where breakpoints exist (no repeated stop-start). A breakpoint is one tool, not the whole of debugging skill.

7. References

Breakpoint support follows each platform's manual (Mitsubishi GX Works debug-function model table, Siemens S7-1500 debug operations, CODESYS/TwinCAT debugging chapters); task-environment limits and watchdog behaviour follow the task-configuration documentation; debugging safety follows GB 5226.1 / IEC 60204-1 — live debugging must never disable a safety function.

8. Cautions

⚠️ Three traps to avoid:
① Breakpoints on a running bus — the frozen task times out and the whole line alarms;
② Leftover breakpoints downloaded with the program — the machine halts there and "the PLC is dead";
③ Wrestling an unsupported model all afternoon instead of ten minutes of flag tracing.

Add to the closing checklist: confirm zero breakpoints remain (search and delete all).

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