Detects code locations where the data type of a condition does not match that of the
CASE
branch
Justification: If the data types between the CASE
variable and the CASE
itself do not match, then this could indicate an error.
Importance: Low
Example
TYPE My_Enum : ( eins := 1, zwei := 2, drei := 3, vier := 4 ); END_TYPE PROGRAM PLC_PRG VAR diVar : DINT; xTemp : BOOL; END_VAR diVar := diVar + DINT#1; CASE diVar OF DINT#1: xTemp := FALSE; My_Enum.zwei, DINT#3: //SA0077 xTemp := TRUE; ELSE xTemp := NOT xTemp; END_CASE --> SA0077: Type mismatches with CASE expression