Rules / missing-implicit-checks
No POUs for Implicit Checks in a CODESYS project: what it changes
CheckBounds, CheckDiv..., CheckRange... and CheckPointer are added to a project by hand. Without them the runtime does not intercept out-of-bounds access, division by zero or out-of-range values.
Severity: Warning
Rule id: missing-implicit-checks
No POUs for implicit checks (runtime guards)
What the rule checks
The project has no implicit check functions (CheckBounds, CheckDivReal, CheckRange…, CheckPointer). They are added manually; without them the runtime does NOT intercept array-bounds overruns, division by zero and the like. Instead of graceful handling you get an exception or memory corruption.
What it does to the plant
Instead of a soft fallback you get an exception that stops the task, or silent memory corruption.
Example
<pou name="PLC_PRG" pouType="program"> <interface/> <body><ST><xhtml xmlns="http://www.w3.org/1999/xhtml">;</xhtml></ST></body></pou>
<pou name="PLC_PRG" pouType="program"> <interface/> <body><ST><xhtml xmlns="http://www.w3.org/1999/xhtml">;</xhtml></ST></body></pou><pou name="CheckDivReal" pouType="function"> <interface> <returnType><REAL/></returnType> <inputVars><variable name="divisor"><type><REAL/></type></variable></inputVars> </interface> <body> <ST><xhtml xmlns="http://www.w3.org/1999/xhtml">IF divisor = 0 THEN CheckDivReal := 1;ELSE CheckDivReal := divisor;END_IF</xhtml></ST> <addData><data name="cf"><CheckFunction>CheckDivReal32</CheckFunction></data></addData> </body></pou>
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
- Add the object: in CODESYS right-click Application →
Add Object → POUs for Implicit Checks, tick the ones you need (Bounds, Division, Range, Pointer). - Make sure the implementation is not empty: the default stubs protect, an empty body does not.
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