beckhoff TE1200 — 4.2.1.7.9 SA0170: Address of an output variable should not be used

Configuration | Rules 4.2.1.7.7 SA0168: Unnecessary assignments | SA0168: Unnecessary assignments Sample: PROGRAM MAIN VAR nVar1 : DWORD; nVar2 : DWORD; END_VAR nVar1 := 1; IF nVar2 > 100 THEN nVar2 := 0; nVar2 := nVar2 + 1; END_IF nVar1 := 2; // => SA0168 4.2.1.7.8 SA0169: Ignored outputs | SA0169: Ignored outputs Sample: Function F_Sample: FUNCTION F_Sample : BOOL VAR_INPUT bIn : BOOL; END_VAR VAR_OUTPUT bOut : BOOL; END_VAR MAIN program: PROGRAM MAIN VAR bReturn : BOOL; bFunOut : BOOL; END_VAR bReturn := F_Sample(bIn := TRUE , bOut => bFunOut); bReturn := F_Sample(bIn := TRUE); // => SA0169 4.2.1.7.9 SA0170: Address of an output variable should not be used | SA0170:

Address of an output variable should not be used Sample: Function block FB_Sample: TE1200 76 Version: 2.11.1 Function Determines assignments to variables that have no effects in the code. Reason If several values are assigned to a variable without the variable being evaluated between the assignments, the first assignments do not have any effect on the program. Importance Low Function Determines the outputs of methods and functions that are not specified when calling the method or function. Reason Ignored outputs can be an indication of unhandled errors or nonsensical function calls, as the results are not used.

Importance Medium Function Determines code positions where the address of an output variable (VAR OUTPUT, _ VAR IN OUT) of a function block is used. _ _ Reason It is not allowed to use the address of a function block output in the following way: • By means of the ADR operator • By means of REF= Exception No error is reported if the output variable is used within the same function block. Importance Medium