-

Defining Data Sets to be Published

This topic contains the following sections:

What is a data set?

Ports and variables to be published into the network are organized as so-called data set. Or said the other way around: a data set is a collection of publishable ports/variables.

After defining a data set as described here, it can be selected in the properties of each writer (publisher) defined in the project. This way, data sets are reusable, i.e. the items contained in a data set can be published in different contexts/intervals or to different network addresses (connections).

Which ports/variables can be included in a data set?

The following items can be included into a data set and therefore published by any writer configured in the project:

How to add a new data set

  1. Double-click the 'OPC UA' PLANT tree node and open the 'OPC UA PubSub' editor.
  2. In the tree on the left, mark 'Published data sets'.
  3. In the editor on the right, click into the 'Name' field of the lowest, empty table row.

    A new data set with a default name is added.

    Click anywhere into the grid to accept the default name or edit it and press <Enter>.

    Note
    The data set will later be referenced by its name when configuring the writers. It is therefore recommended to define a meaningful name and not to change it afterwards.

  4. Continue with the selection of ports/variables for this data set.

How to add ports/variables to a data set

  1. In the tree on the left, open the 'Published data sets' folder and select the required data set.
  2. In the 'Variables' table of data set editor, click into the 'Name' field of the lowest, empty table row.

    A drop-down list appears offering all OUT ports and global IEC variables defined in the project for selection.
    As mentioned above, elementary data types and one-dimensional arrays of an elementary data type are supported

    Note
    The order in which ports and variables are inserted/listed in a data set is important for all subscribers that will read this data set: When configuring a reader, the target variables must be created in exactly this order with the correct data types. Otherwise, the mapping between received values and target variables will not be correct.
    Since the configuration of publishers and the subscribers takes place in different projects, there can be no automatic check for this. As a user, you must ensure that the necessary information is available when configuring the subscribers.

    Note
    The 'OPC' attribute in POU variables tables is not relevant in this context. Ports and global variables can be added to a data set even if the checkbox is not selected in the declaration.

    After adding a port/variable, its OPC UA data type (built-in data type acc. to the OPC UA specification) is automatically derived from the data type declared in the project.

    Example:

    You can modify the order of inserted variables by dragging & dropping them within the table: click and hold an entry in the row header.

How to delete data sets or elements from a data set

The deletion of entries is possible in the 'Published data sets' table and in the 'Variables' table of a data set.

  1. Left-click into the table row to be deleted.
    Multi-selection can be done by pressing the <Ctrl> key or <Shift> key while clicking on the desired table lines. <Ctrl> + <A> selects all table lines.
  2. Press the <Del> key.

Next steps

  Configure connections for publishing/subscribing

  Add writers (publishers) to a connection and assign data sets to a defined writer

  Add readers (subscribers) to a connection and map target variables to the variables read from a publisher