The View > Cross Reference List command opens a view that displays the locations where one or more variables are used within a project, including the locations of uncompiled integrated libraries. The display can also be restricted, for example, to cross references present in the project or in the active application or in a specific POU.
Elements of the Cross Reference List
Text box
Search text box |
Enter the variable name using one of the following input methods: oEnter manually. oUpdate automatically if the option Automatically list selection in cross reference view is selected in the Tools > Options > SmartCoding dialog box. The following entries are valid. Also consider the currently set scope for each: oVariable name o* (asterisk): Search for cross references of the variables. o*<string>: Search for cross references of variables containing this string in the name. Example: Searching for iVar* returns iVar1, iVar_glob2, iVar45 o%<IEC address>: Search for variables assigned to this address. Example: %QB0. |
Buttons
Button name |
Shortcut |
Description |
---|---|---|
Perform search |
Enter |
Starts the search for the variable entered in the search text box. |
Pick declaration from input assistant |
– |
Opens the Input Assistant dialog box. You can select a variable, a data type, or a function block to search for. It is automatically entered in the search text box. |
Show source position of selected cross reference |
– |
Jumps to the location where the respective variable is declared. The corresponding declaration editor is opened and the variable is highlighted. |
Show source position of previous cross reference |
Shift + F4 |
Shows the position of the previous cross reference of the variable. |
Show source position of next cross reference |
F4 |
Shows the position of the next cross reference of the variable. |
Limit results to current declaration |
– |
Available if multiple declarations have been found for a symbol. Displays only the results for the declaration that you have selected in the list. |
Print cross reference list |
– |
Prints the current cross reference. |
The found cross references are displayed with the following information:
Symbol |
The variables, POUs, or DUTs that have been found are here referred to by the term Symbol. They are grouped according to the respective declaration. The location where they are declared is used as root node. The other occurrences in the project are indented below the root node. These indented nodes display the expression that is used for the symbol at the specific location in the project. Example: There is a global variable i in the project and there is also a variable i that is locally declared in a block. The cross reference list contains two root node entries i. Indented below each root node, the specific occurrence is displayed. |
POU |
Name of the POU where the variable is used. |
Variable |
Name of the variable, for references: POU name + variable name Examples: iVar, xPOU.iVar1 |
Access |
Type of access to the variable at the location: oDeclare oRead oWrite oCall |
Type |
Data type of the variable. |
Address |
IEC address also assigned to the variable. Example: AT %QB0 |
Location |
Position of where the variable is used within the editor of the respective POU. For example, line number, network number, declaration section, or implementation section. Example: line 1, column 1 (Impl) |
Object |
Name of the POU plus the complete path of the occurrence location in brackets. Example: PLC_PRG [Device:Plc Logic:Application] |
Comment |
Comments, if available in the declaration of the variable. |
Double-click a line of the cross reference list to open the respective POU and to select the usage of the symbol inside this POU.
If you right-click a line of the cross reference list, the contextual menu provides the following commands:
Command |
Description |
---|---|
Expand all |
Expands any lines that are collapsed. |
Collapse all |
Collapses any expanded lines. Only the selected line remains visible. |
Show source position |
Has the same effect as double-clicking a line: Opens the respective POU and marks the occurrence. For root node entries, this is the declaration. For subentries, this is the respective variable usage. |
Limit results to current declaration |
When multiple declarations have been found, only those results are displayed in the list that apply to the currently selected declaration. To turn off this feature, execute another search. |