beckhoff TE1200 — 4.2.1.2.14 SA0035: Unused input variables

Configuration | Rules eSample := E_Sample.eNull; eSample := E_Sample.eTwo; 4.2.1.2.12 SA0033: Unused variables | SA0033: Unused variables 4.2.1.2.13 SA0034: Enumeration variables with incorrect assignment | SA0034: Enumeration variables with incorrect assignment Sample: Enumeration E_Color: TYPE E_Color : ( eRed := 1, eBlue := 2, eGreen := 3 ); END_TYPE MAIN program: PROGRAM MAIN VAR eColor : E_Color; END_VAR eColor := E_Color.eRed; eColor := eBlue; eColor := 1; // => SA0034 4.2.1.2.14 SA0035: Unused input variables | SA0035: Unused input variables Sample: Function block FB_Sample: FUNCTION_BLOCK FB_Sample VAR_INPUT bIn1 : BOOL; bIn2 : BOOL; // => SA0035 bIn3 :

BOOL; // => SA0035 END_VAR TE1200 35 Version: 2.11.1 Function Determines variables that are declared but not used within the compiled program code. 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 CP22/CP24 Function Determines values that are assigned to an enumeration variable. Only defined enumeration constants may be assigned to an enumeration variable. Reason An enumeration type variable should only have the intended values, otherwise code that uses that variable may not work correctly.

We recommend using only enumerations that have the {attribute 'strict'}. In this case the compiler checks the correct use of the enumeration components. Importance High Function Determines input 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. Note An input is only considered to be used if it is actively referenced within the implementation (or the methods) of the function block itself. Importance Medium PLCopen rule CP24