beckhoff TE1200 — 4.2.1.3.4 SA0044: Declarations with reference to interface

Configuration | Rules nGlobal := INT#2; // => SA0042 GVL.nGlobal := INT#3; // => SA0042 sVar := CONCAT('ab', 'cd'); // => SA0042 sVar := Tc2_Standard.CONCAT('ab', 'cd'); // => SA0042 4.2.1.3.3 SA0043: Use of a global variable in only one POU | SA0043: Use of a global variable in only one POU Sample: The global variable nGlobal1 is only used in the MAIN program. Global variables: VAR_GLOBAL nGlobal1 : INT; // => SA0043 nGlobal2 : INT; END_VAR Program SubProgram: nGlobal2 := 123; MAIN program: SubProgram(); nGlobal1 := nGlobal2; 4.2.1.3.4 SA0044: Declarations with reference to interface | SA0044: Declarations with reference to interface Samples: I_Sample is an interface defined in the project.

Function block FB_Sample: FUNCTION_BLOCK FB_Sample VAR_INPUT iInput : I_Sample; END_VAR VAR_OUTPUT iOutput : I_Sample; END_VAR VAR_IN_OUT iInOut1 : I_Sample; // => SA0044 {attribute 'analysis' := '-44'} iInOut2 : I_Sample; // no error SA0044 because rule is deactivated via attribute END_VAR MAIN program: PROGRAM MAIN VAR fbSample : FB_Sample; TE1200 40 Version: 2.11.1 Function Determines global variables that are only used in one POU. Reason A global variable that is only used at one point should also be declared at this point.

Importance Medium PLCopen rule CP26 Function Determines declarations with REFERENCE TO and declarations of VAR IN OUT variables with the type of an interface (realized implicitly via REFERENCE _ _ TO). Reason An interface type is always implicitly a reference to an instance of a function block that implements this interface. A reference to an interface is therefore a reference to a reference and can lead to unwanted behavior. Importance High