Bargraph (segmented)

This function block is used to refer to a bar graph in a HMI, where two bars can be displayed on top of each other.

The input bShow is used to show or hide the HMI object. The inputs lPosB1 and lLenB1 are used to define the start vale and length of the two bars. The inputs lPosB1 and lLenB1 are used for the same purpose for the second bar. With lClrB1 und lClrB2 the colors of the two bars can be set.

If the starting position of any bar is out of the defined minimum/maximum, this bar will not be displayed.

HMI object

The HMI object displays a horizontal or vertical bargraph, depending on the aspect ratio. It is able to draw two bars on top of each other. The two bars are independent of each other. In the HMI this object is colored by drawing the background first and then bar one and after that bar two. When the two bars overlap each other, the second bar is in the foreground. A scale can be shown, too. In case of a horizontal bar the scale is depicted above the bar, otherwise it is depicted left of the bar.


In the parameter dialog a HMI object of the type "bargraph (segmented)" is assigned to the function block.

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 with the help of the mask designer.

In the parameter dialog of the object, the display style (with frame, no frame, raised, and recessed) can be selected. The colors of the different elements of the object can be configured. This includes a specific display to indicate a value overflow. Additionally the minimum and maximum value can be given. Finally the features of the scale can be configured.


Name I/O Type(s) Function
bShow I BIT Show/hide object
lPosB1 I LONG Start position bar 1
lLenB1 I LONG Length bar 1
lPosB2 I LONG Start position bar 2
lLenB2 I LONG Length bar 2
lClrB1 I LONG Color of bar 1
lClrB2 I LONG Color of bar 2

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.


The inputs lPosB1 and lLenB1 or lPosB2 and lLenB2 have to be connected/not connected as pairs.