free quality report for PLCopenXML exports

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

Bad: the rule fires
PROGRAM PumpCtrlVAR    tmrDelay : TON;    xStart : BOOL;    xPump : BOOL;END_VARtmrDelay(IN := xStart, PT := T#0S);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. Set a non-zero delay: tmr(IN := cond, PT := T#5S);
  2. If no delay is needed, remove the timer and act on the condition directly.
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

In-depth article

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