SA0162: Missing comments

Function

Detects uncommented locations in the program. Comments are required for:

  • the declaration of variables. The comments are shown above or to the right.
  • the declaration of POUs, DUTs, GVLs or interfaces. The comments are shown above the declaration (in the first row).

Reason

Full commentary is required by many programming guidelines. It increases the readability and maintainability of the code.

Importance

Low

PLCopen rule

C2

Samples:

The following sample generates the error "SA0162: Missing comment for 'b1'" for variable b1.

// Comment for MAIN program
PROGRAM MAIN
VAR
    b1  : BOOL;
    // Comment for variable b2
    b2  : BOOL;
    b3  : BOOL;                  // Comment for variable b3
END_VAR