Definition of the Peripheral Address of the OPC UA Driver

In order to assign an OPC UA item to a WinCC OA data point element, the engineer has to create a peripheral address on the corresponding data point element (_address WinCC OA config). The peripheral address describes the mapping of the hardware address in the target system to the address of the WinCC OA client data point element.

For the definition of the peripheral address click on the address config (_address) of a data point element, select the OPCUA CLIENT driver type from the combo box and click on Configure.... Now the peripheral address of the OPC UA client can be configured in the opened panel.

The peripheral address for the data point elements is defined according to the following schema:

Server$Subscription$Kind$Variant$[numeric range]Item

In the driver this peripheral address is split and converted.

The Kind defines whether it is a subscription for data values, events or alarms & conditions (in addition, the data point element must have the alert_hdl config). The kind cannot be configured in the peripheral address panel. This is derived from the subscription type (see Configuration of a Subscription).

If the subscription is an empty string (polling is used) the peripheral address looks as follows:

Server$$Variant$Item
Figure 1. Definition of an OPC UA peripheral address

Server

The name of the OPC UA server from which the client receives the value. This name must be equal to the name of the internal connection data point name (without leading "_") of the type _OPCUAServer.

Subscription

Name of the subscription for which the items are created and monitored. Theoretically, each server can have an unlimited number of subscriptions. For performance reasons the number of subscriptions per server should be less than 100. The name of the subscription has to be equal to the name of the internal data point of the type _OPCUASubscription (without leading "_").

Click on the "..." button on the right of this field in order to change the parameters of the selected subscription.

If no subscription is used, the receive modes Polling and Single query can be used. If a subscription is used, the receive modes Spontaneous and Alarm can be used, depending on the subscription type (Data and Event subscription: Spontaneous; Alert subscription: Alarm).

Variant

The variant defines whether the item is defined as NodeId or as Browse Path in the peripheral address (for detailed information see further below).

Driver number

Number of the OPC UA client for which the peripheral address is defined. The OPC UA client can be started by using different manager numbers (e.g. -num 4).

Item

The OPC UA item can be defined either as Node ID or as Browse Path. Internally, the client works with NodeIds. Thus, when using a NodeId in the peripheral address, a conversion is not performed. Therefor the NodeId may be "unreadable" (e.g. a sequence number) - this depends on the server. In this case use the Browse Path for addressing. A uniform addressing should be used.

Via a click on the "Get Item ID" button you can search for items in a new panel (see Browsing for Items). The peripheral address is configured by selecting one of the displayed (browsed) elements in the browsing panel .

NodeId

ns=<namespaceindex>;<type>=<value>

Field Data Type Description
<namespaceindex>

UInt16

Enum

The name space index in decimal format.

Note:

The name space index in the server has to be consistent. That implies that the name space index must not be changed in the server, as it is predefined in the peripheral address.

<type> Enum

This flag identifies the following NodeId:

  • i -> numeric (UInteger)

  • s -> string (String)

  • g -> guid (Guid)

  • b -> opaque (ByteString)

<value> The NodeId.

Examples:

  • ns=0;i=13
  • ns=10;i=-1
  • ns=10;s=System.Pumpe1
  • ns=0;g=09087e75-8e5e-499b-954f-f2a9603db28a
  • n=1;b=M/RbKBsRVkePCePcx24oRA==

Example for a peripheral address:

UASERVER1$Subscription1$1$1$ns=2;s=System.Pumpe1

Browse Path

The specific part elements of the browse path are relative path elements. These relative elements always consist of a reference type, name space and the browse name.

