Configuration | Rules PROGRAM MAIN VAR CONSTANT cValue : INT := INT#15; END_VAR VAR pValue : POINTER TO INT; END_VAR pValue := ADR(cValue); // => SA0007 4.2.1.1.8 SA0008: Check subrange types | SA0008: Check subrange types The check is not performed for CFC objects, because the code structure does not allow this. Sample: PROGRAM MAIN VAR nSub1 : INT (INT#1..INT#10); nSub2 : INT (INT#1..INT#1000); nVar : INT; END_VAR nSub1 := nSub2; // => SA0008 nSub1 := nVar; // => SA0008 4.2.1.1.9 SA0009: Unused return values | SA0009: Unused return values Sample: Function F_ReturnBOOL: FUNCTION F_ReturnBOOL : BOOL F_ReturnBOOL := TRUE; MAIN program: PROGRAM MAIN VAR bVar :
BOOL; END_VAR F_ReturnBOOL(); // => SA0009 bVar := F_ReturnBOOL(); TE1200 24 Version: 2.11.1 Function Determines range exceedances of subrange types. Assigned literals are checked at an early stage by the compiler. If constants are assigned, the values must be within the defined range. If variables are assigned, the data types must be identical. Reason If subrange types are used, make sure that the function remains within the respective subrange. The compiler checks such subrange violations only for assignments of constants. Importance Low Function Determines function, method and property calls for which the return value is not used.
Reason If a function or method returns a return value, the value should be evaluated. In many cases the return value contains information to indicate whether the function was executed successfully. If no evaluation is performed, it is subsequently not possible to determine whether the return value was overlooked or whether it is in fact not required. Exception If a return value is of no interest during a call, this should be documented and the assignment can be omitted. Error returns should never be ignored! Importance Medium PLCopen rule CP7/CP17