beckhoff TE1200 — 4.2.1.2.16 SA0037: Write access to input variable

Configuration | Rules VAR_OUTPUT bOut1 : BOOL; bOut2 : BOOL; // => SA0036 END_VAR bOut1 := bIn1; MAIN program: PROGRAM MAIN VAR fbSample : FB_Sample; END_VAR fbSample(bIn2 := TRUE); bIn2 is used when the function block instance is called. However, as this input variable is not used internally within the function block’s implementation, it is reported not only for bIn3 , but also for bIn2 SA0035. 4.2.1.2.15 SA0036: Unused output variables | SA0036: Unused output variables Sample: Function block FB_Sample: FUNCTION_BLOCK FB_Sample VAR_INPUT bIn1 : BOOL; bIn2 : BOOL; // => SA0035 END_VAR VAR_OUTPUT bOut1 : BOOL; bOut2 : BOOL; // => SA0036 END_VAR bOut1 := bIn1; 4.2.1.2.16 SA0037:

Write access to input variable | SA0037: Write access to input variable Sample: Function block FB_Sample: FUNCTION_BLOCK FB_Sample VAR_INPUT bIn : BOOL := TRUE; nIn : INT := 100; END_VAR VAR_OUTPUT bOut : BOOL; END_VAR Method FB_Sample.SampleMethod: TE1200 36 Version: 2.11.1 Function Determines output variables that are not assigned within the respective function block. Reason Unused variables make a program less easy to read and maintain. Unused variables occupy unnecessary memory space and take up unnecessary runtime during the initialization. Importance Medium PLCopen rule CP24 Function Determines input variables (VAR INPUT) that are subject to write access within the _ POU.

Reason According to the IEC 61131-3 standard, an input variable may not be changed within a function block. Such access is also an error source and makes the code more difficult to maintain. It indicates that a variable is used as an input and simultaneously as an auxiliary variable. Such dual use should be avoided. Importance Medium