Numeric Value

This function block controls the associated HMI object of the type "Numeric Value".

An integer signal of the data type UCHAR, WORD, LONG or LONGLONG or a floating-point signal of the data type FLOAT or DOUBLE is connected to the input Value. Its value is displayed in the HMI object according to the settings in the parameter dialog. The object is hidden, if a LOW signal is connected to the input bShow. The input iLang is used to adapt language specific font and text resources. lFGClr and lBGClr define the foreground and background colors.

HMI object

The HMI object displays a numeric value together with an optional unit. Overlong texts are cut off at the edges of the object.

Parameters

The mask designer can be invoked as parameter dialog using the context menu of the function block. It is used to assign an HMI object to the function block. Furthermore the parameter dialog of the HMI object can be opened and its default parameter can be configured.

The font, the display format, the unit, the text alignment and the default values for the colors are defined in the parameter dialog of the object.

The display formats “automatic”, “compact” and “fixed number of decimal places” can be selected.

At the format “automatic”, the integer values are displayed in the normal form with the required number of digits. Here, a LONGLONG value can cover up to 19 digits plus a possible sign. The length of the output is limited with the format “compact”. Now the value after “Number of digits” defines the length for the value representation with exponent. The sign of the integer value is not counted during the length calculation. For example, if the number of digits is 6, the value -123456 is displayed in normal form and -1234567 is represented by -1.235E6. As for the representation with exponents, at least 4 digits are needed, a smaller number of digits does not affect the value output. Shortened value outputs are rounded. If the display format “fixed number of decimal places” is selected and the number of digits is greater than 0, the normal form of the integer value is extended by a decimal point and the necessary number of trailing zeros.

At the format “automatic” the floating point values with exponents less than 6 and greater than -5 are displayed in normal form. In all other cases, they are displayed with exponents. The output text contains only the necessary places. And the mantissa is limited to a maximum of 6 digits. The length of the output text is increased when the exponent is between -1 and -4 because additional zeros have to be added before and after the decimal point. The format “compact” is offered to limit the output text to a fixed length.Here the “Number of digits” defines the maximum for the sum of the numbers of digits before and after the digital point and the length of the exponent. The normal form appears, if the value can be displayed with the entered number of digits. For exponents below -4,  the output text always contains an exponent. If the number of digits is too small to display a value, the output text is enlarged to the minimum necessary length. At format “fixed number of decimal places”, the value is always represented without the exponent and with the specified number of digits after the decimal point. Values with more decimal places are rounded and others are complemented with additional trailing zeros.

The unit can be assigned either as a language specific text resource or as a plain text.

Signals

Name I/O Type(s) Function
Value I FLOAT, DOUBLE, UCHAR, WORD, LONG; LONGLONG Value to be displayed
bShow I BIT Show/hide object
iLang I WORD Language resource (ID)
lBGClr I LONG Background color
lFGClr I LONG Text color

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.

Visualization

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