Displaying Array Data in Histograms

Setting element properties for histograms

  1. Double-click the Visualization object in the device tree.

  2. In the ToolBox view, click Measurement controls and drag the Histogram element to the visualization editor.

  3. In the visualization editor, click the inserted Histogram.

    The Properties view opens.

  4. In the Properties view, double-click the Value input field in the Data array element property. Then click ee0b322b075e83b8c0a8640e01384c92_eb671bf522752375c0a8640e00296a93 .

  5. In the Input Assistant dialog box in the Variables category of the PLC (PRG) program, select the array (example here: histogram : ARRAY[1..10] OF INT;) and click OK.

  6. To display only part of the array as a histogram, activate the Use subrange option and specify the index values of the array in Start index and End index to define the subrange.

  7. Select the Display type (example: Bar).

  8. Specify a value between 1 and 100 (example: 30) for the Relative bar width.

  9. Click the histogram in the visualization editor and change the size and position as desired.

    The Position property changes its values accordingly.

  10. Specify the values for the Scale element property. Select the values for Scale start and Scale end so that the array is displayed completely. For the example: Scale start0, Scale end50.

    For the distance between values on the rough scale, specify the value 10, for example, in Main scale.

  11. In the Label element property, specify the Unit for the display values.

  12. Click Build ‣ Build.

  13. If the project has been compiled without errors, then click Online ‣ Login and start the application by clicking Debug ‣ Start.

    The histogram is displayed in the visualization as follows:

    ../_images/73b95eeb4b96982cc0a8640e017c62da

Defining alarm colors for the histogram

  1. Click the element property Colors ‣ Alarm color.

  2. Specify the limiting value in Alarm value above or below which the bars should be displayed in another color.

  3. Select More from the drop-down list in Alarm condition if all values greater than the Alarm value should be displayed in another color. Otherwise, select Less.

  4. Select an Alarm color (example: Red).

  5. Click Build ‣ Build.

  6. If the project has been compiled without errors, then click Online ‣ Login and start the application by clicking Debug ‣ Start.

    In the example histogram, all bars with values greater than 30 are displayed in red.

    ../_images/e01121314bc82e01c0a8640e014ae61e

See also