In order to have read/write access to the remote devices and their running applications, you can add a data source manager to your application with one or more data sources.
The functionality of the data source manager allows for establishing connections and communication to remote devices, and it makes its data available through data source variables. At this time, the partners communicate by means of a point-to-point connection. Depending on the network where the controllers are located, a connection is established via the CODESYS data source types or CODESYS ApplicationV3.
Data source type CODESYS Symbolic
The data source type CODESYS Symbolic is available only together with a CODESYS HMI device. However, then it is advantageous to use this type.
Below a CODESYS HMI device, you can configure the data link either with data source type CODESYS Symbolic or with data source type CODESYS ApplicationV3. We recommend that you select the data source type CODESYS ApplicationV3 only when there are no resources for the symbol configuration available on the remote device. For example, this is the case with embedded or mini PLCs whose applications often do not contain a symbol configuration.
The requirement for a connection setup is that symbols have been configured in the remote device and as a result a symbol file exists. The application in the remote device has a symbol configuration. Then the data link can take place via symbolic monitoring.
In the case of symbolic monitoring, the symbol file on the remote device is read and the stored variable information is used for the data source variables and the data transfer. The advantage is that the application does not have to be updated in the local device when someone modifies the remote application without updating its symbol configuration. If the symbol file is also located on your development system (either a file or a symbol configuration object as part of your project), then the local symbol file can also be read. Then you can work offline during the development phase.
During the development phase, you can create a variable list offline by means of local symbol configuration files. In this way, you can develop a local application offline based on the symbol information without a connection to a data source.
The following connection types are possible:
-
“CODESYS V2”:
The devices exist in the same network. The V2 runtime on the remote PLC provides a communication interface.
-
“CODESYS V2 (Via gateway)”
The devices do not exist in the same network. They are connected via a V2 gateway.
Note: For this connection, a “CoDeSys V2.3 Gateway Server” (V2 gateway) has to be installed on the development computer where CODESYS V3 is running.
-
“CODESYS V3”
The devices exist in the same network. The V3 runtime on the remote PLC provides a communication interface.
-
“CODESYS V3 (Via gateway)”:
The devices do not exist in the same network. They are connected via a V3 gateway.
Data source type CODESYS ApplicationV3
This data source type is available below all device types.
The data link with CODESYS ApplicationV3 data source type in done by means of address monitoring. This requires that the address information between the remote PLC and the local device match. The runtime system of the local application needs valid communication parameters in order to establish the connection.
The network scan function can support you when configuring the data source.
Disadvantage: If you modify the remote application, then you also have to update the local application afterwards (for example, the HMI application.
The advantage is that a symbol configuration is not required in the remote application.
Data transmission
At runtime of the local application, the data source variables that appear in the data source editor of the “Variables” tab are updated in configurable time intervals. The remote application is also executed at this time. Variables that are configured in the visualization, in the trend, as alarms, or for recipes are transferred and stored automatically. When a variable is accessed in IEC code only, the variable is not updated automatically. In this case, you have to select the “Update always” option in the data source editor of the “Variables” tab.
The data source types support the (read or write) data access to variables of the source PLC for the following data types:
-
Scalar value at top level
Example:
PLC_PRG.hugo
-
Property to a program or GVL by means of a call when it is marked with
{attribute monitoring := 'call'}
.Example:
PLC_PRG.PropertyCall
-
Variable which is mapped to bit addresses
Example in
PLC_PRG
:x AT %MX0.5 : BOOL;
-
Variable (type
BIT
) in a function blockExample: Declaration in
DUT
:x, y : BIT
, bit access:PLC_PRG.dutInst.y
-
Structured obtainable variable
Example:
PLC_PRG.outerInst.innerInst.dwVar
-
Property to POU instance when it is marked with
{attribute monitoring := 'call'}
.Example:
PLC_PRG.instance.PropertyCall
-
Property at top level and to an instance when it is marked with
{attribute monitoring := 'variable'}
.Note: This cannot be written by monitoring or by the data sources.
-
Array access with literal index
Example:
PLC_PRG.arrOfInts[3]
,PLC_PRG.inst.arrOfBool[1]
-
Nested access (for example, array of structures or structure of arrays)




CAUTION

Bit access used in visualizations that are transferred via a data source connection function only if they contain literal offset specifications. A visualization cannot process an offset specification by defined constants.