Getting Started with Trend Visualization

When you execute a trend, it is best to proceed with user guidance and the help of the trend wizard.

  1. Create an empty standard project and program at least one variable into PLC_PRG.

    PLC_PRG is declared and implemented

  2. Add the Visualization object to the device tree below Application.

    An empty visualization appears.

  3. Open ToolBox ‣ Special control elements.

  4. Drag the Trend element to the visualization

    The Trend recording dialog opens with the Recording settings.

  5. Select the task in which the trend recording will be executed.

    Note

    In general the trend recording runs in the same task as the main program, i.e. PLC_PRG.

    Therefore, select MainTask.

  6. Add a trend variable with Add variable and assign an IEC variable from PLC_PRG to the trend variable.

  7. Click OK to close Trend configuration.

    There is a newly created object of the type Trend recording under Trend recording manager. The active visualization contains a trend element that is selected.

  8. Click Visualization ‣ Insert elements for controlling trend elements.

    The Trend wizard dialog box opens.

  9. By default, all three control elements are activated in the dialog. Click OK to close the dialog box.

    The active visualization contains a trend with control elements.

  10. Set the application containing the trend objects to active.

  11. Compile the application with F11.

  12. Click Online ‣ Login.

  13. Start the application with F5.

    The target visualization appears. The visualization contains the trend diagram with the value curve of the variable. The control elements enable user inputs.

See also

Example: Visualization of the sinusoidal trend of an IEC variable.

The following objects are implemented in the project:

  • PLC_PRG
  • Visualization_Trend1
  • VisuWithTrend

PLC_PRG

PLC_PRG runs as part of the application on the controller.

PROGRAM PLC_PRG
VAR
\ iVar : INT;
\ rSin : REAL;
\ rVar : REAL;
END_VAR

iVar := iVar + 1;
iVar := iVar MOD 33;

rVar := rVar + 0.1;
rSin := 30 * SIN(rVar);

Visualization_Trend1

Visualization_Trend1 is the object that contains the configuration of the trend recording.

../_images/95e51f3d884e4cc8c0a8640e01ee2ff6

VisuWithTrend

VisuWithTrend is the object that visualizes the trend.

The visualization contains four elements: one trend and three control elements. The properties of the trend are defined as follows.

Properties Value
Trend recording Visualization_Trend1
Display cursor ../_images/9a3f06830c0506c5c0a8640e012f0ace
Display tool tip ../_images/9a3f06830c0506c5c0a8640e012f0ace
Show frame ../_images/9a3f06830c0506c5c0a8640e012f0ace
Date range picker c9c33cc577e8a9cac0a8640e0165d840_ece652a41b00faa9c0a8640e01708d9d Trend1DateRangeSelector
Time picker c9c33cc577e8a9cac0a8640e0165d840_b7eb3e101b006952c0a8640e019b0c65 Trend1TimeSelector
Legend c9c33cc577e8a9cac0a8640e0165d840_5bd6a7731b02f2ddc0a8640e0086f5a2 Trend1Legend

VisuWithTrend at runtime

../_images/c613608569ae1b44c0a8640e00454db7