Path element Symbol Description
Reference type / HierarchicalReferences reference type is used.
. Subtypes of the Aggregates ReferenceType reference type.
Name space <[#!ns:]ReferenceType>

Own reference type

  • # -> no subtypes are follow

  • ! -> inverse

  • ns -> name space Note:

    The name space index in the server has to be consistent. That implies that the name space index must not be changed in the server, as it is predefined in the peripheral address.

&

Masking sign for escape signs:

/, ., <, >, :, #, !, &

Examples:

  • “/1:SYSTEM/1:PUMP/1:P1”
  • “/2:Block&.Output”
  • “/3:Truck.0:NodeVersion”
  • “<!HasChild>Truck”
  • “<1:ConnectedTo>1:Boiler/”

Example of a peripheral address:

UASERVER1$Subscription1$1$2$/2:my/2:browse/2:path

This means that a sequence of a hierarchic reference is mapped to a node with the browse name "my", then the hierarchic reference is mapped to "browse" and then to "path" in the name space 2.

Range

In the text field "Range" a range can be specified for reading and writing single elements or a defined range of elements from an array can be used.

WinCC OA supports both read and write ranges from one-dimensional arrays. For multi-dimensional arrays only limited reading is supported. As such only specifying a range with results in a single element or a one-dimensional array is supported.

The syntax for the range of one dimension is <start index>[:<end index>]. If a multi-dimensional array is used, a range for each dimension must be specified. The index starts at 0. If the end index exceeds the array size, the values up to the end of the array are returned for a read operation.

Example of arrays:

  • 2 -> array1[2] of a one-dimensional array
  • 2:5 -> array1[2..5] of a onedimensional array
  • 2,4 -> array2[2,4] of a two-dimensional array
  • 2,4:5 -> array2[2,4..5] of a two-dimensional array (allowed because the result is a one-dimensional array)

Examples resulting in an error:

  • 2 -> for two-dimensional array is an error because not all dimensions are specified
  • 3:4,4:5 -> for two-dimensional array is an error because the result is a two-dimensional array

If the syntax of the range is wrong, an error message is written to the log file and the address is ignored. If the syntax of the range is specified correctly and the range does not exist for the item, the invalid bit is set on the corresponding DP.

Trans.Type

The transformation type is relevant only for the "Value" type. Select the transformation type from the combo box. The transformation type is an interpretation of the data that is sent from the OPC UA server.

The transformation has to conform to the address in the OPC UA server (if for example 4 are read, the type of the transformation has to be int32).

If the default type was selected from the combo box, the driver defines automatically which transformation type is used, depending on the type of the data point element for which the peripheral address is configured. The automatic definition might not work correctly out-of-the-box. This depends on whether different types can be converted to each other. For example, a 16bit integer on the server can be converted automatically to a WinCC OA integer. If the automatic definition does not work, a corresponding error message is displayed in the log viewer. In this case the transformation has to be adjusted manually in the WinCC OA peripheral address panel.

In the event of a float data type on the OPC UA server, the transformation type has to be specified explicitly.

Due to the different language encoding between WinCC OA (iso88591) and OPC UA (UTF-8) problems occur during string transfers containing special characters in UTF-8.

To solve the problem there is the following workaround:

- On the client side the conversion takes place if the transformation type LocalizedText is selected on the peripheral address and this in the current configuration language or the current project language since only one language is available in OPC UA.

- In the server, the LocalizedText of the current configuration language is encoded as UTF-8.

- A normal string will not be converted.

The typical mapping of the OPC UA basic types, which are supported by the OPC UA client, to WinCC OA data types is shown in the table above. Also other mappings are supported as long as a WinCC OA data type can be converted to another type. For example an OPC UA boolean can also be mapped to a WinCC OA DPEL_INT.

OPC UA Data Type WinCC OA Data Type Data Type of Variables
Boolean DPEL_BOOL (bool) BIT_VAR
SByte DPEL_INT (int) INTEGER_VAR
bit64 DPEL_BIT64 (bit64) ULONG_VAR
Byte DPEL_CHAR (char) CHAR_VAR
Int16 DPEL_INT (int) INTEGER_VAR
UInt16 DPEL_UINT (uint) UINTEGER_VAR
Int32 DPEL_INT (int) INTEGER_VAR
UInt32 DPEL_UINT (uint) UINTEGER_VAR
Int64 DPEL_LONG (long) LONG_VAR
UInt64 DPEL_ULONG (ulong) ULONG_VAR
Float DPEL_FLOAT (float) FLOAT_VAR
Double DPEL_FLOAT (float) FLOAT_VAR
String DPEL_STRING (string) TEXT_VAR
DateTime DPEL_TIME (time) TIME_VAR
Guid DPEL_STRING (string) TEXT_VAR
ByteString DPEL_BLOB (blob) BLOB_VAR
XmlElement DPEL_STRING (string) TEXT_VAR
LocalizedText

DPEL_LANGSTRING (langString)

Note:

It is not possible to define a peripheral address on a langstring or dyn_langstring on the client side. Thus, the data types string and dyn_string with the transformation type LocalizedText have to be used.

LANGTEXT_VAR
Array of basic data type

DPEL_DYN_*

Note: * .. represents a basic data type
Restriction: dyn_blob elements are not supported.
Restriction: Only an array length of up to 65536 is supported.
DYN_VAR(WinCC OA data type)

Old/New-Comparison

This option can be activated only then if the direction is set to Input or In/Out. By activation of this option only changed data is sent. The comparison is based on raw data without conversation. The old/new comparison is already carried out while the data are retrieved by the OPC UA server (contrary to smoothing, where the data are already assigned to the data points). In an old/new comparison each value is compared to the old value and replaced in case of a difference.

History

The _offset attribute is set via this checkbox. This attribute indicates whether historical data is available on the OPC UA server for this peripheral address and if historical values can be queried (see also notes and restrictions of Historical Access).

Direction

Specifies whether the values of a data point element are transferred in send direction (Output), in receive direction (Input) or in both directions (In/Out). Events and Alarms & Conditions can be only set to input (the peripheral address avoids another setting).

The _address WinCC OA config has several attributes, which store the relevant information. For example, the _reference attribute is a string that describes the address in the target system.

In case of an address in In/Out direction the client re-writes the old value to the data point, if a response of the value is not received within a certain time (IOTransitionTimeout entry in the configuration file). The _transition attribute from the _original WinCC OA config indicates whether a value is currently in transaction

Receive Mode

The receive mode for the input and in/out directions can be set to Spontaneous (subscription is used), Polling (subscription is not used), Single QueryorAlarm.

Poll Group

Data point elements, which read or read/write values from the periphery, can be assigned to a poll group. Therewith the OPC UA client is able to communicate also with OPC UA servers which do not support subscriptions and/or Monitored Items.

Address active

When this check box is ticked, then the address is used by the driver (see reference tables). An inactive address is possible and the values can be set and queried, but they are not used by the driver. That means that for this data point element no values can be sent to or retrieved by the OPC UA server.