Command ‘Cross Reference List’

Symbol: aecb6e1644a20ddec0a8640e0091d2ef_bab1a03d5e897086c0a8640e0033bc86

Function: This command opens the Cross-reference list view.

Call: Menu bar: View, or Edit ‣ Browse ‣ Browse cross-references.

This view shows a list of cross-references for a symbol in the project. The symbol can be a variable, a POU (program, function block, function), or a user-specific data type (DUT). The display can be reduced by right-clicking the list and then the current declaration.

Find cross-references for symbol

Symbol name (variable name, POU name, DUT name). Input options:

  • By declaration: Selection of a declared symbol by means of the input assistant ( aecb6e1644a20ddec0a8640e0091d2ef_dd1c04a7db483edbc0a8640e002ef722 button).

  • By name: Manual input of the symbol name, or selection from the history in the input field. Then click the aecb6e1644a20ddec0a8640e0091d2ef_067dd47044b87a92c0a8640e00dbf424 button to start a Global text search in all applications in the project.

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

  • Use the command Browse for symbol ‣ Browse cross-references if the name of a declared symbol is selected in an editor, or if the cursor is in the name field.

  • Automatic if the name of a declared symbol is selected in an editor, or if the cursor is in the name field. Requirement: CODESYS option Automatically list selection in cross reference view is activated (category SmartCoding.

The following input is valid:

  • Variable name, simple or fully qualified. Examples: “iVar”, “PLC_PRG.iVar”.

  • POU name: Examples: “PLC_PRG”, “myFB”.

  • DUT name: Example: “mySTRUCT”.

  • Strings combined with placeholders: asterisk (*) for any character or question mark (?) for exactly one characters).

    Example: “iVar*” applies to iVar1, iVar_glob2, iVar45, etc.

    iVar?” refers to iVar1, iVar2, iVarX, and so on, but not iVar_glob2, iVar45 and so on…

  • %<IEC address>”: CODESYS searches for variables that are assigned to this address and direct memory access. Example: “%QB0”, %Q0 := 2.

aecb6e1644a20ddec0a8640e0091d2ef_81bc3df3db5bf559c0a8640e0057267a Show source position of previous cross-referenceShift+F4
aecb6e1644a20ddec0a8640e0091d2ef_c279d778db5b6c63c0a8640e013c4052 Show source position of next cross-referenceF4
aecb6e1644a20ddec0a8640e0091d2ef_3a7c306fdb45028bc0a8640e01910229 Show source position of selected cross-reference: The focus jumps to the occurrence location of the symbol.
aecb6e1644a20ddec0a8640e0091d2ef_3b20f92761606447c0a8646356b3a1f5 Limit results to current declaration: Available if multiple declarations are found for a symbol. Limits the display to the declaration that you have selected in the list.
aecb6e1644a20ddec0a8640e0091d2ef_b162d64fe6372c56c0a8640e00114e35 Print cross-reference list: The default dialog opens for setting up a print job.
The cross references are displayed with the following information:
Symbol

The result locations for the symbols (variables, POUs, or DUTs) are grouped by declaration. The declaration occurrence comprises the root node and the occurrence locations in the project are indented below. The precise expression is displayed that has the symbol at the occurrence location.

Example: If there is a global variable i in the project and a local declared variable i in a POU, then two root node entries will be listed after a text search for cross-references with the occurrences of the variable i below each.

POU Block name; also a task name if a block call in the task configuration.
Variable Only the variable name (for example, iVar)
Access

Type of access to the variable at the occurrence location: Declaration / Read / Write / Call.

Special case for pointers: An assignment type p := ADR(var1) is displayed as write | address when searching for var1. The reason for this: Any write access to p is not displayed when searching for var1. Write access is also possible by means of pointer variables.

Type Data type of the variable
Address IEC address if variables are assigned Example: “AT %QB0”.
Position Location of the occurrence in the POU editor, for example line number, network number, declaration part, or implementation part. Example: “line 1, column 1 (Impl)”.
Object POU name plus complete path of the occurrence location in brackets (if this is found in the Devices view). Example: “PLC_PRG [Device:Plc Logic:Application]
Comment Comments if available in the declaration of the variable

The search yields all result locations in the project and in included, uncompiled libraries.

Right-click commands in the cross-reference list

Show source position: Opens the respective POU and marks the occurrence: for root entries, the declaration, and for subordinate entries, the respective occurrence location. As an alternative, you can double-click a line.

Limit results to current declaration: Limits the display of results to the selected symbol declaration if multiple declarations are found.

Expand all: In the list, every single result location is shown.

Collapse all: In the list, only the root nodes of the result locations are shown.

See also