free quality report for PLCopenXML exports

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

Bad: the rule fires
PROGRAM PumpCtrlVAR    tmrDelay : TON;    xStart : BOOL;    xPump : BOOL;END_VARtmrDelay.IN := xStart;tmrDelay.PT := T#5S;xPump := tmrDelay.Q;
Fixed: the rule is silent
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

  1. Call the timer every scan before reading its output: tmr(IN := cond, PT := T#5S); IF tmr.Q THEN …
Check your project

Upload a PLCopen XML or CODESYS .export file: the report is free and the code is not stored.

Local version on GitHub →

The same linter without uploading a file: command line and GitHub Action.

Related rules

2026-11-26

Processing happens in memory, and the uploaded code is not stored. The tool advises; code changes are up to the engineer (see what the linter can't see). What happens to your code → · Rule reference · Your code & privacy · Industry benchmark · Feedback · GitHub