Object ‘Data Source’

Insert a Data source object below a Data Server object of an application. It represents an application on another device in the control network, with which the local application wishes to exchange data.

On the Communication tab, configure the settings for the connection to the other device, plus settings for the update of values.

On the Data Source Items tab, specify the variables for which the Data Server is to transfer values.

Data Source Items

Specify the variables for which the data server is to transfer values. With the help of the arrow buttons you can select variables of the data source or remove them from the selection. Alternative: a double-click on an entry in the left window moves it into the right window. a double-click on an entry in the right window deletes it.

Note

For structured variables you can specifically select individual components only in the tree structure view.

Available Items All variables available in the data source.
Selected Items Variables of the source selected for the data transfer.
Refres CODESYS updates the selection of the available variables.
Rebind You can change the data source; the dialog box Select new Datasource appears for this.
Structured view CODESYS displays the available variables in project tree structure, otherwise flat and sorted by modules.
Show documentation / Documentation For each variable the documentation provided by the data source appears, at least its path below the device.
Type of Datasource Type of device on which the data source is located.
Access rights

By clicking on the symbol behind the variable you can switch over the access rights: 2428e832c4df0075c0a8640e01c7de21_b21d37321e8f942dc0a8640e01947982 “read and write”, 2428e832c4df0075c0a8640e01c7de21_2d4bfe7c1e8f9404c0a8640e01947982 “read only”, 2428e832c4df0075c0a8640e01c7de21_ff7255fb1e8f9455c0a8640e01947982 “write only”

  • Read: whenever the value of the variable in the data source has changed, the data server also updates the value in the local application.
  • Write: whenever the value of the variable in the local application has changed, the data server also updates the value in the data source.
Update by Default

The data server always (!) transfers the variables of the currently active visualization. If a function block instance or a data type instance is activated in this way, the complete instance is transferred! The data server transfers variables without the ‘Update by default’ attribute only if they are displayed in a visualization or if you have activated them via the data server programming interface in your application.

Clicking on the button Update by default switches back and forth between the following actions:

  • all (!) variables are selected in order to be updated
  • no variable is selected in order to be updated
  • all variables that were selected last in order to be updated are selected again

Attention

Check how many variables can be updated with the setting Update by default or via the functions of the data server interface. Every such update produces data traffic on the communication line between the data source PLC and the DataServer PLC. If too many variables have to be updated in such a way, this can lower the refresh rate of the variables or cause an incomplete transfer!

See also

Communication

Target device
Automatic configuration CODESYS adopts the communication data of the device of the active network path, in accordance with the Communication Settings of this device.
Manual configuration Communication takes place via the address specified here. With a mouse-click on From device, CODESYS automatically enters the data of the currently connected data source device as they are configured in its Communication Settings.
  Derive device address automatically: Recommended setting! Communication takes place via the address defined in the Communication Settings of the target device.
 

Use device address:: CODESYS enters the address of the data source device currently connected, as it is configured in its communication settings; for example [057B}.

Important: The address is possibly incorrect in the following cases:

  • The gateway via which communication with the device takes place is running on a computer with several IP addresses.
  • The device on which the DataServer is running has several IP addresses or other interfaces (USB, serial, etc.) for communication with CODESYS.
  • The CODESYS runtime system and the gateway are not in the same Ethernet subnet.

We therefore recommend the setting Automatic configuration.

 

Searching for the target system with the help of the network scan: Possible search criteria for the device:

Node name: e.g. WST06

Target type: e.g. “4096”

Target ID: e.g. “0000 0001”

Target version: e.g. “1.0.0.0”

Network location:

  • Direct child of the data server PLC:  The controller being sought has an address that starts with the address of the controller on which the data server is running. Example: DataServer PLC: 0000.0001, source: 0000.0001.0001)
  • Direct child of node with address: specify the address of the parent node.
  • Direct child of the dataserver PLC or of the node with the address: combination of the two options specified above.

Search type::

  • First found device: CODESYS uses the first controller in the Device tree that meets the specified criteria.

  • Exactly found device: CODESYS uses the controller that exactly meets the specified criteria.

    Please note: the data server waits until the scanning of the network is completed. This usually takes about 10 seconds.

Configuration of the update
Update while PLC is stopped The data server also updates the data source variables when the controller is stopped. Otherwise no update takes place in the stop status.
Update rate (ms) Update interval for the variables in milliseconds. Default value: 200 ms.
Login configuration

Logging in to the target device works according to the following definitions:

  • Login with the following credentials (empty user name/password ok, if no user management on the PLC): Enter the login data here that the target device requests. If the target device has no user management, leave the fields blank.
  • Login with the credentials determined at runtime: Select this option if CODESYS requests the user at runtime to enter the valid login data via a login dialog box in a visualization.
Expert Settings
Default communication buffer Unit: bytes, default value: 50000
Monitoring buffer Unit: bytes, default value: 20000

See also