Skip to main content

Example: Recording Changes of Variable Values

Product: CODESYS Visualization

This example shows how to use handlers to record variable value changes which have been triggered by user input within the visualization.

Description

Visualization elements whose variable value has changed as a result of user input call the IValueChangedListener interface. With this interface, the value changes can be recorded and then processed programmatically.

Additional information

Project VisuValueChangeHandler.project:

The FB_ValueChangedListener function block implements the IValueChangedListener interface. The ValueChangedListenerManager function block is registered in the PLC_PRG program.

When the value of a visualization element changes, the ValueChanged method of the FB_ValueChangedListener function block is called.

In the sample project, all user inputs of the visualization are written to the log file of the device. You can use the Input Assistant to select a respective visualization element.

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 or higher)

Add-on components

-

Note

_example_icon.png DOWNLOAD Project