Number of output variables

Title short form

Outputs

Categories

Maintainability, reusability

Definition

Number of variables declared in the VAR_OUTPUT area of the program organization unit (POU)

Further information

For function blocks, this is the number of user-defined output variables (VAR_OUTPUT). For methods and functions, this is the number of user-defined output variables (VAR_OUTPUT) plus one if they have a return value. The return value is also counted.

Inherited output variables are not counted.

A high number of output variables is a sign of a violation of the principle of clear responsibility.

Standard upper limit for the associated rule SA0166: Maximum number of input/output/VAR_IN_OUT variables

10

Sample:

METHOD METH : BOOL
VAR_OUTPUT
    a : INT;
    b : LREAL;
END_VAR

The method METH has three outputs:

METHOD METH1
VAR_OUTPUT
    a : ARRAY[0..10] OF INT;
    b : LREAL;
END_VAR

The method METH1 has two outputs: