Editing Data Source Variables
At runtime, the remote data is saved to the data source variables. The data source variables and their mapping to the remote variables are displayed in the data source editor below of the Variablen tab. If the local and remote variables have the same names and the same data types, then the data is mapped 1:1. The variables and the data types are created automatically. That is the regular procedure.
You can also map to existing variables. This is necessary, for example, if a visualization includes a data type in an interface. Then the same data must be passed to this visualization. In this case, the declared local variable and the remote variable have the same data type, for example from one library. Moreover, you can map a local variable with a conforming data type to a remote variable. The data type can be created on the Type Mappings tab.
The specifically created variables and data types are declared in the DataSources_Objects folder. For each data source, a global variable list of the same name as the data source is declared there. Moreover, the data source variables usually have the identical or type-compliant data type as the remote control variable and they are declared as user-defined data types (DUT objects). Considering all data sources, multiple declaration of the same data types is avoided.
Do not edit the data interface in the DataSources_Objects folder manually. It is created initially when adding a data source. Changes can be made later in the editor of the data source.
For more information, see: Updating the Data Interface
Selecting variables for data transfer
You can edit the selection of the data source variables.
Requirement: The remote device and its application are running. A data source manager is already inserted below the local application with a data source.
Open the editor of the data source.
Select the Variables tab.
Click Update Variables.
The Browse Variables dialog opens.
Activate the variables that should be transferred and click OK to close the dialog.
The data source variables are modified according to the selection. The declaration of variables and data types is also modified.
The Variables tab shows the modified selection. Moreover, the mapped remote variable is listed in the Remote variable column.
Mapping remote variables to a new variable

You need to map a remote variable to a global implicit variable that is created new. That is the regular procedure for transposing data source to 1:1.
Requirement: A project is open. A data source manager and a data source below it are located in the device tree of the local application.
Open the editor of the data source.
Select the Variables tab.
The data source variables are listed.
Select a variable and click the
symbol in the Create or map column.
Specify a name in Local variable.
A variable is declared automatically and it contains the same value as the mapped remote variable.
Mapping remote variables to an existing variable

You need to map a remote variable to an existing variable.
Requirement: A data source manager and a data source below it are located in the device tree of the local application. The remote data that should be transferred is displayed in the editor of the data source in the Variable tab.
Open the editor of the data source.
Select the Variables tab.
Select a variable and click the
symbol in the Create or map column.
A variable contains the same value as the mapped remote variable.
Mapping remote variables to local variables with a conforming data type

First, create a conforming data type and then use it for a variable.
Requirement: A data source manager and a data source below it are located in the device tree of the local application. The remote data that should be transferred is displayed in the editor of the data source in the Variable tab.
Open the editor of the data source.
Select the Type Mappings tab.
Select the data type in the list that you want to edit.
The elements of the data type are listed in the window below the data type list.
Specify a name for the data type. Example:
DataType_A
. Select the name for the remote data types to which the local type should conform.Example:
Library1.DataTyp_A
Modify it in the window below the data type list and remove the elements that are not necessary for the data transfer.
Click the
symbol for this data type in the Create or map column.
The data type
DataType_A
is declared in the DataSources_Objects folder.Select the Variables tab.
Specify a name in the Local variable column. Example:
Var_A
Click the
symbol in the Create or map column.
Specify the data type
DataType_A
in the Mapping type column.Select the remote variable with the data that should be transferred. Example:
appPLC_A.Data_A
. Use the input assistance for this.A variable
Var_A
is declared automatically with the user-defined data typeDataType_A
. During data transfer, it receives the data of the mapped remote variables.
Example
SnakeUtil
The example demonstrates how variables of the data source are created. At this time, new variables are created, data is mapped to existing data types and their variables, and new data types are created with type-conforming mapping.
The remote PLC uses POU instances from the SnakeUtil
library and the HMI device displays these POU instances. This is why the HMI application requires a variable in the user interface that has a data type appropriate for a visualization template. As a result, the SnakeUtil
library is linked integrated into the HMI application and the HMI variables instantiate the SnakeUtil.SnakeVisu
visualization function block.
SnakeUtil
library are used in the remote PLC:SnakeUtil.Snake
function block: Equipped with a lot of logic and calling from external functionsDUT
SnakeUtil.PositionInfo
: Two values (of the variables x and y)DUT:
SnakeUtil.DrawingInfo
: Image IDThe
SnakeUtil.SnakeVisu
visualization function block with transfer parameterSnakeUtil.Snake
displays theSnake
function block.
The following settings are entered in the editor of the Type Mappings tab:

In the visualization, a frame is inserted with a reference to SnakeUtil.SnakeVisu
. This expects to have the type SnakeUtil.Snake
.
The SnakeUtil.PositionInfo
and SnakeUtil.DrawingInfo
data types are mapped to existing data types ( symbol in the Create or map column). The data types are small and contain data only.
The SnakeUtil.Snake
function block is very complex and calls external functions that are not available in the HMI visualization. The function block with code is not required in the visualization. You need a less extensive but compatible and conforming type in the HMI visualization. Therefore, do not create the original data type directly. Instead, first modify the original data type and remove the unnecessary elements. In the Create or map column, then click the symbol to create the new
Snake
data type.