Rules / uncalled-timer
TON in CODESYS never fires: the timer instance is not called every scan
A timer only counts when the instance is called: tmr(IN := ..., PT := ...). If the code just writes tmr.IN and reads tmr.Q without a call, the output stays FALSE forever. The same applies to R_TRIG, F_TRIG and counters.
Severity: Critical
Rule id: uncalled-timer
Uncalled timer/trigger
What the rule checks
A timer/trigger instance is read (.Q/.ET) or written (.IN), but the FB itself is never called name(...), so it never ticks, the output stays in its initial state.
What it does to the plant
A delay, a start pause or a time-based trip never happens: the pump does not start after the pause and the timed alarm never latches.
Example
PROGRAM PumpCtrlVAR tmrDelay : TON; xStart : BOOL; xPump : BOOL;END_VARtmrDelay.IN := xStart;tmrDelay.PT := T#5S;xPump := tmrDelay.Q;
PROGRAM PumpCtrlVAR tmrDelay : TON; xStart : BOOL; xPump : BOOL;END_VARtmrDelay(IN := xStart, PT := T#5S);xPump := tmrDelay.Q;
Both listings are run through the linter by an automated test: the rule fires on the first and stays silent on the second.
How to fix
- Call the timer every scan before reading its output:
tmr(IN := cond, PT := T#5S); IF tmr.Q THEN …
Upload a PLCopen XML or CODESYS .export file: the report is free and the code is not stored.
The same linter without uploading a file: command line and GitHub Action.
Related rules
2026-11-26