Bar trend

Bar trends are used for displaying the values of different data. These values can be visualized in a variety of bar chart or curve formats, with a choice of four different bar charts and one curve display (3 curve types).

Trend types

The bar trend can be displayed in different ways and used for different purposes, depending on the trend type. What all displays have in common is a fixed X/Y scale. In addition, grid lines and scale labels are possible, as well as a one-dimensional array allowing grouping of values.

Bar

The X/Y values mark the corner points of the bars. Each bar can be displayed differently (individual width, color or adjacency). Marking with a horizontal line is possible. The following array will be interpreted:

{
dyn_float x1, dyn_float x2, dyn_float y1, dyn_float y2, dyn_string Color1, dyn_string Color2
}

This trend type can be used to display different control variables. The bar shows the set point value, while another line marks the actual value, for example, you could display different bolt widths or different temperatures.

Bar array

Only y-values are passed in this case. The bars all have the same width and are right next to each other. The bars begin at a start value on the x-axis. The x-axis has a specified length and is divided up according to the number of y-values. The common base line for the bars can have any value on the y-scale. Unlike the bar trend type, each bar has the same display format. The following array will be interpreted:

{
dyn_float y
}

Example: Measuring the profile thickness of a foil sheet.

You can also set the start value and bar width parameters (representation tab).

Elemental Array

Element array, once again, only y-values will be passed:

  • mean value + minimum + maximum

  • mean value + standard deviation

The bars all have the same width and are right next to each other. The bars begin at a start value on the x-axis. The x-axis has a specified length and is divided up according to the number of y-values. A horizontal line, across the width of the bar, is also possible as a form of marking. The following array will be passed:

{
dyn_float y_mean, dyn_float y_max, dyn_float y_min, dyn_float y_s
}

Example: Foil thickness profile measurement with minimum, maximum and mean or mean and standard deviation.

These parameters will be passed when you set them in the Representation tab under Value representation:

Figure 1. Representation tab for an element array
  • Start : specifies the start value on the x-axis
  • Bar width : Specifies the bar width.
  • Display : a combo-box allowing you to select which mean value option to display: "only average value" (only mean value displayed), "Min. and Max" (minimum and maximum values displayed) and "S" (standard deviation displayed).
  • Width top, Width bottom : The bars can have different widths at the top and bottom. You can specify these widths here.
  • Color: specifies the color for the bar sections. Average is the color of the mean value, Bottom the color of the bar below the mean value and Top the color of the bar above the mean value.

Dynamic colors can not be displayed inside the bar trend widget and so they can not be used!

Time element array

Basically works in the same way as the previous trend type. Only y-values will be passed:

  • mean value + minimum + maximum
  • mean value + standard deviation

In addition, there are time and length stamps. The bars all have the same width and are right next to each other. The bars begin at a start value on the x-axis. The x-axis has a specified length and is divided up according to the number of y-values. A horizontal line, across the width of the bar, is also possible as a form of marking. The following array will be passed:

{
dyn_float y_mean, dyn_float y_max, dyn_float y_min, dyn_float y_s, dyn_int time, dyn_int length 
}

Example: Foil profile thickness as a function of time.

You can make the same parameter settings in the Representation tab as were possible for the element array. You cannot however specify the start value for the x-axis, since this is the time axis in this case.

Curves

All curves interpret an array whose elements each contain a value pair X/Y. The following array will be passed:

{
dyn_float x, dyn_float y
}

You can obtain different curve types depending on the method chosen to link the individual points defined by the value pairs:

  • Step function
  • Linear
  • Spline function

Example: A row of sensors along a measurement length measures different values that should lie within a given range.

The curve type, color settings and so on are made in the Representation tab.

Dynamic colors can not be displayed inside the bar trend widget and so they can not be used!

Figure 2. Representation tab

Creating a trend

In the following example, a bar trend of type bar will be created.

To create a new bar trend

  1. Click on the bar trend icon in the tool bar
  2. Click in the panel and drag a border with the mouse key held down.
  3. The Bar Trend editor opens, with the Common tab displayed.

