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);

  1. In the device tree, select the application and add a new visualiza­tion by clicking Project ‣ Add object ‣ Visualization .

    ⇒ The respective visualization editor opens.

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

    ⇒ An empty visualization appears.

  3. Open ToolBox ‣ Special control elements .

  4. Drag the Trace element to the visualization editor.

    ⇒ The element properties are displayed on the right side.

  5. Click the symbol _visu_icon_trace.png in the Trace property.

    ⇒ The Trace configuration dialog opens.

  6. 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).

  7. Click the top node of the trace configuration.

    ⇒ The group Record Settings is shown on the right.

  8. Select the MainTask option for the Task setting.

    Tip: The trace recording and the corresponding program should be executed in the same task.

  9. Click OK.

    ⇒ The task configuration is applied.

  10. Select the trace element and click Visualization ‣ Add elements for trace control

    ⇒ The Trace wizard dialog opens. By default, all control elements are activated there.

  11. Click OK to close the dialog.

    ⇒ The control elements are added to the visualization and the control variables are declared. Then the control elements and the trace element are configured with the control variables.

  12. Download the application to the controller and start it.

Example

 

Record the sine-shaped data of the IEC variable PLC_PRG.rSin

The PLC_PRG program is running on the PLC. When you follow the "Getting Started" instructions, the following interface is displayed:

_visu_img_trace_example.png

You can control the trace recording by clicking the buttons.

See also