Multi Color Bar
This function block controls a bar display in an HMI, which can consist of a large number of colored segments.
The input bShow is used to show or hide the HMI object. The input lCInp is connected to a vector containing the color values for the bar. The colors are specified at 8-bit color depth as palettes indices (0-255) and as BGR-values (blue-green-red) at 24-bit color depth. They are provided e.g. by the color parameter block as of library version 7.0. The number of elements of the connected vector defines the number of segments of the multi color bar. If this input is not connected, the bar will not be drawn. A change from LOW to HIGH on the input bTrig will update the bar with the current values from the color vector.
Because the bar can also be used as a button, the output bPress indicates the pressing of the object.
The HMI object displays a horizontal bar which is divided into any number of equally large segments. Every segment can have its own color. The object registers mouse clicks and therefore is able to work as a button. It is possible that only a part of the height of the object is drawn as the bar.
The mask designer is called as the parameter dialog via the context menu of the block. An HMI object of the type "Multi Color Bar" is assigned to the block by creating or selecting it. With the checkbox in the lower left corner you can switch between global and instanceable assignment.
Default settings for the HMI object are made in the corresponding dialog, which appears after "Additional settings …". The height of the bar is defined here. A value of 0 or greater than the height of the object results, that the complete height of the object is used to draw the bar.
|lCInp||I||LONG||Vector with the color values|
|bShow||I||BIT||Show/hide the object|
|bTrig||I||BIT||Update the color bar|
|bPress||O||BIT||Indicates use as a button|
The assignment of the HMI object is displayed in the block by the color of the text boxes. A yellowish background indicates a global assignment. If the assignment is instanceable, the background is white. And at missing or incorrect assignment it is red.
Even if only a part of the height of the object is drawn, the complete area of the object is used as a button.