Command 'Run static analysis [Check all objects]'
Symbol:
Function: The command starts the static code analysis for all objects of the currently active PLC project and outputs the results in the message window.
Call: Build menu or context menu of the PLC project object
During execution of the static analysis, compliance with the coding rules, naming conventions and forbidden symbols is checked. This command can be used to trigger the static analysis manually (explicit execution).
TwinCAT issues the result of the static analysis, i.e. messages relating to rule violations, in the message window. The rules, naming conventions and forbidden symbols to be taken into account in the static analysis can be configured in the PLC project properties. You can also define whether the violation of a coding rule should appear as an error or a warning in the message window (see: Rules).
See also: Syntax in the message window
![]() | Please note that the selected PLC project is created before this command is executed. Checking via the static analysis is only started if the code generation was successful, i.e. if the compiler did not detect any compilation errors. |
Please also note the Command 'Run static analysis' and the differences between the two commands described in the following table.
Differences |
'Run static analysis' command |
'Run static analysis [Check all objects]' command |
---|---|---|
Scope of application/mode of operation |
Objects used: The activated rules are applied to the objects that are used in the PLC project. Unused objects: Unused objects are not checked with this command. |
Objects used: The activated rules are applied to the objects that are used in the PLC project. Unused objects: The rules that are activated and that can be checked in the precompile are applied to the unused objects. See also: |
Note |
If you also wish to have the unused objects checked by the static analysis, you can use the 'Run static analysis [check all objects]' command. |
The command is primarily useful when creating libraries or when processing library projects. |
Execution options for the command |
Static analysis can be performed either explicitly using the command or implicitly. Implicit execution of the static analysis during each code generation can be enabled or disabled in the PLC project properties (Settings tab). If the Perform static analysis automatically option is enabled, TwinCAT performs the static analysis after each successful code generation (with the Build project command, for example). The command can also be called up via the Automation Interface. See also: Automation Interface support |
The "Check all objects" variant cannot be executed implicitly. It can only be executed explicitly via the command. The command can also be called up via the Automation Interface. See also: Automation Interface support |