For every OPC UA Namespace, an AML Attribute Type Library exists that defines a corresponding AML AttributeType for each OPC UA DataType. The name of the AML AttributeType Library is composed of the string “ATL_” followed by the OPC UA Namespace name.

Each AML AttributeType has a NodeId Attribute, which matches the NodeId of the OPC UA DataType. The NodeId Attribute does not appear on data type instances and contains an “OPC:TypeOnly” entry in the Additional Information collection of the Attribute Header.

The name of each AML AttributeType shall match the string portion of OPC UA DataType BrowseName.

Table A.2 shows the mapping of the simple built-in DataTypes in OPC UA that correspond to simple XML schema types used in AML. Each of the built-in UA DataTypes is defined as an AML AttributeType in the AttributeType Library for the base OPC UA Namespace.

Table A.2 – Mapping simple built-in Datatypes

UA DataType

XML Schema type used in AML

Boolean

xs:boolean

SByte

xs:byte

Byte

xs:unsignedByte

Int16

xs:short

UInt16

xs:unsignedShort

Int32

xs:int

UInt32

xs:unsignedInt

Int64

xs:long

UInt64

xs:unsignedLong

Float

xs:float

Double

xs:double

String

xs:string

DateTime

xs:dateTime

ByteString

xs:base64Binary

OPC UA Structures are defined as AML AttributeTypes. Structures in OPC UA can be derived from other Structures and composed of any other OPC UA DataTypes. Similarly, AML AttributeTypes can be derived from other AML AttributeTypes and composed of any other AttributeTypes. This allows all OPC UA DataTypes (including Structures) to appear as AML AttributeTypes with the same derivation and composition structure as seen in OPC UA.

Arrays are most naturally represented as lists in XML, so in AML, array DataTypes are represented as XML lists. The AML AttributeType Library of an OPC UA Namespace defines a number of lists for arrays of UA DataTypes, of which a subset is shown in Figure A.3. The same pattern shall be used to construct arrays of any derived DataTypes.

image029.png

Figure A.3 – Some of the “ListOf” AttributeTypes representing UA array DataTypes

The “ListOf” attributes are all derived from the OrderedListType attributes in the standard AutomationMLBaseAttributeTypeLib.

Enumerations in OPC UA shall be represented as xs:string types in AML with a constraint to limit the values to those defined by the Enumeration. Figure A.4 shows the enumeration for the OPC UA DataType “ApplicationType” in AML.

image030.png

Figure A.4 – Example OPC Enumeration mapping

OptionSets and bit masks in OPC UA are Integer types where each bit is an independent named field with a Boolean value. In AutomationML, this is mapped to an AttributeType with a set of contained attributes of type xs:Boolean, where the name of each contained attribute matches the field name in the bit mask or option set. Figure A.5 shows an example of OptionSet’s mapping.

image031.png

Figure A.5 – Example of OptionSets mapping

The following complex DataTypes have special mappings that are non-intuitive.

QualifiedName – The integer NamespaceIndex used in OPC UA is replaced by a NamespaceUri in AutomationML. In AutomationML, the full URI is always used, and there is never an index. Wherever NamespaceUri is used, the AutomationML datatype is always xs:anyURI.

LocalizedText – An xs:string AttributeType with contained attributes that derive from AutomationMLBaseAttributeTypeLib/LocalizedAttribute and follows the standard AutomationML rules.

NodeId NodeIds in running OPC UA Servers are represented as an ID and a NamespaceIndex. In order to make reference to Nodes in the offline AutomationML file, a more flexible way to reference a Node is needed, both directly and indirectly, possibly long before the real Node is present in a running Server. The NodeId AML AttributeType is defined with four top-level attributes, as shown in Figure A.6

image032.png

Figure A.6 – NodeId AttributeType definition

ServerInstanceUri – an optional attribute used to indicate the ServerInstanceUri of the Server containing the NodeId. If empty or missing, the context should be assumed to be the “local” Server. The type is xs:anyURI.

Alias – An indirect reference to a NodeId to be resolved by an alias Server at runtime. The Alias attribute type is defined in A.2.3.

