Response For Class (RFC)

Title short form

RFC

Categories

Maintainability, reusability

Definition

Number of different POUs, methods or actions that can be called by a POU

Further information

RFC = Response For Class

The value is used for measuring the complexity (in terms of testability and maintainability). All possible direct and indirect method calls can be reached via associations are taken into account. These can be used to respond to an incoming message or to respond to an event that has occurred.

Sample:

Function block FB1:

FUNCTION_BLOCK FB1
VAR
    d,x,y : INT;
END_VAR
x := METH(d+10);
y := FUN(42, 0.815);

Method FB1.METH:

METHOD METH : INT
VAR_INPUT
    i     : INT;
END_VAR
METH := FUN(CUBE(i), 3.1415);

Function Cube:

FUNCTION CUBE : INT
VAR_INPUT
    i     : INT;
END_VAR
CUBE := i*i*i;

Function FUN:

FUNCTION FUN : INT
VAR_INPUT
    a     : INT;
    f     : LREAL;
END_VAR
FUN := LREAL_TO_INT(f*10)*a;