free quality report for PLCopenXML exports

Rules / plcopen-naming

PLCopen variable naming: x, i, r, t prefixes

An optional profile: the rule checks that a variable name starts with the prefix for its type (BOOL → x, INT → i, REAL → r, TIME → t and so on). Turn it on only if your team has adopted this standard.

Severity: Minor Rule id: plcopen-naming Name off the PLCopen standard

This rule belongs to the optional "PLCopen naming" profile and only runs when the profile is enabled.

What the rule checks

PLCopen standard: a variable name starts with a type prefix (BOOL→x, INT→i, REAL→r, DINT→di, TIME→t, WORD→w …). An optional conformance check.

What it does to the plant

No risk to the plant. Consistent names make other people's code and reviews faster to read.

Example

Bad: the rule fires
PROGRAM ScaleVAR    rRaw : REAL;    value : REAL;END_VARvalue := rRaw * 2.0;
Fixed: the rule is silent
PROGRAM ScaleVAR    rRaw : REAL;    rValue : REAL;END_VARrValue := rRaw * 2.0;

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

  1. Rename by the prefix table: value : REAL → rValue, cnt : INT → iCnt.
  2. If you do not need PLCopen naming, simply leave this profile off.

Standard

PLCopen standard: a type prefix at the start of a variable name (as stated in the rule description; the prefix table is above).

Check your project

Upload a PLCopen XML or CODESYS .export file: the report is free and the code is not stored.

Local version on GitHub →

The same linter without uploading a file: command line and GitHub Action.

Related rules

2026-11-26

Processing happens in memory, and the uploaded code is not stored. The tool advises; code changes are up to the engineer (see what the linter can't see). What happens to your code → · Rule reference · Your code & privacy · Industry benchmark · Feedback · GitHub