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.

  1. 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*”.

  2. Click the 9217a4b8449208f4c0a8640e01b561a2_067dd47044b87a92c0a8640e00dbf424 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.

  3. 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.

  1. Set the cursor at the identifier of the symbol (variable, POU) in the declaration part or implementation part.

  2. Click Browse for symbol ‣ Browse cross-references in the context menu or Edit 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:

  1. Select the Automatically list selection in cross reference view check box in Tools ‣ Options (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.

  1. In the Cross-reference list view, use the input assistant 9217a4b8449208f4c0a8640e01b561a2_dd1c04a7db483edbc0a8640e002ef722 to specify a symbol name in the field next to By declaration.

    The cross-reference list displays the occurrence locations for the symbol.

  1. 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 9217a4b8449208f4c0a8640e01b561a2_3b20f92761606447c0a8646356b3a1f5 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