Skip to main content

Object: Trend Recording

Symbol: _visu_icon_trend_recording.png

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.

In a trend recording, you configure which data is recorded, where, and in which time interval.

At runtime, CODESYS TargetVisu transfers the configuration to the CmpTraceMgr runtime system component.

Group: Record Settings

Select the top node of the trend view. This is the trend name. Then the Record Settings are displayed on the right side.

Record by time interval

_visu_img_radio_button.png: Recording is done after the specified time interval (default setting).

Note: When this option is selected, the Interval Settings group is displayed below. There you configure the frequency of the recording by specifying a time interval.

Record depending on task

_visu_img_radio_button.png: Recording is done in the frequency according to the specified task.

Note: When this option is selected, the Task Settings group is displayed below. There you configure the frequency for the recording by specifying a task.

Table 83. Interval Settings

Time interval

Example: 6000 in ms

Select a time unit from the list box (ms, s, m, h, d).

Task priority (0..31)

Default value: 15



Table 84. Task Settings

Task

Task where the data is recorded

This means that the recording is equidistant per task cycle (or a multiple of the task cycle).

Example: MainTask

Click _cds_icon_arrow_down.png to open a list box with all tasks available in the project.

Hint: In general, the trend recording runs in the same task as the main program.

Task priority (0..31)

Default value: 15

Advanced settings

Measure in every n-th cycle

Frequency that the runtime system records data, depending on the number of processed task cycles.

Select a value from the list box or type a value into the input field.

Example: 1h1m1s1ms

Example: 10

CODESYS uses the settings from the task configuration to calculate the time interval according to the frequency. Therefore, the calculation is possible only if at least the task cycle time is set. The result is displayed to the right of the input field, outside the table in a standardized style.

Time interval, specified as a multiple of the task cycle

Default: 1 means that data is recorded in each task cycle.

Hint: The time interval which results in the multiple is displayed after the input field.

Additional runtime buffer

Length of the time interval when the runtime system can record more data

Example: 1000

Time interval (in ms) for an additional runtime buffer

If a delay occurs when "writing away" data in the runtime system component, then there is a risk of data loss due to overwriting. In this case, the runtime system uses the addition buffer.



Table 85. Common Settings

Record condition

Record condition by which the data was recorded:

  • IEC variable of type INT. The condition is fulfilled for TRUE.

  • Bit access to an integer variable. The condition is fulfilled for 1.

    As read access to a property

The contents of a pointer are not permitted.

Note: If no condition is defined, then the recording starts automatically.

Measurement slowdown factor

Factor (numeric data type as literal or variable >= 1

Example: 5

The factor is multiplied by the interval specified in Measure in every n-th cycle. This results in the actual recording interval.

Measure in every n-th cycle = 2 and Measurement slowdown factor = 5 means that the measurement is only recorded every 10 task cycles.

Resolution

Example: ms

Resolution which the application saves the timestamp

Select a time unit from the list box.

Note: If the task where the trend object is executed has a cycle time of 1 ms or less, then you should set the resolution of the timestamp to 1 µs.

Trend Storage

Maximum number of variables

Example: 10

Maximum number of trend variables which can be managed in the database

If you increase this value afterwards, then CODESYS will perform a download and reconfigure the database.

Store every N milliseconds

Time interval (in ms) when the CmpTraceMgr runtime system component buffers the sampled data before storing it persistently in the database

Example: 10000

The application internally calculates the number of task cycles from the time interval. The duration of a task cycle is defined in the task configuration.

A high value results in a better runtime performance. The disadvantage of this is that the risk of the loss of data is increased in case of a crash or shutdown of the controller. A low value reduces this risk. The disadvantage here is that the control of a trend visualization becomes more sluggish with large amounts of data.

Limit

No limit

_cds_icon_radiobutton_acitvated.png: The number of data sets which can be recorded is unlimited.

Note: This is not recommended.

Maximum number of records

_cds_icon_radiobutton_acitvated.png: Maximum number of data sets which are stored in the database.

Example: 100

Note: A data set consists of the values of the trend variables and the timestamp.

Estimated database size

The approximate file size is specified next to the Maximum number of records field.

Example: 2 MB

The estimated file size depends on the following:

  • Maximum number of set entries

  • Number of variables and their data types

  • Whether saved values are large or small

Therefore, the actual data size may differ significantly.

Maximum storage size

_cds_icon_radiobutton_acitvated.png: Maximum size of the trend storage in number of storage units

In the list box, select a storage unit (kilobyte KB, megabyte MB, or gigabyte GB).

Example: 16

The application internally calculates the number of data records.



Group: Variable Settings

Select a variable in the trend view. Then the respective Variable Settings are displayed on the left side.

Variable

Variable for recorded value.

  • IEC variable with valid data type

  • Property

  • Reference

  • Contents of a pointer

  • Array element of a valid data type

  • Enumeration of a valid data type

Valid data types are all standard types, except STRING, WSTRING, and ARRAY.

Parameters

Parameter for the recorded value

The Input Assistant dialog lists all valid system parameters in the Parameters category of the Categories tab.

_cds_icon_drop_down_list.png

Toggles between Variable and Parameter

Record condition

Condition for which the application records the data of the variables:

  • IEC variable of type INT. The condition is fulfilled for TRUE.

  • Bit access to an integer variable. The condition is fulfilled for 1.

  • As read access of a property

The contents of a pointer are not permitted.

Note: If no condition is defined, then the recording starts automatically.

Attached y axis

Y-axis of the trend diagram that displays the Variable. The list box provides the standard Y-axis and the configured Y-axes.

Requirement: This option is visible only when the Trend visualization element has configured additional Y-axes in the Edit Display Settings dialog.

Display variable name

standard icon: The visualization shows the name of the IEC variable in the trend diagram at runtime. Either alone or in brackets after the Description

_cds_icon_option_deactivated.png: The name of the IEC variable is shown and does not appear in brackets after the Description.

Requirement: If any text is typed in Description, then you can disable the option.

Description

Text for the tooltip (example: Sensor A): When a visualization user focuses on the variable in the trend diagram, the visualization shows the text as a tooltip. The text is typed into the GlobalTextList object and can be localized there.

When the Display Variable Name property is activated, the text is supplemented with the variable name in brackets. Example: Sensor A (PLC_PRG.iSensor_A)

If Description does not contain any text, then Display Variable Name is enabled. The name is then without brackets (for example, PLC_PRG.iSensor_A).

If a legend is assigned to the trend, then the trend variable is labeled in the legend and shown like the trend is configured here.

Curve type

  • Line

  • Area

Graph color

Color of the curve in the trend diagram

Line type

  • Line: Values are linked to form a line.

  • Step: Values are linked in the form of steps.

  • None: Values are not linked.

Requirement: The Curve type is Line.

Filling type

  • No filling

  • Plain color

  • Gradient

Requirement: The Curve type is Area.

Filling color

standard icon: The area is filled with the selected color.

Requirement: The Curve type is Area.

Transparency

Value (0 to 255) for defining the transparency of the selected color

Example 255: The color is opaque. 0: The color is completely transparent.

Requirement: The Curve type is Area.

Line width

Value (in pixels)

Example: 1

Line style

The display of the line is solid, dash, dot, dash-dot, or dash-dot-dot.

Point type

. Display as a scatter chart
  • Dot: Value as a dot.

  • Cross: Value as a cross.

  • None: No dot display

Hint: Select None for larger size data.

Activate minimum warning

standard icon: Warning when below the lower limit.

Critical lower limit

If the variable value is below the limit, then the variables are displayed with the alert color in the trend diagram.

Color

Warning color when the value falls below the limit

Activate maximum warning

standard icon: A warning is issued if the upper limit is exceeded.

Critical upper limit

If the variable value exceeds the limit, then the variables are displayed with the alert color in the trend diagram.

Color

Warning color when the value exceeds the limit

Add Variable

Adds a new variable in the trend configuration. Next, its still blank configuration is displayed on the right side.

Delete Variable

Removes the selected variable