Rules / visu-index-mismatch
The number in an element caption differs from the variable index
The caption says "Boiler 3" while alarm[2] is bound. It is the same copied-element trace. Output format digits (%2.0f) are removed before comparing. The check reads Cyrillic captions, as used on Russian-language panels.
Severity: Warning
Rule id: visu-index-mismatch
Caption number differs from the index
This rule only runs on CODESYS .export files: PLCopenXML does not contain these settings.
What the rule checks
The number in an element's caption does not match the index in the bound variable: the caption says "Boiler 3" while the variable is alarm_kotel[2]. It is the same copy-paste trace, except here the error is visible right in the caption-to-binding pair. Format digits are stripped from the caption before comparing: on a live project %2.0f Гц next to act_FH1 produced false positives: 2 and 0 are width and precision, not an equipment number.
What it does to the plant
One boiler's alarm appears in another boiler's place and the operator walks to the wrong unit.
Example
VAR_GLOBAL aBoilerAlarm : ARRAY[1..3] OF BOOL;END_VARVISU Overview GVL.aBoilerAlarm[2] | Котёл 3
VAR_GLOBAL aBoilerAlarm : ARRAY[1..3] OF BOOL;END_VARVISU Overview GVL.aBoilerAlarm[3] | Котёл 3
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
- Fix whichever is wrong: the index in the binding, or the number in the caption. On site the operator trusts the caption.
- If the caption number refers to something other than the array index (a position on the diagram, say), spell that out in the caption so the mismatch does not read as an error.
Upload a PLCopen XML or CODESYS .export file: the report is free and the code is not stored.
The same linter without uploading a file: command line and GitHub Action.
Related rules
2026-11-26