This function block is used to refer to a button list in a HMI, where up to 16 buttons are combined into one single object.
The input bShow is used to show or hide the HMI object. The button list can be enabled or disabled by the input bEnab. At the input lInpBNM a value is given which represents a bit mask. This bit mask spezifies which buttons of the list are selected. The input bTrigBNM is used to assign that selection to the list. The background color of the object can be assigned by the input lBGClr. The background and the text color for the selected buttons are set by the inputs lPBgC and lPTC. For the not selected colors the same can be done with the inputs lNPBgC and lNPTC. The input iLang is used to select the language for the used text and bitmap resources.
With a change from LOW to HIGH on the input bLftUp the button list can be scrolled to the left or upwards and on the input bRghDwn to the right or downwards. The outputs bLUEnab and bRDEnab indicate by a HIGH signal, that scrolling in that direction is possible.
The actual selection of currently pressed buttons is given to the output lBtnNmb as a bit mask. The output bEdge indicates that any button on the list was pressed.
The HMI object displays a list of up to 16 buttons in a vertical or horizontal direction. This list can work as a radio button (only one selection is possible) or as a selection list (where multiple selections are possible). If the list of the buttons is larger than the object itself, the list can be scrolled.
In the parameter dialog a HMI object of the type “Button List (unicode)” is assigned to the function block.
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 with the help of the mask designer.
The parameter dialog of the object consists of two views. The tabs in the upper left corner are used to switch between the views.
The global settings for the HMI-object and the list elements are entered in the view “General”. The direction of the list (vertical or horizontal) can be selected. It can be determined, if the list can contain a single or multiple selections. The general display style of the list (with or without frame, raised or recessed) can be selected. The default values for the language and the font for text display and the alignment of displayed bitmaps can be defined. The height of the buttons is specified in pixels. After activating the option “Adjust the object height” the list box is shortened to a multiple of the height of the elements. If the list is used in horizontal direction, this applies to the width (instead of height). The other option is used to disable the button list. Furthermore the default values of the colors for the background and the buttons with their different states can be selected.
The second view contains the predefined buttons. The context menu provides commands for adding new buttons as well as editing, deleting, selecting and moving of existing ones.
The definition of the single buttons conducted in its own dialog. The index of the list element is specified by “Button-ID”. The first element gets the index 0. The option “highlighted” is used to select that button. Furthermore the bitmaps for the different states of the button can be selected. A Plain text or a text resource can be displayed on the button. The alignment of the button and the text can be chosen. The global parameter will be used if “default” is chosen. Then all elements can be uniformly formatted.
|lInpBNM||I||LONG||Bit mask for the preselection of pressed buttons|
|lBGClr||I||LONG||Background color of the object|
|IPBgC||I||LONG||Background color of pressed buttons|
|IPTC||I||LONG||Text color of pressed buttons|
|INPBgC||I||LONG||Background color of not pressed buttons|
|INPTC||I||LONG||Text color of not pressed buttons|
|bShow||I||BIT||Show/hide the button list|
|bEnable||I||BIT||Enable/disable the button list|
|iLang||I||WORD||Language resource (ID)|
|bTriBNM||I||BIT||Assign the input lInpBNM|
|bLftUp||I||BIT||Scroll to left/upwards|
|bRghDwn||I||BIT||Scroll to right/downwards|
|lBtnNmb||O||LONG||Indicates the pressed buttons as a bit mask|
|bEdge||O||BIT||Indicates a button is pressed|
|bLUEnab||O||BIT||State for scroll left/up|
|bRDEnab||O||BIT||State for scroll right/down|
Note: If inputs are not connected the object appears with the corresponding default parameters that have been entered in the mask designer. Otherwise the input signal from the function block overwrites the according setting from the parameter dialog.
The colored highlight in the function block indicates, whether a HMI object is assigned or not.
To extract the information from the LONG value about the single bits, use a converter to transform it into a BIT vector. Then every single bit can be accessed.
The following example shows a typical application to realize a tabulator functionality with a button list. The list works as a radio button. The button list object is connected to two bitmap button objects to enable scrolling within the list. The output lBtnNmb, which contains the button selection, is connected to a converter function block to transform it into a BIT vector. This vector is broken into its elements by a vector split function block. These values are used to show or hide several defined HMI masks. The buttons left and right to the button list are used to scroll the list to any position to display currently unavailable buttons.
The view in the HMI might look like this: