Skip to main content

Configuring a Task-Dependent Recording

You can configure a database on the runtime system and the data buffering.

Timeout for trend recording

During a trend recording, it can happen that the application task triggers a timeout that is caught with an exception when transitioning from Running to Stop. Causes can be that file operations with the SQLite database are taking too long or that too many variables are being recorded. This usually happens on a target device with weak performance.

You can avoid the occurrence of an exception:

  • Configure the trend recording with less memory demand so that the amount of data that is stored is adapted to the target system.

  • Reduce the number of variables.

Assigning tasks

In this task, the runtime system records the trend.

  1. In the device tree, double-click a Trend Recording object.

    The corresponding editor opens. In the tree view of the trend configuration, the top entry is selected, and on the right you see the current configuration in Record Settings.

  2. In the Task list box, click the _cds_icon_arrow_down.png symbol.

    The list box opens with all tasks that are available throughout the application.

  3. Select a task for trend recording.

Tip

In general, trend recording runs in the same task as the main program (for example, PLC_PRG).

Adding IEC variables

Important

The number of variables is limited for trend recording. You can change this number in the Trend Storage dialog.

  1. In the device tree, double-click a Trend Recording object.

    The corresponding editor opens. In the tree view of the trend configuration, the top entry is selected, and on the right you see the current configuration in Record Settings.

  2. Right-click an entry in the tree view.

  3. Click the Add Variable command.

    CODESYS has added more variables. The blank settings open in the Variable Settings to the right of the tree view.

  4. Select a valid IEC variable from the Variable field.

    The IEC variable is configured for trend recording.

  5. Configure how the variable is displayed in the trend diagram.

  6. Configure how the alert color is displayed in the trend diagram.

Removing variables from the configuration

  1. In the device tree, double-click a Trend Recording object.

  2. Click a variable in the tree view of the configuration.

  3. Click Delete Variable or press Del.

Starting conditional trend recording

You can configure conditional trend recording for execution. Configuration is not possible when depending on triggering. For that you need a Trace object.

  1. In the device tree, double-click a Trend Recording object.

  2. Click the top node in the tree view of the trend configuration.

    The name of the trend configuration is selected and on the right you see the current configuration in Record Settings.

  3. Assign a Boolean variable, an access to a bit, or a property to the Record condition field.

    At application runtime, data is recorded only when the value is TRUE.

Adding parameters

  1. In the device tree, double-click a Trend Recording object.

    The corresponding editor opens. In the tree view of the trend configuration, the top entry is selected, and on the right you see the current configuration in Record Settings.

  2. Right-click an entry in the tree view.

  3. Click the Add Variable command.

    CODESYS inserts a new variable. The blank settings open in the Variable Settings to the right of the tree view.

  4. Click the _cds_icon_arrow_down.png symbol to the right of the Variable setting.

  5. Select Parameter from the list box.

  6. Click _cds_icon_three_dots.png and select a parameter from the Input Assistant dialog.

  7. Configure how the parameter is displayed in the trend diagram.

  8. Configure how the alert color is displayed in the trend diagram.

Configure data buffering on RTS

  1. In the device tree, double-click a Trend Recording object.

    The corresponding editor opens. In the tree view of the trend configuration, the top entry is selected, and on the right you see the current configuration in Record Settings.

  2. Click Trend Storage.

    The Trend Storage dialog opens.

  3. Now you can change the settings.

Configuring additional buffering

  1. In the device tree, double-click a Trend Recording object.

    The corresponding editor opens. In the tree view of the trend configuration, the top entry is selected, and on the right you see the current configuration in Record Settings.

  2. Click Advanced.

    The Advanced Trace Settings dialog opens.

  3. Now you can change the settings.