This function block controls an input line for numeric values in an HMI.
The input bShow is used to show or hide numeric input line. The language of the font and text resources that have been selected in the parameter dialog is set at iLang. If a HIGH signal is written to bSet then the input value that is connected to IValue is checked and assigned to the object. The input value is cut at the first invalid character or format error.
The current value of the numeric input line is written to the output OValue. The changing of the current value is signaled with an edge at the output bChange. The changes can be caused by the user as well as by the setting of another value with help of the inputs bSet and IValue.
The HMI object displays the left aligned current value in an input line. A modal dialog is opened in the center of the display after the input line has been clicked. Depending on the configuration the modal input dialog is simple or complex.
The simple dialog consists of a line, the number keys, optional keys for the sign and the decimal point and the OK button. After opening the dialog, the line is empty. The handling is similar to a calculator. The sign can be changed at any time. The dialog is moved with help of the caption. And the contained button is used to cancel the input.
The complex dialog displays the current value after opening. The value can be deleted character by character with the back key. Or it can be completely removed with the clear key. Because of the missing caption the dialog can't be moved. An additional key is provided to cancel the input.
The mask designer is called as the parameter dialog via the context menu of the block. An HMI object of the type "Numeric Input" 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 …". It is divided in three sections.
Global settings for the input line as well as for the modal dialog are entered in the section “General”. The initial value and the default value for the language can be specified there. The other parameters determine the length and the range of values. They influence the checking of input values. And they affect the visibility of the keys for the sign and decimal point in the dialog.
The frame type, the colors and the font of the HMI-object are configured in the section “Input line”.
The third section contains the settings for the modal dialog. The type as well as the font for the line and the keys, their colors and the resource texts for the labels are entered here. The size of the line and the keys is calculated on the basis of the selected font and the assigned labels. And the dialog is automatically adapted. Furthermore, a timeout can be defined. If the specified time has elapsed after the last pressing of a key or the opening then the input is automatically canceled. And the dialog is closed.
|iLang||I||WORD||Language resource (ID)|
|bChange||O||BIT||Current value has been changed|
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 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.
The function block operates only with the data type TEXT for the values. To be able to use numeric data types converter function blocks from the adapter library have to be used.