Skip to content

Repository files navigation

IEC Checker

⚡ Try it online | 📚 Documentation | 🛡️ Detectors reference | 🔧 Sponsor Custom Features

IEC Checker is an open source static analyzer for IEC 61131-3 programs. It catches bugs and enforces PLCOpen coding guidelines before code reaches the PLC.

What it looks like

$ iec_checker program.st
PLCOPEN-CP3: Variable X shall be initialized before being used
  --> program.st:4:9
  See: https://iec-checker.github.io/docs/detectors/PLCOPEN-CP3

PLCOPEN-CP13: POUs shall not call themselves directly or indirectly
  --> program.st:8:30
  See: https://iec-checker.github.io/docs/detectors/PLCOPEN-CP13

Features

The ST dialect is compatible with the matiec compiler. If iec-checker chokes on extensions from your PLC vendor, please open an issue.

Installation

Download a prebuilt binary for Linux or Windows x86_64 from GitHub releases.

Docker

Nightly builds are published to Docker Hub automatically by a weekly GitHub Actions workflow:

docker pull jubnzv1/iec-checker:nightly
docker run --rm -v "$PWD:/src" -w /src jubnzv1/iec-checker:nightly program.st

Build from source

Requires OCaml 5.1+ and opam.

opam install --deps-only .
make

See the installation guide for Windows instructions and optional Python setup.

Usage

iec_checker test/st/*.st          # check ST files
iec_checker -i xml schemes/*.xml  # check PLCOpen XML
iec_checker --help                # all options

See the CLI reference for the full option list, output formats, and exit codes.

Releases

Packages

Used by

Contributors

Languages