Trend

../_images/0c8517e753ca9c160a317f34219bd24b

The Trend element can be used to log the time dependent behaviour of variable values in the online mode. The online presentation is done in a diagram, in case of logging to a text file each of the values is written to a separate line.

In the dialog for configuring visualization elements in category ‘Trend’ you can do the following settings :

  • Curve: X/t, horizontal axis = time axis, vertical axis = scale of values

  • Orientation: Left-right or Right.-left: The latest value will be displayed on the left/right side;

  • Axis:

    • Horizontal Axis (see Trend)
    • Vertical Axis (see Trend)
  • Recording: Define here whether the trend should be recorded ‘only online’, i.e. the time dependent behaviour of the variable values will be displayed using the chosen range of the scale, or whether the record should be saved to history file, which can be configured after pressing the button History. The dialog corresponds to that which is used for the configuration of the alarm log file.

    In the log file for each time of measurement a separate line is written which contains the name and the values of all regarded variables. Each line starts with a unique identifier in DWORD format, which is built from the date of measuring.

  • Choose variable (see Trend)

  • Curve configuration (see Trend)

Horizontal Axis

../_images/742f18e853ca95710a317f347f09e845
  • Division lines: Activate option ‘visible’, if vertical division lines should be displayed which are elongating the scale marks. In this case define the ‘Scale’: The given number defines the interval between the division lines on the horizontal axis. Type (normal ___, dashed _ _ _, dotted ….., dashdotted _ . _ .) and color of the lines can be defined in dialogs which will open when you perform a mouse-click on the corresponding rectangle showing the currently set line type resp. color.
  • Scale: The shown range of the scale is determined by the entry for Duration. If here e.g. ” T#20s0ms” is defined, the scale will display a period of 20 seconds. The Main division and the Sub scale division, which will be displayed by the means of long and short marks are to be defined according to the same syntax.
  • Degree of accuracy: Define here (in the standard format for dates, e.g. T#5ms) the interval for displaying the current values of the variables.
  • Legend: Here you define the display of the legend. Via button Font the standard or a target-specific restricted dialog for setting the font will be opened. At Scaling define the distances between the particular letterings on the scale (e.g. T#4ms, if the scale markings should get a lettering each 4 milliseconds). The lettering will contain the Time and/or Date, depending on which options are activated. The desired format each can be defined in the field ‘Format’. Regard that you can either set the 12-hour format (“hh”) or the 24-hour format (“HH”).
  • Variables: Here you can define project variables, which contain the zoom values resp. offset values for the horizontal scale. For example the offset of the display range of the horizontal axis will be set to “10” as soon as the variable assigned here gets value 10.
  • Symbol bar: If option use is activated, at the bottom of the element a horizontal symbol bar will be added, providing buttons for scrolling and zooming in online mode. The simple arrow buttons will move the displayed range along the time axis step by step, the double arrow buttons will shift it to the end resp. start of the record. The zoom buttons allow a zooming of the horizontal scale step by step. To get a possibility to restore the original settings concerning zoom and offset, define the vertical symbol bar to get the ‘home’ symbol.

Vertical Axis

../_images/c3f1228753ca984e0a317f346b115d78
  • Dialog for configuration of the vertical axis in the trend element
  • Division lines: corresponding to the horizontal axis (see above)
  • Scale: Define whether the scale should be displayed at the left or right border of the trend diagram. Choose the Start value (lower end) and End value (upper end) of the scale as well as the Main and Sub scale divisions (longer and shorter markings will be displayed in the here defined distances).
  • Legend: Font and divisions; see above, horizontal axis
  • Variables: see above, horizontal axis
  • Symbol bar: see above, horizontal axis, additionally there is a “home” button for restoring the standard settings concerning zooming and offset of the axes.

Choose variable

Choose variable: Press this button to get the dialog Variables, where you can configure the variables for which the trend record should be done and how they should be displayed:

../_images/3d823fb253caa05a0a317f343a5cef43

Enter a project variable in column Variable (mouse-click on the field will open an edit frame). It is recommended to use the input assistant <F2> or Intellisense function.

Color and Line type for the display of the variable in the record you can define by a mouse-click on the corresponding field in column Color (the standard dialog or a target-specific color selection list) resp. by selecting a line type in the corresponding field of column Line type (normal ___, dashed _ _ _, dotted ….., dashdotted _ . _ .).

In column Marker you can define a variable, which will provide the currently recorded value when you use the marker function in online mode. The marker will be displayed as a little grey triangle in the upper left corner of the diagram. If you click on the triangle and keep the mouse-button pressed, you can shift a vertical marker line along the horizontal time axis. The variable defined as ‘marker’ then will read the corresponding value from the record curve of the associated project variable.

Do the settings for all variables you want to record. Via button Add a further line will be added at the end of the list. A line can be deleted by button Delete.

Curve configuration

Curve configuration: This button opens the dialog Curve configuration. Here some settings concerning the trend curves can be done:

../_images/9cadf3d253ca9a510a317f34538890ae

Curve type: Select one of the options Straight line, Steps or Points. For the first two types the display of Additional points can be defined. For displaying a point a bitmap can be defined, otherwise a filled rectangle (same color as curve) will be used as point symbol. Press the rectangle next to Bitmap to get the standard dialog for selecting a bitmap file. Via Delete the currently set bitmap can be removed from the configuration.

Tolerance band: You can define an upper and lower limit value on the vertical axis to be displayed as a tolerance band. For each band a color (Press the color rectangle to get the default resp. target-specific selection dialog) can be defined. If the bands should be displayed in online mode, activate option Tolerance band as line. If you want the curve to get displayed in the color defined for the respective band as soon as exceeding the tolerance value, activate Curve color outside tolerance like tolerance band. Activate Both or None if you want to activate both or none of the above described display options at a time.

Example: Display of a trend element in online mode

Declaration in program PLC_PRG:

VAR

n: INT;

rSinus:REAL;

rValue:REAL;

rSlider1:REAL; (\*for marker function\*)

rSlider2:REAL; (\*for marker function\*)

END_VAR

Programmteil von PLC_PRG:

n:=n+1;

rValue := rValue + 0.01;

rSinus:=SIN(rValue)\*50 + 50;

IF n>100 THEN

n:=0;

END_IF

Configuration of a trend element in a visualization:

Orientation Left-Right, History activated

Horizontal axis: Division lines: T#2s, Duration: T#10s, Main: T#1s, Sub scale: T#500ms, Degree if accuracy: T#200ms, Legend: Time Format (‘HH’:’mm’:’ss’), Scaling T#2s. Symbol bar activated.

Vertical axis: Division lines visible, Scale: 10, dotted, grey; Scale left, Start: 0, End: 100, Main: 10, Sub scale: 5; Legend: 10; Symbol bar activated.

Variables:

1. Variable PLC_PRG.rsinus, blue line, Marker: PLC_PRG_TRD.rSlider1;

2. Variable PLC_PRG.n, red line, Marker: PLC_PRG_TRD.rSlider2

Curve configuration: Straight line, no tolerance band

Configuration of two display fields for the current record values provided by the marker variables:

Rectangle element 1: Category Text: insert “%s” in the Content field; Category Variables: insert in field Textdisplay: PLC_PRG.rSlider1

Rectangle element 2: Category Text: insert “%s” in the Content field; Category Variables: insert in field Textdisplay: PLC_PRG.rSlider2

(additionally insert a rectangle element at the left border of the rectangle elements 1 and 2, showing the curve color of the corresponding record variable)

Result in online mode after login and start of the program:

../_images/565ad67253ca9e470a317f3475aec91d

The record is running from the left to the right; the latest value is shown on the leftmost position; every 200 milliseconds the current value will be added to the display. The arrow buttons in the symbol bars allow shifting the displayed time range. Using the simple arrow buttons you can shift step by step, using the double arrows you get to the end resp. start of the record.

For example: if you go to the start of the record by pressing the double arrows pointing to the left, you get a still display of the former values. If you then move the marker (grey triangle in the upper left corner) along the time axis, you can read the exact values of each of the both recorded variables for each time in the rectangle elements below the diagram.