Skip to main content

PLCOpen Coverage

iec-checker tracks the PLCOpen Software Construction Guidelines v1.0 (April 2016). The tables below list every rule from the standard alongside its implementation status:

  • ✅ — implemented as a detector in iec-checker (rule ID links to its detector page)
  • TBD — planned (issue link tracks progress)
  • ❌ — not planned (not feasible for static analysis)

iec-checker currently covers 25 of 64 rules from the standard.

3. Naming Rules

RuleStatusDescription
N1Avoid physical addresses
N2Define type prefixes for variables (if used)
N3Define the names to avoid
N4Define the use of case (capitals)
N5Local names shall not shadow global names
N6Define an acceptable name length
N7Define naming rules for namespaces
N8Define the acceptable character set
N9Different element types should not bear the same name
N10Define name prefixes for user defined types

4. Comment Rules

RuleStatusDescription
C1Comments shall describe the intention of the code
C2All elements shall be commented
C3TBDAvoid nested comments
C4Comments may not include code
C5TBDUse single line comments
C6Define comments language

5. Coding Practice

RuleStatusDescription
CP1Access to a member shall be by name
CP2All code shall be used in the application
CP3All variables shall be initialized before being used
CP4Direct addressing should not overlap
CP5Applications shall be well designed
CP6Avoid external variables in functions, function blocks and classes
CP7Error information shall be tested
CP8Floating point comparison shall not be equality or inequality
CP9Limit the complexity of POU code
CP10Avoid multiple writes from multiple tasks
CP11Manage synchronization among tasks
CP12TBDPhysical outputs shall be written once per PLC cycle
CP13POUs shall not call themselves directly or indirectly
CP14TBDPOUs shall have a single point of exit
CP15Read a variable written by another task only once per cycle
CP16Tasks shall only call program POUs and not function blocks
CP17TBDUsage of parameters shall match their declaration mode
CP18Use of global variables shall be limited
CP19Usage of jump and return should be avoided
CP20TBDFunction block instances should be called only once
CP21Use VAR_TEMP for temporary variable declaration
CP22Select appropriate data type
CP23TBDDefine maximum number of input/output/in-out variables of a POU
CP24TBDDo not declare variables that are not used
CP25Data types conversion should be explicit
CP26A global variable may be written only by one PROGRAM
CP27TBDAvoid deprecated features
CP28Time and physical measures comparison shall not be equality or inequality

6. Languages

General

RuleStatusDescription
L1Define indentation

Function Block Diagram (FBD)

Not currently supported — iec-checker analyzes textual IEC 61131-3 only. Graphical FBD analysis needs a parser for the graphical form, for which no open-source toolchain or reference corpus is available.

RuleStatusDescription
L2Avoid assignments of intermediate results within networks
L3Define maximum complexity of single network

Ladder Diagram (LD)

Not currently supported — LD is a graphical language and no open-source toolchain or reference corpus exists to drive a parser and analyzer implementation.

RuleStatusDescription
L5A coil should not be followed by a contact
L6Define maximum rung complexity

Sequential Function Chart (SFC)

Not currently supported — SFC is a graphical language and lacks the open-source toolchain and sample programs required to build and validate an analyzer.

RuleStatusDescription
L7Closing divergent paths
L8Do not program an SFC action block in SFC
L9Define maximum complexity

Instruction List (IL)

Not currently supported — IL was deprecated in IEC 61131-3 Edition 3 and is being retired by vendors, and no open-source toolchain or reference corpus is available for it.

Structured Text (ST)

RuleStatusDescription
L4Define general formatting rules
L10Usage of CONTINUE and EXIT instruction should be avoided
L11TBDDefine the maximum line length
L13FOR loop variable usage should not be used outside the FOR loop
L14Passing parameters should be clear
L15Use parenthesis to explicitly express operation precedence
L16Define the use of tabs
L17Each IF instruction should have an ELSE clause
L22Loop variables should not be modified inside a FOR loop

7. Vendor Specific IEC 61131-3 Extensions

RuleStatusDescription
E1Dynamic memory allocation shall not be used
E2Pointer arithmetic shall not be used
E3Some comparator instructions shall not be used for pointers or reference manipulation