beckhoff TE1200 — 4.2.1.1.4 SA0004: Multiple write access on output

Configuration | Rules 4.2.1.1.2 SA0002: Empty objects | SA0002: Empty objects 4.2.1.1.3 SA0003: Empty statements | SA0003: Empty statements Samples: ; // => SA0003 (* comment *); // => SA0003 nVar; // => SA0003 The following sample generates the error "SA0003: Empty statement" for State 2. CASE nVar OF 1: DoSomething(); 2: ; 3: DoSomethingElse(); END_CASE The following sample does not generate an SA0003 error. CASE nVar OF 1: DoSomething(); 2: ; // nothing to do 3: DoSomethingElse(); END_CASE 4.2.1.1.4 SA0004: Multiple write access on output | SA0004:

Multiple write access on output This rule can only be checked using the Command 'Run static analysis' [ } 110] command, not using the “Check all objects” option. This rule cannot be disabled via a pragma or attribute! For more information on attributes, see Pragmas and attributes [ } 121] . TE1200 21 Version: 2.11.1 Function Determines POUs, GVLs or data type declarations that do not contain code. Reason Empty objects should be avoided. They are often a sign that an object is not fully implemented. Exception: In some cases, the body of a function block will not assigned code if it is only to be used via interfaces.

In other cases, a method is only created because it is required by an interface, without scope for meaningful implementation of the method. In any case, a comment should be included in such a situation. Importance Medium Function Determines lines of code containing a semicolon (;) but no statement. Reason An empty statement can be an indication of missing code. Exception Although there are meaningful uses for empty statements. For example, it may be useful to explicitly program all cases in a CASE statement, including cases in which no action is required. If such an empty CASE statement is commented, the statistical code analysis does not generate an error message.

Importance Low Function Determines outputs that are written at more than one position. Reason The maintainability suffers if an output is written in various places in the code. It is then unclear which write access is actually affecting the process. It is good practice to perform the calculation of the output variables in auxiliary variables and to assign the calculated value to a point at the end of the cycle. Exception No error is issued if an output variable is written in different branches of IF or CASE statements. Importance High PLCopen rule CP12