SA0101: Names with invalid length

Function

Determines names with invalid length. The object names must have a defined length.

You can configure the parameters that are taken into account in the check by double-clicking on the row for rule 101 in the rule configuration (PLC Project Properties > category "Static Analysis" > "Rules" tab > Rule 101). You can make the following settings in the dialog that appears:

  • Minimum number of characters (default value: 5)
  • Maximum number of characters (default value: 30)
  • Exceptions

Reason

Some programming guidelines specify a minimum length for variable names. Compliance can be verified with this analysis.

Importance

Low

PLCopen rule

N6

Samples:

Rule 101 is configured with the following parameters:

Program PRG1:

PROGRAM PRG1                     // => SA0101
VAR
END_VAR

MAIN program:

PROGRAM MAIN                     // no error due to configured exceptions
VAR
    i     : INT;                 // no error due to configured exceptions
    b     : BOOL;                // => SA0101
    nVar1 : INT;
END_VAR
PRG1();