Figure: Common tab under Bar Trend

  • Trend type: Select the required display format from the combo box.
  • Vertical and horizontal lines : assign the line color, style and width here. The buttons open the relevant editors.
  • Reference : With Position you can define the reference line for the trend. The reference line can be located above, below or in the middle of the y-scale, or it can refer to the mean value of all the y-values. With value you can set any value on the y-scale to be the reference point.
  • Lower toler. limit, Upper toler limit : enter tolerances here that will cause the bar to change color if values over or undershoot them. If the position of the reference line on the y-scale is not 0, the values will be interpreted as a percentage of the reference line position, otherwise they will be treated as absolute values.
  • Change color according to value and tolerance range (of the bar): assign colors to the bar areas. The buttons open the color editor.
  • Color change applies to : Specify whether the color of the entire bar or just a part of it, changes when a value over or undershoots the set tolerances.

This tab is the same for all trend types. The other tabs all contain different settings options depending on the selected trend type.

  1. Select the Bar trend type
  2. Select the solid line type with the color blue.
  3. Enter the position and tolerance ranges as shown in the screenshot.
  4. Select "part of bar" for "Color change applies to"
  5. Click on the Representation tab

Representation tab

In this tab you can assign so-called arrays.

Arrays can be used to display a graphics element that groups areas on the x-axis with the boundaries of each area shown. The following array will be read:

{
dynfloat x, dyn_string color, dyn_string label
}

Grid lines can be drawn based on the area boundary lines.

Figure 3. Representation tab under Bar Trend
  • Display value field : Displays an array if this option has been checked.
  • Height : Specifies the height of the graphic element.
  • Position : Selects the top or bottom position for the graphics element.
  • Font : opens the editor for selecting the font required
  • Draw grid : draws a grid based on the boundary lines of the area defined by the array
  • Line color and Line style : Defines the line color and style required for your area grid.
  • Value representation : Specifies the bar width and start point, mean value and so on for the bar array, element array and time element array trend types. For curves, specifies the curve type, color, line width and style. Value representation is not relevant for the bar trend type.
  1. As shown in the screenshot, enter 20 for the height of the array under Height.
  2. Select Top for the position.
  3. Click on the Scales tab

Scales tab

This is where you can define the font, color, scale markings, origin and range of your x- and y-scale.

Figure 4. Bar Trend - Scales tab
  • Origin : specifies the numerical value of the x-scale on the fixed scale span
  • Position : specifies the position of the x-scale origin on the fixed scale span
  • Range : specifies the number of scale divisions
  • Step : specifies the number of scale divisions between labelling points.
  1. Select 0 for the origin and Left as the position of the x-scale origin.
  2. Enter the values for Range and Step as shown above.
  3. Select 0 as the origin and Middle as the position of your y-axis.
  4. Enter the values for Range and Step as shown above.
  5. Select the options Draw grid in both cases.
  6. Click on Close

A double-click on the bar trend in the panel during engineering opens the Bar trend configuration panel.

By default only the value range 7.5 to 12.5 of the Y-scale are visible. To display values outside of this range the visible range needs to be adjusted! (see described panel above).

Configuration of the bar trend

In order for your bar trend to also display values, you must link it to the data points providing the values. The "flush" attribute is also important for the bars to actually be filled with color. The trend above of type bar is started with the following script:

Example script for bar trend

main()
{
  dpConnect( "work", "ExampleDP_bt.x1:_original.._value",
  "ExampleDP_bt.x2:_original.._value", "ExampleDP_bt.y1:_original.._value",
  "ExampleDP_bt.y2:_original.._value"); 
}
work(string dp1, dyn_float x1,
string dp2, dyn_float x2,
string dp3, dyn_float y1,
string dp4, dyn_float y2 )
{
  dyn_string col1, col2;
     string s;
     int i;
     int n = dynlen( x1 );
     for(i = 1; i <= n; i++ )
  {
    col1[i] = "";
    col2[i] = "green";
  }
  setValue( "bar", "data", x1, x2, y1, y2, col1, col2 );
  setValue( "bar", "flush" );
}

In CTRL you can set the attributes of the bar trend using Bar trend. Note that depending on the example you have to set different value ranges in the trend editor (how to set the value range, see figures above).