OPC UA communication
9.3 Using the S7-1500 as an OPC UA server
Communication
212 Function Manual, 12/2017, A5E03735815-AF
User-defined data type for UNION required
The figure below shows the tag "MyVariable", which has the data type "Union_MyDatatype".
This SIMATIC data type corresponds to an OPC UA tag with the data type UNION.
The figure shows an example of the declaration: When Selector = 1, Union accepts one
ByteString; when Selector = 2, Union accepts one WString.
Using other OPC UA basic data types
Apart from the OPC UA data types listed in the section "Mapping of data types" and their
correspondences on the SIMATIC side, there are the following OPC UA basic data types
which you can also use:
● OpcUa_NodeId
● OpcUa_QualifiedName
● OpcUa_Guid
● OpcUa_LocalizedText
● OpcUa_ByteString
● OpcUa_XmlElement
Requirement for the use of the basic data types listed above as variables in the application
program: The basic data types have to exist as complex data types that are structured
exactly like the corresponding OPC UA basic data types.
● OpcUa_NodeId and OpcUa_QualifiedName exist as system data types; that's why you
can use these data types not only for single variables but also as elements of a structure.
● For the remaining basic types you have to create a PLC data type in accordance with the
OPC UA specification and subsequently use it as an element in a structure so that the
elements can be resolved via the Typedictionary. What each PLC data type must look
like is described below for every single basic data type. "EUInformation" is an example of
a data structure in which, for example, the UDT "LocalizedText" is used. EUInformation
contains information on EngineeringUnits. You can find an example of the implementation
of the EUInformation data structure at the end of the PLC data type descriptions.