Command Cross Reference List
Symbol:
Function: The command opens the Cross Reference List view.
Call: Menu PLC > Window
Cross Reference List view
The view shows a list of cross-references in the project for a symbol. The symbol can be a variable, a POU (program, function block, function) or a user-specific data type (DUT).
The cross reference list basically offers two types of search:
- Text search: Entering a symbol name displays the cross-references of all symbols in the project with this name. If several symbols with the same name are found, the display can be restricted to individual declarations via the context menu.
- Declaration search: The symbol can be selected via the input assistant or by entering a qualified path, for example MAIN.nVar. After that, only the places of use of this symbol are displayed, even if other symbols with the same name exist.
Toolbar
Name | Symbol name (variable name, function block name, DUT name) Possible entries:
Additional options from outside the view Cross Reference List:
The following entries are valid:
Upper/lower case and spaces at the beginning and end of the input string are ignored. |
Open input assistant to select a symbol. | |
| Find cross-references: The search is performed. |
Define columns in which to search for the string | |
Filter | String to be searched for in the selected columns The found locations are marked in yellow. Cross-references without this string are hidden. |
| Show the source position of the previous cross-reference |
| Show the source position of the next cross-reference |
Restrict results to current declaration Available when multiple declarations are found for a symbol. Limits the display to the declaration you have just selected in the list. | |
Show source position of the selected cross-reference: The focus jumps to the symbol's usage location. | |
| Print Cross Reference List: The standard dialog for setting up a print job appears. |
Table of cross-references found
Symbol | The locations for the symbols (variables, POUs, DUTs) are grouped according to their declaration. The declaration location forms the root node, the usage points in the project appear indented below it. The system displays the exact expression, which the symbol has at the point of use. Example: If there is a global variable "nVar" in the project and a locally declared variable "nVar" in a function block, then after a text search for the cross-references two root node entries appear in the list, and the respective point of use of variable "nVar" is shown below. |
Function block | Function block name, DUT name; also task name in case of a function block call in the task configuration, for example. |
Variable | Pure variable name. Example: "nVar". |
Access | Type of access to the variable at the point of use: Special case for pointers: An assignment of the type |
Context | Context of the use of the variables. Example: "nVar := 1" |
Type | Data type of the variable. |
Address | IEC address, if assigned to the variable. Example "AT%QB0" |
Position | Position of the usage location within the editor of the POU concerned: for example, line number, network number, declaration part, or implementation part. Example: "Line 1, column 1 (Impl)" or "Line 9 (Decl)". |
Object | POU name + in square brackets the complete path of the point of use. Example: "MAIN [TwinCAT_SampleProject: PLC: SamplePLCProject]" |
Comment | Comment, if present in the variable declaration. |
The search returns all locations in the project as well as in inserted, uncompiled libraries.
Commands in the context menu of the Cross Reference List
Display source code position | Opens the affected function block and marks the usage location: for root entries the declaration, for child entries below it the respective usage location. Alternatively, you can double-click on a line. |
Restrict results to current declaration | Limits the display of results to the selected symbol declaration in case of multiple found declarations. |
Expand All | The list shows all the individual locations. |
Collapse All | The list only shows the root nodes of all locations. |
See also:
- Command 'Limit results to current declaration'
- Command Collapse All Folds
- Command Expand All Folds
- PLC documentation: Using the Cross Reference List to find Occurrences