Skip to main content

SA0162: Missing comments

Detects uncommented locations in the program

Justification: Complete commenting is required by many programming guidelines, and it increases the readability and maintainability of the code.

Importance: Low

PLCopen rule: C2

Comments are required in the following cases:

  • For the declaration of variables. The comments are located above or to the right.

  • For the declaration of programs, function blocks, or methods. The comments are located above the declaration (in the first line).

Example 120. Example
PROGRAM PLC_PRG
VAR
    iMaxValue:  INT;
END_VAR

Output in the Messages view:

  • sa_icon_message.png SA0162: Missing comment for 'PLC_PRG'

  • sa_icon_message.png SA0162: Missing comment for 'iMaxValue'