The variables that are listed in the data source editor of the “Variables” tab (and declared in the “DataSources_Objects” folder) can be used in your application like IEC variables. For example, you can visualize the variables.
If multiple data sources are available and therefore conflicts occur regarding unique variable names, then you must specify the data source name as the prefix. If no conflicts occur, then this is not necessary and you can map the variables without a data source prefix.
<data source name>.<function block name>.<variable name>
Displaying variable values from the remote device
You need to show the variable value iTemp
of a remote device in a visualization element of a visualization in the local application
(with the data source manager).
Initial situation: A data source dsRemotePLC
is below the local data source manager where the connection to the remote device
is configured. In addition, the variable iTemp
is selected in the data source editor of the “Variables” tab.
-
Select the visualization element in the editor view. Select the properties “Text variables” - “Text variable” in the “Properties” view.
-
Select the
iTemp
variable.The variable mapping is qualified. Example:
dsRemotePLC.PLC_PRG.iTemp
. -
Select the “Text” property of the visualization element and type in the following:
Temperature: %s
The value of the
iTemp
variable from the remote deviceRemoteDevice
is displayed. -
Download and start the remote application.
-
Download and start the local application.
The visualization starts and displays the actual value of
iTemp
.




NOTICE

The visualization integrated in CODESYS does not display actual values of variables that are transferred by means of a data source connection. The integrated visualization displays only the initialization values or the last otherwise delivered values because they do not establish a connection to the data sources.




NOTICE

If variables are used that are not called in the visualization code, then the variables must be updated in the application code by means of functions from the data source interface.