Skip to main content

SA0029: Notation in code different to declaration

Detects the code locations where the notation of an identifier is different from the notation in its declaration

Justification: The IEC 61131-3 standard defines identifiers as not case-sensitive. This means that a variable declared as "varx" can also be used as "VaRx" in the code. However, this is confusing and misleading and should be avoided.

Importance: Medium

Example 41. Example

A PLC_PRG POU and a fnc (function) POU exist in the device tree.

PROGRAM PLC_PRG
VAR
    iVar: INT;
    _123test_var_: INT;
END_VAR
ivar := iVar + 1;    // SA0029
_123TEST_var_ := _123test_var_;    // SA0029
Fnc();    // SA0029

Output in the Messages view:

  • sa_icon_message.png SA0029: Notation in code (ivar) must equal declaration (iVar)

  • sa_icon_message.png SA0029: Notation in code (_123TEST_var_) must equal declaration (_123test_var_)

  • sa_icon_message.png SA0029: Notation in code (Fnc) must equal declaration (fnc)



For more information, see: