free quality report for PLCopenXML exports

Rules / naming

Single-letter variable names in PLC code: why they hurt

Names like a, x or t (apart from loop counters i, j, k, n) say nothing about what the variable holds. Six months later, during a callout, someone has to decode them from the code.

Severity: Minor Rule id: naming Cryptic variable name

What the rule checks

Single-character names (other than counters i/j/k/n) are unreadable during maintenance. I/O tags and FB pins are left alone.

What it does to the plant

Slower troubleshooting and a higher chance of editing the wrong variable.

Example

Bad: the rule fires
PROGRAM ScaleVAR    rRaw : REAL;    a : REAL;END_VARa := rRaw * 2.0;
Fixed: the rule is silent
PROGRAM ScaleVAR    rRaw : REAL;    rScaled : REAL;END_VARrScaled := 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. Give it a meaningful name by purpose (e.g. iRetryCount instead of n).
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