Rules / timer-zero-pt
Timer with PT := T#0S: there is no delay
The time preset is zero, so the timer fires in the same scan the input rises. Usually it is a forgotten or mistaken preset.
Severity: Warning
Rule id: timer-zero-pt
Timer with zero delay (PT := T#0)
What the rule checks
PT is set to zero (T#0S), so the timer fires in the same scan, effectively no delay. Usually a forgotten or wrong time setpoint.
What it does to the plant
The delay the timer was added for does not exist: pumps change over without a pause and an alarm trips on the first contact bounce.
Example
PROGRAM PumpCtrlVAR tmrDelay : TON; xStart : BOOL; xPump : BOOL;END_VARtmrDelay(IN := xStart, PT := T#0S);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
- Set a non-zero delay:
tmr(IN := cond, PT := T#5S); - If no delay is needed, remove the timer and act on the condition directly.
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
In-depth article
2026-11-26