Getting Started with Trace
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
.The corresponding visualization editor opens.
Add the Visualization object to the device tree below Application.
An empty visualization appears.
Click
.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
.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
PLC_PRG.rSin
The PLC_PRG
program is running on the controller. When you follow the "Getting Started" instructions, the following interface is displayed:

You can control the trace record by clicking the buttons.