Configuration | Metrics ◦For FB1 , its method METH must also be taken into account. METH uses FUN and CUBE . FUN has already been added to the RFC of FB1 (see previous point). Thus, only the use of CUBE in METH increases the RFC for FB1 to 3. 4.4.1.18 Coupling between objects (CBO) | Coupling between objects (CBO) Sample: FUNCTION_BLOCK FB_Base VAR fb3 : FB3; // +1 instantiated here END_VAR FUNCTION_BLOCK FB_Sub EXTENDS FB_Base // +0 for EXTENDS VAR fb1 : FB1; // +1: instantiated here fb2 : FB2; // +1: instantiated here END_VAR fb3(); // +0: instantiated in FB_Base, no increment for call The extension of a function block does not increase the coupling between objects.
fb3 is instantiated in the implementation of FB_Base and inherited by FB_Sub . The call in FB_Sub does not increase the coupling between the objects. The metric Coupling Between Objects for FB_Sub is therefore : 2 4.4.1.19 Complexity of reference (Elshof) | Complexity of reference (Elshof) Sample: PROGRAM MAIN VAR i, j : INT; k : INT := GVL.m; b, c : BOOL; fb : FB_Sample; END_VAR fb(paramA := b); // +3 accesses (fb, paramA and b) i := j; // +2 accesses (i and j) j := GVL.d; // +2 accesses (j and GVL.d) For the metric Complexity of reference (Elshof) , MAIN : Number of variables used = 6 TE1200 104 Version:
2.11.1 Title short form CBO Categories Maintainability, reusability Definition Number of additional function blocks that are instantiated and used in a function block Further information CBO = Coupling Between Objects A function block with a high level of coupling between objects is likely to be involved in many different tasks and therefore violates the principle of clear responsibility. Standard upper limit for the associated rule SA0179: Coupling between objects [} 79] 30 Title short form Elshof Categories Efficiency, maintainability, reusability Definition Complexity of the data flow of a POU The complexity of reference is calculated using the following formula:
/ Further information Only variable accesses in the implementation part of the POU are taken into account.