Skip to main content

Display Remotely Sampled Data as HMI in a Visualization

With an HMI project, you can display in a visualization remotely sampled data locally in an HMI user interface.

To do this, you use a trace element in the local HMI visualization. The trace element displays data that was transferred via a data source. The remote device is connected by a data source with the data source type CODESYS ApplicationV3. It is not possible to transfer trace data over a connection of data source type CODESYS Symbolic. The logical connection to a remote application is determined in the Data source property and Application. Moreover, you configure a user input so that the HMI user can control the data sampling.

When downloading the local HMI application, the trace configuration that you configured for the trace element is downloaded to the remote device where ideally the remote application is running. When the local application starts, the remote data sampling starts automatically on the remote PLC with the bus cycle time configured there. It is buffered remotely in the trace buffer. Parallel to that (but asynchronously), the trace data is transferred to the HMI application to be displayed in the local visualization.

The data sampling is configured in the local application and controlled by user inputs from the local HMI visualization.

Tip

Note that the data sampling runs in the remote application.

Connecting an HMI application to a controller

  1. Open the initially created HMI project.

  2. Select the Data Sources Manager object.

  3. Click Add Object → Data Source.

    The Add Data Source dialog opens and helps you to configure the data source. The CODESYS Symbolic data source type is set by default.

  4. Select the data source type CODESYS ApplikationV3.

  5. Specify a name for the data source. Example: Data_Source_Trace and click Add.

    The Initialize Data Source Wizard – Provider settings dialog opens.

  6. Select the Current project option for Select project type.

  7. For Select file, click the _svn_button_three_dots.png symbol.

  8. Select the project file with the remote application.

    The connection from the development system to the controller is established and data is transmitted. The Initialize Data Source Wizard – Provider settings dialog opens. The applications of the remote PLC_A controller that is accessed are listed. In the Target Device group, the communication settings are displayed that were taken from the project.

  9. Click Next.

    The dialog Initialize Data Source Wizard – Browse data items shows the variables that can be accessed.

  10. Click Finish.

    The data source is created initially and inserted below the data source manager.

Creating visualizations with trace

  1. You create your visualization as usual: Open the editor for the visualization and add the Trace element.

  2. Configure the trace element in the Properties view:

    In the Data source property, click the _cds_icon_arrow_down.png symbol, select the data source (example: Data_Source_Trace), and press the Enter key to complete the selection.

    The additional Application property is displayed below the Data source property.

  3. Click into the field and then click the _cds_icon_arrow_down.png symbol.

    All applications of the data source are listed.

  4. Select the application that contains the data you want to record.

  5. Click in the value field of the Trace property.

    The Trace Configuration dialog opens.

  6. In Recording Settings, in the Task setting, click the _cds_icon_arrow_down.png symbol.

    The tasks that are configured in the remote application are listed.

  7. Select the task where the data is processed. This is usually the MainTask.

  8. In the variable settings for the Variable setting, click the _svn_button_three_dots.png Add Variable symbol and select a variable in the Input Assistant dialog. Click OK to close the prompt.

  9. Click OK to close the trace configuration.

  10. Select the trace element and click Visualization → Insert Elements for Controlling Trace.

    The Trace Wizard dialog opens.

  11. Activate all options and close the dialog.

    Additional buttons are added below the trace element for configuring the user input for data sampling.

  12. Configure the buttons.

    The data sampling is configured.

Running the HMI application

Requirement: The application is running currently on the remote PLC.

  1. Click the _cds_icon_build.png symbol.

    The application is compiled.

  2. Click the _cds_icon_login.png symbol.

    The application is downloaded to HMI device. The connection to the remote PLC is established and the trace configuration is transferred.

  3. Click the start _cds_icon_start.png symbol.

    The HMI application is executed. The visualization starts.

    The trace element displays the recorded data of the remote PLC.