Trend

This function block is used to refer to a trend writer in an HMI.

The input bShow is used to show or hide the HMI object. The update of the display is controlled with bUpdate. If the input is not connected, the display is redrawn automatically when the time corresponding to a pixel has passed. Therefore the display changes very often at small time resolutions. That makes it more difficult to watch the signal courses and increases the processor load. The update rate is reduced by connecting a periodical bit signal (e.g. from a clock generator). Then the HMI object is only redrawn when a HIGH signal is connected to bUpdate and at least the time corresponding to a pixel has passed since the last update.

The input signal Values is used to provide the displayed input data. The trend writer displays up to 8 curves. Therefore a vector can be connected, but only the first 8 vector elements are used for the trend display. Additional vector elements are ignored. The minimum and the maximum of the vertical scale are set via YMin and YMax. The time resolution in seconds is provided via the input fResolu. It corresponds to the period of the time that is displayed by the horizontal scale.

HMI object

The HMI object displays the temporal course of up to 8 signals.

Parameters

In the parameter dialog a trend writer HMI object is assigned to the function block.

By using the context menu of the function block, the mask designer can be invoked as the parameter dialog. The mask designer is used to create the assignment to the HMI object. Now the preferences of the HMI object can be set using the mask designer.

The colors of the different elements as well as the font for the scale values are defined in the parameter dialog. The object becomes transparent by deactivating the background and the draw field. Furthermore the position, the range of values and the dividing of both scales are assigned in the dialog. The settings for the main tics determine also the position of the grid lines that can be deactivated too. Values between 0.1 and 999.999 seconds can be entered for the time resolution.

The HMI object uses a ring buffer to save the displayed signal values together with a time stamp. The length of the X-axis determines the needed amount of memory if automatic buffer size is configured. In this case the buffer contains twice as many elements as the X-axis consists of pixels. Alternatively the buffer size can be assigned manually. The ring buffer always covers the time interval that is displayed on the X-axis. So the buffer size defines the number of the sampling points for the curves. At short cycle times the ring buffer can be too small to keep all input values. Therefore the minimum and the maximum of the input values are saved for every sampling point in the buffer. This method leads at small buffers to the display of two line courses per signal that describe the envelope of the input values. The vertical connections between the courses of maximum and minimum then indicate the sampling points.

Signals

Name I/O Type(s) Function
Values I FLOAT, DOUBLE, UCHAR, WORD, LONG; LONGLONG Input values
YMax I FLOAT, DOUBLE, UCHAR, WORD, LONG; LONGLONG Maximum of the Y-scale
YMin I FLOAT, DOUBLE, UCHAR, WORD, LONG; LONGLONG Minimum of the Y-scale
fResolu I FLOAT Time resolution in seconds
bShow I BIT Show/hide object
bUpdate I BIT Update the trend display

Visualization

The colored highlight in the function block indicates, whether an HMI object is assigned or not.

Comments

The data type of the input Values, YMin and YMax is set by connecting any one of them.