CODESYS Β· Track 09 Β· debug like a software engineer

Real Breakpoints

Most PLC tools only let you watch values. CODESYS goes further: set a breakpoint on a line and the controller halts there, mid-scan, so you can single-step the logic and inspect every variable β€” just like debugging software. Click in the gutter to drop a breakpoint, then step through this fill-control routine.

πŸ”΄ breakpointsπŸ‘£ step into/overπŸ“ˆ trace
01 Β· Halt, step, inspect

Stop the PLC on a line

Click a line's gutter to set a breakpoint (red dot). Press β–Ά Run to BP and execution halts there β€” the controller is genuinely paused on that line. Then ⏭ Step through, watching the variables on the right change as each statement runs. This is the debugger PLC programmers coming from software actually expect.

β–Έ watch (inline monitoring)

Set a breakpoint, then β€œRun to BP”.
debug halted: β€”

⚠️ Breakpoints halt the real controller β€” fine on a test bench, dangerous on live machinery (outputs freeze where they are). For running plant you use the non-intrusive Trace recorder instead: it samples chosen variables at the task rate and plots them like a scope, without ever stopping the scan.

02 Β· The debug toolkit

Four ways to see in

πŸ‘οΈ Inline monitoring β€” live values appear right beside the code/variables while online. The everyday view.

πŸ”΄ Breakpoints & stepping β€” halt on a line, step into/over/out, inspect the call stack. Software-grade debugging β€” for the bench.

πŸ“ˆ Trace β€” sample variables at task rate and plot them; catch a glitch too fast for the eye, without stopping the controller.

✊ Write & force β€” prepare a value and write it once, or force it held; plus the device log for events and errors.

03 Β· Check yourself

On a live machine?

A line is in production and you must capture a fast intermittent glitch without stopping it. Which tool?