beckhoff TE1200 — 4.2.1.5.1 SA0081: Upper border is not a constant

Configuration | Rules PROGRAM MAIN VAR nDINT : DINT; eSample : E_Sample; bVar : BOOL; END_VAR nDINT := nDINT + DINT#1; CASE nDINT OF DINT#1: bVar := FALSE; E_Sample.eTwo: // => SA0077 bVar := TRUE; ELSE bVar := NOT bVar; END_CASE CASE eSample OF DINT#1: // => SA0077 bVar := FALSE; E_Sample.eTwo: bVar := TRUE; ELSE bVar := NOT bVar; END_CASE 4.2.1.4.12 SA0078: Missing CASE branches | SA0078: Missing CASE branches Sample: PROGRAM MAIN VAR nVar : DINT; bVar : BOOL; END_VAR nVar := nVar + INT#1; CASE nVar OF // => SA0078 ELSE bVar := NOT bVar; END_CASE 4.2.1.5 SA0081 - SA0120 | SA0081 - SA0120 4.2.1.5.1 SA0081: Upper border is not a constant | SA0081: Upper border is not a constant Samples:

PROGRAM MAIN VAR CONSTANT cMax : INT := 10; END_VAR VAR nIndex : INT; nVar : INT; TE1200 54 Version: 2.11.1 Function Determines CASE statements without cases, i.e. with only a single ELSE statement. Reason A CASE statement without cases wastes execution time and is difficult to read. Importance Medium Function Determines FOR statements in which the upper limit is not defined with a constant value. Reason If the upper limit of a loop is a variable value, it is no longer possible to see how often a loop is executed. This can lead to serious problems at runtime, in the worst case to an infinite loop. Importance High