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 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
Open the initially created HMI project.
Select the Data Sources Manager object.
Click
.The Add Data Source dialog opens and helps you to configure the data source. The CODESYS Symbolic data source type is set by default.
Select the data source type CODESYS ApplikationV3.
Specify a name for the data source. Example:
Data_Source_Trace
and click Add.The Initialize Data Source Wizard – Provider settings dialog opens.
Select the Current project option for Select project type.
For Select file, click the
symbol.
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.Click Next.
The dialog Initialize Data Source Wizard – Browse data items shows the variables that can be accessed.
Click Finish.
The data source is created initially and inserted below the data source manager.
Creating visualizations with trace
You create your visualization as usual: Open the editor for the visualization and add the Trace element.
Configure the trace element in the Properties view:
In the
property, click thesymbol, 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.
Click into the field and then click the
symbol.
All applications of the data source are listed.
Select the application that contains the data you want to record.
Click in the value field of the Trace property.
The Trace Configuration dialog opens.
In Recording Settings, in the Task setting, click the
symbol.
The tasks that are configured in the remote application are listed.
Select the task where the data is processed. This is usually the
MainTask
.In the variable settings for the Variable setting, click the
Add Variable symbol and select a variable in the Input Assistant dialog. Click OK to close the prompt.
Click OK to close the trace configuration.
Select the trace element and click
.The Trace Wizard dialog opens.
Activate all options and close the dialog.
Additional buttons are added below the trace element for configuring the user input for data sampling.
Configure the buttons.
The data sampling is configured.
Running the HMI application
Requirement: The application is running currently on the remote PLC.
Click the
symbol.
The application is compiled.
Click the
symbol.
The application is downloaded to HMI device. The connection to the remote PLC is established and the trace configuration is transferred.
Click the start
symbol.
The HMI application is executed. The visualization starts.
The trace element displays the recorded data of the remote PLC.