Skip to main content

Object: Trace

Symbol: _visu_icon_trace.png

An object of type Trace is used to configure and display application-specific trace data in one or more charts. At application runtime, value curves of trace variables, which you can monitor in the trace editor in CODESYS during this time, are recorded on the controller. Requirements are that a trace configuration has been configured transferred to the controller, and the trace recording has been started. The sampled data is transmitted to the development system and displayed in charts according to the configuration. You can navigate through the data when tracing.

For more information see: Data Sampling with Trace

Tip

If the controller supports a Trace Manager, then you can use the 'DeviceTrace' object type in the Trace Manager to access all traces that are running on the controller.

Double clicking the trace object opens the trace editor. The corresponding toolbar contains the most important trace commands. The trace variable list shows the variable whose value curve is recorded.

_cds_img_trace_editor.png
  • (1): Toolbar of the trace editor

  • (2): Trace editor

  • (3): Trace variable list

  • (4): Links for trace configuration

    Configuration

    Add Variable

Toolbar of the trace editor

Trace editor

At application runtime, the runtime system buffer of the trace component is filled with the recorded samples. The data is transmitted to the development system and stored in its trace editor buffer. The trace editor accesses this data and displays it in charts as a graph over time. When you close the trace editor, the trace editor buffer is freed up again.

For more information, see: Control the Data Sampling

Use menu commands to control the trace. Moreover, you can use menu commands, keyboard shortcuts, and mouse input to navigate through the data.

For more information, see: Navigating into Trace Data

Trace variable list

The trace variable list provides an overview of the current trace configuration. In the list, all charts with the respective trace variables are displayed in a table. When you double-click a trace variable, the Trace Configuration dialog also opens with the variable settings.

_cds_icon_drop_down_list.png

The list box opens by means of the Hide Instance Paths command.

Hide Instance Paths

Display of the variable name in the list

standard icon: Variable name with full instance path

Example: PLC_PRG.iCounter

Table 2. Charts

Tabular display of the charts

Name

List of charts with the respective variables

  • Chart <n>_cds_icon_option_black_activated.png: The chart is displayed.

    The chart name can be changed by clicking the selected name.

  • <variable>_cds_icon_option_black_activated.png: The variable is displayed.

    The variable name can be changed by clicking the selected name in the line editor.

When you select a Chart <n> in the table, the corresponding chart is also selected in the editor. This also works the other way around.

Cursor <n>

Y-value at the cursor position

Delta

Delta of the Y-value from Cursor 2 to Cursor 1

Multiselection

With multiselection, you can use the numpad keys * and / to expand and collapse selected charts.



Tip

You can drag the charts and variables to sort them or move them to other charts. When the Ctrl key is pressed, the variable is copied. This is also possible in online mode.

Table 3. Context menu in the trace variable list

Add Variable

Adds a new trace variable and opens the Trace Configuration dialog with its variable settings

Select a variable in the input field of the Variable setting to trace its value curve.

Visible

Toggles the visibility of the graph (value curve or trace variable) in the corresponding diagrams:

  • _cds_icon_menu_activated.png: Visible

  • _cds_icon_variable_invisible.png: Hidden

When multiple charts or variables are selected in the trace variable list by multiselection, the visibility can be toggled for these graphs.

Display Mode

Opens the Trace Configuration dialog

Select a configuration item in the Trace Record tree view or Presentation (Diagrams).

Configuration

Opens the Trace Configuration dialog

The Variable Settings are displayed on the right side.



Navigating in the trace diagram

Table 4. With mouse input

User Input with Mouse

Mouse cursor symbol during user input

Effect

Drag the graph along the X-axis.

_cds_cursor_trace_shift_graph_horizontally.png

Scrolls trace graphs of all charts at the same time along the time axis (X-axis)

Hold down the Ctrl key and drag the graphs along the Y-axis.

_cds_cursor_trace_shift_graph_vertically.png

Scrolls the trace graphs of the selected charts along the Y-axis

Roll the mouse wheel backwards.

Compresses the time axis (like the _cds_icon_trace_compress.png symbol)

Roll the mouse wheel forwards.

Stretches the time axis (like the _cds_icon_trace_stretch.png symbol)

Press and hold down the Ctrl key and roll the mouse wheel backwards.

Compresses the Y-axis

Press and hold down the Ctrl key and roll the mouse wheel forwards.

Stretches the Y-axis

Requirement: One or two trace cursors are activated.

Drag the triangle of a trace cursor to another position along the time axis.

_cds_img_trace_shifting_one_cursor.png

Refreshes the Y-values in the trace variable list at the same time

  • First value: Y-value at the position of the left cursor

  • Second value: Y-value at the position of the right cursor

  • Third value: Difference between both values

Requirement: Mouse zooming is activated (_cds_icon_trace_zoom_by_mouse_activ.png).

Stretch a rectangle.

_cds_icon_zoom_by_mouse.png

Zooms the trace graphs of all charts to the rectangle



Table 5. With keyboard shortcuts

Keyboard Shortcut

Effect

Requirement: No trace cursor mode is activated.

Arrow Left

Arrow Right

Scrolls trace graphs of all charts at the same time along the time axis

Arrow Up

Arrow Down

Scrolls the trace graphs of the selected charts along the Y-axis

Requirement: One or two trace cursors are activated.

Alt+Arrow Left

Alt+Arrow Right

Scrolls trace graphs of all charts at the same time along the time axis

-

Compresses the time axis (like the _cds_icon_trace_compress.png symbol)

+

Stretches the X-axis (like the _cds_icon_trace_stretch.png symbol)

Ctrl+-

Compresses the Y-axis of the selected chart

Ctrl++

Stretches the Y-axis of the selected chart

Tab

Selects the next lower chart

Requirement: One or two trace cursors are activated.

Arrow Left

Arrow Right

Moves the black trace cursor

Requirement: Two trace cursors are activated.

Shift+Arrow Left

Shift+Arrow Right

Moves the gray trace cursor