Create a project with the following program PLC_PRG
:
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);
-
In the device tree, select the application and add a new visualization by clicking “Project Add Object Visualization”.
The corresponding visualization editor opens.
-
Add the “Visualization” object to the device tree below “Application”.
An empty visualization appears.
-
Click “ToolBox Special Controls”.
-
Drag the “Trace” element to the visualization editor.
The properties of trend element are displayed on the right side.
-
Click the
symbol in the “Trace” property.
The “Trace Configuration” dialog opens.
-
Click “Add Variable” to add an entry to the tree view of the trace configuration and select a project variable (for example,
PLC_PRG.rSin
). -
Click the top node of the trace configuration.
The group “Record Settings” is shown on the right.
-
Select the
MainTask
option for the “Task” setting.Hint: The trace record and the corresponding program should be executed in the same task.
-
Click “OK”.
The task configuration is applied.
-
Select the trace element and click “Visualization Insert Elements for Controlling Trace”.
The “Trace Wizard” dialog opens. By default, all controls are activated there.
-
Click “OK” to exit the dialog.
The controls are added to the visualization and the control variables are declared. Then the controls and the trace element are configured with the control variables.
-
Download the application to the controller and start it.
-
Example