Code analysis (Static Analysis)
Before a project is loaded onto the target system, TwinCAT 3 PLC uses "Static Code Analysis" to check whether the source code follows specified coding guidelines.
The license-free version of the static code analysis is called "Static Analysis Light". The checks configured in the analysis function are performed automatically whenever code is generated. Further information can be found in section “Static Analysis Light”.
The licensed version of the static code analysis is the "Static Analysis", which has a greatly extended range of functions and configurations in comparison with the Light version. The static code analysis can be triggered manually or performed automatically during the code generation. Further information on this extension can be found in the documentation “TE1200 | TC3 PLC Static Analysis”.
Static Analysis Light vs. Static Analysis Full
An overview of the different features of the license-free and license-managed variants of Static Analysis is provided below.
Functional aspect | Static Analysis Light | Static Analysis Full |
License required | No, usable free of charge | Yes, TE1200 license required |
Save/export and load/import (rule) configuration | Not possible, coupled to PLC project properties | Possible (using the Load/Save buttons in the Settings) |
Execution is coupled to the compilation process | Yes, not configurable | Configurable (using the Perform static analysis automatically option in the Settings; Manual execution with the help of the command Command 'Run static analysis') |
Checking for unused objects (e.g. within a library project) | Not possible | Possible (with the help of the command Command 'Run static analysis [Check all objects]') |
Maximum number of reported errors | 500 (not configurable) (Further information on the significance of 500 as the maximum number of errors can be found in the Settings) | Configurable (using the setting Maximum number of errors in the Settings) |
Maximum number of reported warnings | Output of warnings not possible (see following line) | Configurable (using the setting Maximum number of warnings in the Settings) |
Rules: Activation options |
|
|
Rules: scope | 7 coding rules
| More than 100 coding rules |
Rules: Precompile wavy underline, QuickFix | Not available | Available |
Naming conventions | Not available | Available |
Metrics | Not available | Available |
Forbidden symbols | Not available | Available |
Pragmas and attributes for temporary deactivation of rules | Yes, available in the Light scope:
| Yes, available in full scope:
|