Skip to main content

iec-checker

Static analyzer for IEC 61131-3

Catch bugs and PLCOpen coding guidelines violations in Structured Text before they reach the PLC.

What is iec-checker?

iec-checker is an open-source static analyzer for IEC 61131-3 programs. It processes input programs, finding possible errors and code smells without executing them.

📋 PLCOpen Compliance

25 PLCOpen Guideline checks covering naming, initialization, complexity, recursion, floating-point comparison and more, plus 2 built-in checks for out-of-bounds access and unused variables.

📥 Multi-format Input

Analyze plain Structured Text, PLCOpen XML exports, or Schweitzer Engineering Laboratories XML — all from the same CLI.

⚙️ CI-friendly

Machine-readable JSON output, meaningful exit codes, recursive directory scanning. Drop it into GitHub Actions or GitLab CI in minutes.

Python API

Dump the parsed IR (AST, control-flow graphs, environments) as JSON via --dump and consume it from your own Python plugins.

📜 Open Source

Released under the LGPL-3.0-or-later license — free to use, audit, modify, and integrate into commercial PLC toolchains. Contributions welcome on GitHub.

Discover Detectors

iec-checker ships with 27 built-in detectors that catch the most common classes of mistakes in Structured Text code.

✨ Code Quality

Enforce maintainable code with detectors like PLCOPEN-CP1 (access by name) and PLCOPEN-CP3 (initialize before use).

🛡️ Safety Issues

Catch the bugs that take production lines down, like PLCOPEN-CP13 (no direct or indirect recursion).

➗ Numerical Correctness

Avoid silent precision bugs with detectors like PLCOPEN-CP8 (float equality) and PLCOPEN-CP25 (explicit conversions).