SourceForge Logo

HMI Elements

see also: Colors for HMI elements.
HMI Elements are used to display or modify data in an HMI screen. For each element you want to use, you must specify a parameter line in the hmiViewer applet tag. All hmiElements have the first 16 parameters in common. These are:
NameUsage
x positionstart position in pixels from left border
y positionstart position in pixels from upper border
widthwidth in pixels
heightheight in pixels
Colors for minimum displaythese colors are used when value<miximum
foreground color 1 (used as font color or for dial,bar,etc.)
foreground color 2 (used for frame and/or scale)
background color
Colors for normal displaythese colors are used when miximum<=value<=maximum
foreground color 1 (used as font color or for dial,bar,etc.)
foreground color 2 (used for frame and/or scale)
background color
Colors for maximum displaythese colors are used when value>miximum
foreground color 1 (used as font color or for dial,bar,etc.)
foreground color 2 (used for frame and/or scale)
background color
valuevalue to be displayed
minimumthreshold to switch to minimum colors
maximumthreshold to switch to maximum colors
For all these parameters, you can either provide a fixed value or a cell coordinate. If you specify a cell coordinate, the value will be fetched from the server (VISUAL main application) once per refresh cycle. In most cases you will specify a cell coordinate for value and fixed numers for the others. It's often usefull to specify cells for minimum and maximum. Consider the situation, that a recipe provides different limits for the same process parameter for different products. In this case, you would copy the limits from the recipe to the spreadsheet and reference the respective cells on the parameter line for the display.
You can also make the position, size or colors variable. Using variable positions with a hmiIcon, element you could display positions of machine elements like a piston in a cylinder.
Classes derived from hmiElement may specify more parameters according to their needs. An example is hmiLimited, which is an abstract base class for graphical displays like hmiHBar, hmiVBar, hmiAnalog. It's characteristic for these displays, that they can display only values from their scale's start to it's end. Consequently, hmiLimited introduces two new parameters:
scaleBegthe lowest displayable value,begin of scale
scaleEndthe highest displayable value, end of scale

The following table shows examples of the available elements. If the element requires additional parameters, these are to add in the order given in the "Extra parameters" column.
NameExampleExtra parameters Intended UsagePossible Actions
hmiAnalog scaleBegin,scaleEnd left click will call up the trend
script immediately. Right click will add
to next trend diagram.
hmiButSwitch onText,offText Switch a binary variable on/off Left click will switch off,
Right click will switch on.
hmiDigital text, unit, digits Left click will call up the trend
script immediately. Right click will add
to next trend diagram.
hmiFixText text Add some text that is not yet in the background
image.Useful, if you want to reuse the same
background image on different pages with a
different text like line 1,line 2
no action
hmiHBar scaleBeg, scaleEnd Left click will call up the trend
script immediately. Right click will add
to next trend diagram.
hmiIcon image file name 1.Display a moveable machine part in it's position
2.Combine with hmiLink to get image link buttons.
3.Show up warning symbols.
no action
hmiLightUp Text for minimum, text for maximum Show up on alarm conditions.
If you want it to be invisible when there is
no alarm, use -1 for normal colors.
no action
hmiLink target URL Insert links into an HMI page. You may
want to build an overview page for a
showing only few or no variables and then
use hmiLink to switch to a more detailled view.
If you want it to be invisible, use -1 for colors.
show document URL refers to.
hmiPoti none Modify values. Left click decreases, right click increases value.
hmiPushButton onText,offText Set a binary variable on while pressed
Note on pushbuttons and PLC drivers.
Left or right click will set to on
hmiRollSwitch onText,offText Set a variable to a value
Left or right click on upper button symbol will
increase value, clicks on lower button symbol
will decrease it.
hmiVBar scaleBeg, scaleEnd Left click will call up the trend
script immediately. Right click will add
to next trend diagram.