This function block is used to refer to a button or switch in a HMI, which is able to display a bitmap.
The input bShow is used to show or hide the HMI object. It is enabled with a HIGH signal on the input bEnable and disabled with a LOW signal. The inputs iENBmp, iEPBmp, iDNBmp and iDPBmp are used to assign background bitmaps for the button states “normal”, “pressed”, “disabled” and “disabled + pressed”. A label is assigned via the inputs iText or sText. With iText a language specific text resource is selected. If the input iText is not connected or has the parameter value "undefined", the plain text connected to sText will be shown. The language of the used bitmap and text resources is specified at input iLang.
Depending on the type selection in the parameter dialog the pressing of the button or the state of the switch is written to the output bPress. If the type is “Button (signal on button down)” or “Button (signal on button up)”, the output bPress changes for one program cycle from LOW to HIGH after the button is pressed. If the object is a switch, the output writes a HIGH signal in the states “pressed” and “disabled + pressed”. In the other states LOW is written to bPress.
The HMI-object displays a button or a switch. It can be labeled with a text and state dependent background bitmaps. If the alignment is set to “Bitmap and Text centred”, large pictures can conceal the edges of the button. Other shapes can easily be assigned using this feature. e.g. flat buttons or check boxes.
In the parameter dialog, the function block is assigned a HMI object of the type “Bitmap Button/Switch”.
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 type selection in the parameter dialog of the object determines whether the object is a button or a switch. A button is only pressed while the mouse button is pressed. The button returns to normal state when the mouse button is released. A switch remains in state “pressed” after the first push and it only changes back to normal state after another use. Furthermore two button types are distinguished. One writes an edge to the output of the function block when the button is pressed and the other when it is released.
The state dependent background and text colors, the font as well as the default values for the bitmaps and the texts and their alignment are configured in the parameter dialog. A language specific text resource or a plain text can be assigned to label the button.
|sText||I||TEXT, DYNTEXT||Plain text|
|iText||I||WORD||Text resource (ID)|
|iEPBmp||I||WORD||Bitmap resource (ID) – pressed|
|iENBmp||I||WORD||Bitmap resource (ID) – normal|
|iDPBmp||I||WORD||Bitmap resource (ID) – disabled + pressed|
|iDNBmp||I||WORD||Bitmap resource (ID) – disabled|
|iLang||I||WORD||Language resource (ID)|
|bPress||O||BIT||Button pressed or switch state|
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.