Skip to main content

Example: Trend

Product: CODESYS Visualization

The example shows how to visualize and record values with the Trend visualization element.

For more information, see: Visualization Element: Trend

Description

The TrendExample sample project contains three applications, each with a different trend configuration.

The following features are implemented in the example:

  • Conditional recording of values

  • Long-term recording of values

  • Multiple recording of values

Additional information

Application: ConditionalRecording

The application shows how to generate a sinusoidal signal with an amplitude of 500. The signal is recorded when the amplitude is greater than or equal to 200. The recording condition for this is set in the Trend Recording object in the Record Settings section. The object is located below the Trend Recording Manager object.

For more information, see: Object: Trend Recording

_example_img_trend_app_conditional_recording.png

Application: LongTermRecording

This application shows the implementation of how to configure the trend element for long-term recordings.

In the application, the power of a solar station is simulated. The power (variable: rCurrentPower) is recorded every 20 seconds. The data is stored in the database every minute.

You can adjust the recording interval in the Advanced Trend Settings dialog and the Measure in every n-th cycle input field. You can adjust the save interval in the Store every N milliseconds field of the Trend Storage object.

For more information, see: Dialog: Advanced Trace Settings

_example_img_trend_app_longterm_recording.png

Application: SimpleTrendExample

The sample application generates three signals which are recorded and visualized by the trend element. The recording can be started with the "Record" button.

_example_img_trend_app_simple.png

Application: DynamicRecordingIntervalTrendExample

The application shows how to use the Measurement slowdown factor option to adjust the recording interval of the trend recording at runtime.

For more information, see: Record Settings

_example_img_trend_app_dynamic_recording_interval.png

System requirements and restrictions

Programming system

CODESYS Development System (version 3.5.14.0 or higher)

Runtime system

CODESYS Control Win (version 3.5.14.0)

Add-on components

-

Note

_example_icon.png DOWNLOAD Project