Using the Cross-Reference List to Find Occurrences¶
The occurrences of symbols of a variable, a POU (program, function block, function), or a DUT can be displayed in a cross reference list. Then you can jump from the list directly to the corresponding locations in the project.
There are two ways to search for occurrence locations of a symbol:
- Plain text search: You manually specify a text (symbol name, placeholder) in the Cross-reference list view.
- Search for a specific declaration:
- In the Cross-reference list view, you select the declaration from the input assistant.
- The focus is on a symbol name in the POU editor and you start the cross-reference search from the context menu.
- The focus is on a symbol name in the POU editor, the Cross-reference list view is open, and the cross-reference search executes automatically.
- In the Cross-reference list view which already lists occurrence locations for several declarations, you limit these results to a specific declaration.
Cross references with text search by symbol name
Requirement: The Cross-reference list view is open.
Specify a string in the field next to the name, for example the identifier of the variable for which you want to find the occurrence location in the project. Example: “
iCounter
”.For the text search, you can use the asterisk “
\*
” (for any number of characters) or the question mark “?
” (for an exact number of characters) combined with a substring of a variable identifier.Use the percent sign “
%
” to search for IEC addresses. Examples: “%MW8
”, “%M
*”.Click the
button to start a text search in the project.
- ⇒
The view Cross Reference List opens and displays the occurrence locations for the
iCounter
variable. The declaration parts are always displayed in the project with the occurrence location indented.
Double-click an occurrence location in the cross-reference list.
- ⇒
The respective object opens in the editor with the marked occurrence location.
Cross-references for a specific symbol declaration
Requirement: A POU is open in the editor.
Set the cursor at the identifier of the symbol (variable, POU) in the declaration part or implementation part.
Click
in the context menu or menu.- ⇒
The Cross Reference List view opens and shows the occurrence locations of the variables or POU.
If the Cross-reference list view is already open, then you can also search the occurrence locations for a specific result as follows:
Select the Automatically list selection in cross reference view check box in (SmartCoding category). Select the name of the symbol in the POU, or set the cursor in the name.
- ⇒
Depending on the position of the selection or cursor, the cross-reference list automatically shows the occurrence locations for the respective symbol.
In the Cross-reference list view, use the input assistant
to specify a symbol name in the field next to By declaration.
- ⇒
The cross-reference list displays the occurrence locations for the symbol.
If multiple declarations for a symbol are listed in the Cross-reference list view, for example after a text search, then you can reduce the display to one result: Select the line with the desired declaration and click the
button or click Limit results to current declaration in the context menu.
- ⇒
the cross-reference list includes only the occurrence locations for the selected declaration.
See also