PLC Logic Looks Perfect but Never Runs? Trace the Call Path
- PLC Play Ground
- 0
- Posted on
A routine can exist in a project without executing. Before rewriting correct-looking logic, prove that the running controller reaches it. Start with the scheduled task and follow the program entry point and every routine call.
Original execution-tracing workflow; diagnostics vary by programming environment.
What is happening?
An unscheduled program, missing call, false call condition, or early return can prevent execution. Online tags may retain values from earlier activity even when nothing currently updates them. A project tree shows organization; it is not an execution trace.
Check these five things
-
Confirm the correct controller, online project, and operating mode.
-
Inspect task scheduling and the configured program entry routine.
-
Follow every branch between the entry point and the suspect logic.
-
Use supported execution diagnostics or a reviewed test counter to prove reachability.
-
Check startup, manual, automatic, faulted, and recovery paths separately.
Worked example
A simulated pump routine contains valid permissives, but the main routine calls it only while an obsolete commissioning flag is true. Pump tags retain previous values. Observing the flag and call path explains the frozen behavior without altering the pump interlocks.
Quick diagnostic reference
| Layer | Required evidence |
|---|---|
| Task | Scheduled and enabled |
| Program | Correct entry routine |
| Call | Condition satisfied |
| Routine | Execution observed |
The mistake to avoid
Adding another unconditional call can run stateful logic twice per cycle. Establish the intended architecture before inserting a call merely to make the online screen look active.
How to verify the fix
Demonstrate the intended execution rate in every relevant mode. Confirm that the routine is neither skipped unexpectedly nor invoked twice, and record the call hierarchy with the change documentation.
Field-work boundary: These are educational diagnostic guides. Use the exact equipment manuals and approved site procedures. Electrical testing and machinery changes belong to qualified, authorized personnel; control hazardous energy and validate affected functions before release.
Technical reference
Rockwell Automation: Tasks, Programs, and Routines. The examples and diagnostic tables above are original teaching material; they do not replace the product manual.
