This function block controls a text display in an HMI.
The object is displayed with a HIGH signal on the input bShow and hidden with a LOW signal. The inputs iLang, iText and sText are used to label the object. A language specific text resource is selected with iLang and iText. The plain text that is connected to sText is displayed if iText is not connected or the parameter value “undefined” is assigned to it.
lFGClr and lBGClr define the foreground and background colors. Palette indexes (0-255) are expected at 8-bit color depth and 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.
Here you can find an example about how to display formatted digits on a screen.
The HMI object displays a text, which is either given as a plain text or as a text resource.
If a font with anti-aliasing is used, in addition to the foreground color, several gradations up to the background color are used to smooth out edges during text output. If the resulting glimmering of the background color interferes when the object is transparent (deactivated background), it is recommended to change the background color or to choose a font without anti-aliasing.
The mask designer is called as the parameter dialog via the context menu of the block. An HMI object of the type "Text (Unicode)" 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 font and the default values for the label and the colors are set here. A language specific text resource or a plain text can be assigned. Furthermore, the alignment of the text can be adjusted.
|Text resource (ID)
|Language resource (ID)
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.