Skip to main content

Command: Display Cross References – Safety

Function: The command opens the Cross Reference List or Safety Cross Reference Listview. When you select the command in a safety object, the Safety Cross Reference List view opens.

Call:

  • Edit menu

  • Context menu command Browse → Display Cross References

In the Safety Cross Reference List view, you can display the occurrence locations in safety objects of one or all variables, POUs, or FB instances within the project and in referenced library POUs. You can also restrict the display to cross-references only in the project, only in the active application, or only in a specific POU.

Using of the safety cross-reference list

Note the following when using the safety cross-reference list for analyzing the control flow or data flow of the safety application:

  1. Correct naming format. Only "unqualified" identifiers may be entered in the Name field. This means that a search is made for a global variable by entering "‹variable name›", but not by entering "‹GVL name›.‹variable name›". A search is made for FB inputs and FB outputs by entering "‹input/output name›"; the instance-related search by means of "‹FB instance name›.‹input/output name›" is not supported.

  2. Correctly finalizing the entry / Starting the search. After selecting the scope and typing the identifier in the Name field, you must finalize these entries by pressing the Enter key. The Enter key activates the listing of all cross-references in the table. Using the search button (safety_icon_search.png) searches all occurrence locations in the Active application scope only.

Important

In the Safety Cross Reference List view, only cross-references can be found in safety objects, not in standard objects.

Cross references in safety objects are not listed in the Cross-reference list view.

For detailed information, see the "Changed Standard Functions" chapter of the user manual.

In CODESYS Safety Extension, the Display Cross References and Go To Definition functions are used for the analysis of the check and data flows during the static verification of a safety application. For a detailed description and notes about this, see the "Verification" chapter in the CODESYS Safety User Manual.

Caution

It is imperative to actively note all additional notices and safety warnings in the user manual when using the Safety cross-reference list for control flow analysis or data flow analysis of the safety application, either for verification or for effects analysis of changes.

Display Cross References in the Safety FBD Editor

The Browse → Display Cross References context menu command can be executed on function blocks and variables (identifiers) in the Safety FBD Editor.

Important

The declaration of a POU itself is not listed as a place of use in the cross-reference list.

View: Safety Cross Reference List

Name

Variable name, POU name, name of the FB instance

Input options

  • Type manually

  • By automatic update when the Automatically list selection in cross-reference view option has been selected in the CODESYS options, SmartCoding category.

The following entries are valid. Also note the scope which has just been set.

  • Name

  • "*": CODESYS searches the cross-references of ALL variables.

  • "*<string>": CODESYS searches for the cross-references of all variables whose name contains this string. Example: "iVar*" applies to iVar1, iVar_glob2, iVar45, etc.

_cds_icon_show_cross_reference.png

Sets the scope to Active application and searches the cross-references for this scope.

_cds_icon_show_cross_references_in_message_view.png

Dump cross references to message view: CODESYS outputs the current cross-reference list to the message window. This is useful to retain the current list, even though the automatic update (see Name above) is selected and can change the list in the cross-reference window.

_cds_icon_show_location.png

Show location: If a search for the cross-references have just been restarted, then a green arrow points to the first detected occurrence.

_cds_icon_show_previous_location.png

Show previous location Shift + F4: Shows the position of the previously detected cross-reference.

_cds_icon_show_next_location.png

Show next location F4: Shows the position of the next detected cross-reference.

_cds_icon_goto_definition.png

Go To Definition F2: CODESYS jumps to the location where the variable is declared. The corresponding declaration editor is opened and the variable is selected there.

cds_icon_cross_ref_print.png

Print: The current cross-reference is printed.

Scope

Selection of the range to search for cross-references:

  • All: Project and referenced library POUs

  • Project: Project without libraries

  • Active application

  • <POU name>

When a POU is open in the editor and the variable is selected for which you want to see the cross-references, CODESYS automatically sets the scope to this POU. The requirement for this is that the Automatically list selection in cross-reference view option is selected in the CODESYS options, in the SmartCoding category.

CODESYS adjusts the scope to the respective POU automatically when you select a variable in the editor of a POU and copy it to the open cross-reference list if the automatic update is selected in the CODESYS options.

The cross-references are displayed with the following information:

POU

Name of the block where the variable is used

Variable

Variable name, for references: Block name + variable name. Examples: iVar, xPOU.iVar1.

Access

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

Type

Data type of the variables

Area

Scope of the variable: Global / Local

Address

IEC address assigned to the variable, if any.

Position

Location of the occurrence of variables in the POU editor, for example line number, network number, declaration part, or implementation part.

Comment

Comments if available in the declaration of the variable