RootNodeId – An ExplicitNodeId from which to traverse the BrowsePath in case the BrowsePath is not empty. The ExplicitNodeId attribute type is defined in A.2.3. If the BrowsePath is empty or not present, the node is identified by the RootNodeId or the NodeId resolved from the alias.

BrowsePath – An optional RelativePath to follow from either the RootNodeId or the NodeId resolved from the Alias. See the definition of the RelativePath structure in OPC 10000-4.

If a BrowsePath is present and not empty in a NodeId, then the RootNodeId should be a well-known NodeId like the NodeId of the Root Object (NS=UA, i=84) or the NodeId of the FxRoot Object (NS=UAFX, i=71).

Either the Alias attribute or the RootNodeId attribute shall be present. If both are present, the Alias attribute shall be ignored.

A typical use case for the BrowsePath in a Descriptor is to reference the corresponding variable in the AddressSpace from the PublishedData of a PublishedDataSet if the variable does not contain a real NodeId. The RootNodeId attribute of the NodeId AttributeType refers to the starting point of the BrowsePath, and the Elements of the BrowsePath direct to the target. Figure A.7 shows an example.

image033.png

Figure A.7 – Example for the use of the BrowsePath

The formal definition of the BrowsePath is given in Table A.3.

Table A.3 – Formal definition of the BrowsePath

0

ReferenceTypeId

NamespaceUri

http://opcfoundation.org/UA/

NumericId

35

IncludeSubTypes

False

IsInverse

False

TargetName

NamespaceUri

https://www.acme.com/BottleMachineProject/

Name

ME_BottleMachineProject

1

ReferenceTypeId

NamespaceUri

http://opcfoundation.org/UA/

NumericId

47

IncludeSubTypes

False

IsInverse

False

TargetName

NamespaceUri

http://opcfoundation.org/UA/FX/AC/

Name

FunctionalEntities

2

ReferenceTypeId

NamespaceUri

http://opcfoundation.org/UA/

NumericId

35

IncludeSubTypes

False

IsInverse

False

TargetName

NamespaceUri

https://www.acme.com/BottleMachineProject/

Name

BottleMachineFE

3

ReferenceTypeId

NamespaceUri

http://opcfoundation.org/UA/

NumericId

47

IncludeSubTypes

False

IsInverse

False

TargetName

NamespaceUri

http://opcfoundation.org/UA/FX/AC/

Name

OutputData

4

ReferenceTypeId

NamespaceUri

http://opcfoundation.org/UA/

NumericId

35

IncludeSubTypes

False

IsInverse

False

TargetName

NamespaceUri

https://www.acme.com/BottleMachineProject/

Name

BottleIdOut

ExpandedNodeId ExpandedNodeId has the same definition as NodeId since NodeId can already express an ExpandedNodeId as well.

PortableNodeId – The identifier field of PortableNodeId has the same definition as NodeId. The NamespaceUri information of the PortableNodeId is already present in the identifier and, therefore, redundant.

RelativePathElement – This attribute type is created using the standard mapping rules, except the ReferenceTypeId attribute is of type ExplicitNodeId defined in A.2.3, rather than NodeId. Table A.4 indicates the default value to use if the indicated attribute is missing.

Table A.4 – Default Values for RelativePathElement

attribute

Default value used if attribute is missing

ReferenceTypeId

nsu=http://opcfoundation.org/UA/;i=22 (i.e. HierarchicalReferences)

IsInverse

FALSE

IncludeSubtypes

TRUE

Guid – An xs:string AttributeType where the string shall be formatted in the standard notation for UUIDs per ISO/IEC 9834-8.

Byte – Where the UA DataType Byte is used in builtInType fields, the AML AttributeType is changed to derive from ATL_OpcAmlMetaModel/BuiltInType with constraints to match the enumeration as shown in Figure A.8.

image034.png

Figure A.8 – BuiltInType enumeration

IntegerId – Where the UA DataType IntegerId is used in fields named “AttributeId”, the AML AttributeType is changed to derive from ATL_OpcAmlMetaModel/AttributeId with constraints to match the enumeration as shown in Figure A.9.

image035.png

Figure A.9 – AttributeId enumeration