Rules / dead-pou
A POU nobody calls: dead code in a CODESYS project
A program or function block exists in the project but nothing calls it or uses it as a type. It is either a forgotten old version or a typo in a call name, so a different block runs instead.
Severity: Minor
Rule id: dead-pou
Dead code: a POU nobody calls
What the rule checks
The POU is never called and never used as a type: dead code, or a forgotten name change (check against the spec before deleting).
What it does to the plant
A fix goes into the dead copy and is believed to be live, while the site keeps running the old logic.
Example
PROGRAM PLC_PRGPumps();PROGRAM PumpsVAR xRun : BOOL;END_VARxRun := TRUE;PROGRAM PumpsOldVAR xRun : BOOL;END_VARxRun := FALSE;
PROGRAM PLC_PRGPumps();PROGRAM PumpsVAR xRun : BOOL;END_VARxRun := TRUE;
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
- If it is not needed, delete the POU.
- A forgotten version: check the call name against the spec, possibly a typo in the name.
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