Information Model developers define standard AddressSpaces which are implemented by many Servers. There is a need for a standard syntax that Information Model developers can use to formally define their models in a form that can be read by a computer program. Annex F defines an XML-based schema for this purpose.

The XML Schema released with this version of the standards can be found here:

https://reference.opcfoundation.org/files/UANodeSet.xsd?u=http://opcfoundation.org/UA/&v=1.05.04

NOTE The latest file that is compatible with this version of the standards can be found here:

https://reference.opcfoundation.org/files/UANodeSet.xsd?u=http://opcfoundation.org/UA/

The schema document is the formal definition. The description in Annex F only discusses details of the semantics that cannot be captured in the schema document. Types which are self-describing are not discussed.

This schema can also be used to serialize (i.e. import or export) an arbitrary set of Nodes in the Server Address Space. This serialized form can be used to save Server state for use by the Server later or to exchange with other applications (e.g. to support offline configuration by a Client).

This schema only defines a way to represent the structure of Nodes. It is not intended to represent the numerous semantic rules which are defined in other parts of the OPC UA specification. Consumers of data serialized with this schema need to handle inputs that conform to the schema, however, do not conform to the OPC UA specification because of one or more semantic rule violations.

There are cases where an Information Model defines Nodes such as standard Properties which can be attached to many different Nodes. These Nodes are represented in the UANodeSet as Nodes which are not a target of any reference that would make them visible in an AddressSpace.

The tables defining the DataTypes in the specification have field names starting with a lowercase letter. The first letter shall be converted to upper case when the field names are formally defined in a UANodeSet.

Every UANodeSet that defines DataTypes has associated schema files that define how to serialize the DataTypes using the UA Binary Encoding (5.2) and the UA XML Encoding (5.3). The XML schema file may be referenced by the UANodeSet if it includes Variable Values (F.8) for one or more of the DataTypes defined in the UANodeSet. The namespace URI assigned to the XML schema is set by the tool that generated it. The URI for the XML schema for OPC UA DataTypes is http://opcfoundation.org/UA/2008/02/Types.xsd.

The UANodeSet is the root of the document. It defines a set of Nodes, their Attributes and References. References to Nodes outside of the document are allowed.

The structure of a UANodeSet is shown in Table F.1.

Table F.1 – UANodeSet

Element

Type

Description

NamespaceUris

UriTable

A list of NamespaceUris used in the UANodeSet.

This array shall have at least one entry which is equal to the ModelUri for each entry in the Models array.

ServerUris

UriTable

A list of ServerUris used in the UANodeSet.

Models

ModelTableEntry []

A list of models that are defined in the UANodeSet along with any dependencies these models have.

ModelUri

String

The URI for the model.

This URI shall be one of the entries in the NamespaceUris table.

XmlSchemaUri

String

The URI for the XML schema namespace used to serialize values of the DataTypes defined by the Model.

The field is required if DataTypes are defined in the UANodeSet.

The UA XML Encoding (5.3) rules implicitly define the XML schema for any DataType described by a DataTypeDefinition (F.12).

Version

String

The version of the model defined in the UANodeSet.

This is a human readable string and not intended for programmatic comparisons.

PublicationDate

DateTime

When the model was published.

This value is used for comparisons if the Model is defined in multiple UANodeSet files when the ModelVersion is not provided.

ModelVersion

VersionString

The version of the UANodeSet expressed as a string which conforms to the syntax defined in the SemVer specification. The comparison rules from the specification are used to determine which UANodeSet precedes another.

When the ModelVersion is specified in two UANodeSets, the PublicationDate is not used when comparing the UANodeSets.

When the ModelVersion is specified in only one UANodeSet, the PublicationDate is used when comparing the UANodeSets and the ModelVersion is ignored.

The ModelVersion is optional in previously released UANodeSets and it is required in all future UANodeSets.

RolePermissions

RolePermission []

The list of default RolePermissions for all Nodes in the model.

AccessRestrictions

AccessRestriction

The default AccessRestrictions that apply to all Nodes in the model.

The default value is 0.

RequiredModels

ModelTableEntry []

A list of dependencies for the model.

If the model requires a minimum version the PublicationDate shall be specified. Tools which attempt to resolve these dependencies may accept any PublicationDate after this date.

The RolePermission and AccessRestrictions elements shall not be specified for any entry in this list.

Aliases

AliasTable

A list of UANodeSet aliases used in the UANodeSet.

Extensions

xs:any []

An element containing a list of vendor defined extensions to the UANodeSet.

LastModified

DateTime

The last time a document was modified.

<choice>

UAObject

UAVariable

UAMethod

UAView

UAObjectType

UAVariableType

UADataType

UAReferenceType

The Nodes in the UANodeSet.

The NamespaceUris is a list of URIs for namespaces used in the UANodeSet. The NamespaceIndexes used in NodeId, ExpandedNodeIds and QualifiedNames identify an element in this list. The first index is always 1 (0 is always the OPC UA namespace).

The ServerUris is a list of URIs for Servers referenced in the UANodeSet. The ServerIndex in ExpandedNodeIds identifies an element in this list. The first index is always 1 (0 is always the current Server).

The Models element specifies the Models which are formally defined by the UANodeSet. It includes version information as well as information about any dependencies which the model may have. If a Model is defined in the UANodeSet then the file shall also define an instance of the NamespaceMetadataType ObjectType. See OPC 10000-5 for more information. Following the references in the RequiredModels field shall not result in circular dependencies.

The XML schema file associated with a UANodeSet shall have an XML annotation with a Model element that identifies the associated UANodeSet with the form:

<xs:annotation>

<xs:appinfo>

<ua:Model

ModelUri="<model-uri>" ModelVersion="<model-version>" PublicationDate="<publication-date>"

/>

</xs:appinfo>

</xs:annotation>

Where:

  • <model-uri> is the URI of the associated UANodeSet;
  • <model-version> is the SemVer of the associated UANodeSet;
  • <publication-date> is the date the associated UANodeSet was published.

When NodeSets are normative documents for a specification, they can include Nodes, such as unattached Properties, that exist only to formally define elements of the specification. For example, the base NodeSet for this specification includes an unattached Property Node called “NodeVersion” which can be added to any Node. The Node in the NodeSet defines the BrowseName, DataType and ValueRank.

The UANodeSet aliases are a list of string substitutions for NodeIds. UANodeSet aliases can be used to make the file more readable by allowing a string like ‘HasProperty’ in place of a numeric NodeId (i=46). Aliases are optional. Aliases may only be used in fields defined in this Annex that have the NodeId type such as ParentNodeId (F.7) or DataType (F.8). Fields with the Variant type shall not contain UANodeSet aliases.

The Extensions are free form XML data that can be used to attach vendor defined data to the UANodeSet.

A UANode is an abstract base type for all Nodes. It defines the base set of Attributes and the References. There are subtypes for each NodeClass defined in OPC 10000-4. Each of these subtypes defines XML elements and attributes for the OPC UA Attributes specific to the NodeClass. The fields in the UANode type are defined in Table F.2.

Table F.2 – UANode

Element

Type

Description

NodeId

NodeId

A NodeId serialized as a String.

The syntax of the serialized String is defined in 5.3.1.10.

BrowseName

QualifiedName

A QualifiedName serialized as a String with the form:

<namespace index>:<name>

Where the NamespaceIndex refers to the NamespaceUris table.

SymbolicName

String

A symbolic name for the Node that can be used as a class/field name in auto generated code. It should only be specified if the BrowseName cannot be used for this purpose.

This field does not appear in the AddressSpace and is intended for use by design tools. Only letters, digits or the underscore (‘_’) are permitted and the first character shall be a letter.

WriteMask

WriteMask

The value of the WriteMask Attribute.

UserWriteMask

WriteMask

Not used. Kept in schema for backward compatibility.

AccessRestrictions

AccessRestriction

The AccessRestrictions that apply to the Node.

This attribute is optional.

If not specified the AccessRestrictions for the Model are applied.

DisplayName

LocalizedText []

A list of DisplayNames for the Node in different locales.

There shall be only one entry per locale.

Description

LocalizedText []

The list of the Descriptions for the Node in different locales.

There shall be only one entry per locale.

Category

String []

A list of ConformanceUnits associated with the Node.

The ConformanceUnits are specified by the authors of the UANodeSet and allow users of the UANodeSet to exclude Nodes based on a selection of ConformanceUnits.

When an UAInstance has the ParentNodeId specified, the UAInstance inherits the ConformanceUnits from its parent in addition to any ConformanceUnits explicitly specified on the instance.

Documentation

String

Additional non-localized documentation for use by tools that create/edit UANodeSet files.

ReleaseStatus

ReleaseStatus

An enumeration specifying the release status for the UANode.

Valid values are:

Released: The type is released. Changes require errata;

Draft: The type is draft and subject to change;

Deprecated: The type should not be used;

This field is for use on UATypes and static UAInstances. The field shall not be specified for UAInstances that are InstanceDeclarations.

References

Reference []

The list of References for the Node.

RolePermissions

RolePermission []

The list of RolePermissions for the Node.

If the list is not specified or has zero length the default RolePermissions from the Model are used unless HasNoPermissions is TRUE.

HasNoPermissions

Boolean

If TRUE, the UANode has no RolePermissions and the contents of the RolePermissions array and the default RolePermissions for the model are ignored. The default value is FALSE.

Extensions

xs:any []

An element containing a list of vendor defined extensions to the UANode.

The Extensions are free form XML data that can be used to attach vendor defined data to the UANode.

Array values are denoted with [], however, in the XML Schema arrays are mapped to a complex type starting with the ‘ListOf’ prefix.

A UANodeSet is expected to contain many UANodes which reference each other. Tools that create UANodeSets should not add Reference elements for both directions in order to minimize the size of the XML file. Tools that read the UANodeSets shall automatically add reverse references unless reverse references are not appropriate given the ReferenceType semantics. HasTypeDefinition and HasModellingRule are two examples where it is not appropriate to add reverse references.

When a UANodeSet is the normative definition for the Nodes defined by a specification then the RolePermissions are the minimum requirements. Implementors may add additional Roles that have privileges equivalent to the Roles specified, however, they may not make the Node more accessible. For example, Anonymous or AuthenticatedUser Roles shall not be granted more access to the Node than is specified in this field.

Similarly, the AccessRestrictions are the minimum required. For example, a Node that has the EncryptionRequired AccessRestriction specified shall not have that restriction removed, however, additional restrictions may be added by the implementor. Note, that a UANodeSet represents a collection of Nodes in an address space. This implies that any instances shall include the fully inherited InstanceDeclarationHierarchy as defined in OPC 10000-3.

The Reference type specifies a Reference for a Node. The Reference can be forward or inverse. Only one direction for each Reference needs to be in a UANodeSet. The other direction shall be added automatically during any import operation. The fields in the Reference type are defined in Table F.3.

Table F.3 – Reference

Element

Type

Description

NodeId

NodeId

The NodeId of the target of the Reference serialized as a String.

The syntax of the serialized String is defined in 5.3.1.11 (ExpandedNodeId).

This value can be replaced by an Alias.

ReferenceType

NodeId

The NodeId of the ReferenceType serialized as a String.

The syntax of the serialized String is defined in 5.3.1.10 (NodeId).

This value can be replaced by an Alias.

IsForward

Boolean

If TRUE, the Reference is a forward reference.

The RolePermission type specifies the Permissions granted to Role for a Node. The fields in the RolePermission type are defined in Table F.4.

Table F.4 – RolePermission

Element

Type

Description

NodeId

NodeId

The NodeId of the Role which has the Permissions.

Permissions

UInt32

A bitmask specifying the Permissions granted to the Role.

The bitmask values the Permissions bits defined in OPC 10000-3.

A UAType is a subtype of the UANode defined in F.3. It is the base type for the types defined in Table F.5.

Table F.5 – UANodeSet Type Nodes

Subtype

Description

UAObjectType

Defines an ObjectType Node as described in OPC 10000-3.

UAVariableType

Defines a VariableType Node as described in OPC 10000-3.

UADataType

Defines a DataType Node as described in OPC 10000-3.

UAReferenceType

Defines a ReferenceType Node as described in OPC 10000-3.

A UAInstance is a subtype of the UANode defined in F.3. It is the base type for the types defined in Table F.6. The fields in the UAInstance type are defined in Table F.7. Subtypes of UAInstance which have fields in addition to those defined in OPC 10000-3 are described in detail below.

Table F.6 – UANodeSet Instance Nodes

Subtype

Description

UAObject

Defines an Object Node as described in OPC 10000-3.

UAVariable

Defines a Variable Node as described in OPC 10000-3.

UAMethod

Defines a Method Node as described in OPC 10000-3.

UAView

Defines a View Node as described in OPC 10000-3.

Table F.7 – UAInstance

Element

Type

Description

All of the fields from the UANode type described in F.3.

ParentNodeId

NodeId

The NodeId of the Node that is the parent of the Node within the information model. This field is used to indicate that a tight coupling exists between the Node and its parent (e.g., when the parent is deleted, the child is deleted as well). This information does not appear in the AddressSpace and is intended for use by design tools.

This field shall be specified for all InstanceDeclarations and shall reference a UANode which is the source of a HierarchicalReference to the Node.

DesignToolOnly

Boolean

If TRUE the instance is a placeholder for use by design tools and does not appear in the AddressSpace. For example, well-known Properties or Objects.

Only UAObject and UAVariable Nodes may have DesignToolOnly is TRUE.

If DesignToolOnly is TRUE, the ParentNodeId shall not be specified and the UAInstance may not be the target of references from other Nodes and may not be the ParentNodeId for other instances. This implies that child Nodes, even Mandatory ones, are not added to the Node.

The HasTypeDefinition reference shall be specified.

A UAVariable is a subtype of the UAInstance defined in. It represents a Variable Node. The fields in the UAVariable type are defined in Table F.8.

Table F.8 – UAVariable

Element

Type

Description

All of the fields from the UAInstance type described in F.7.

Value

Variant

The Value of the Node encoding using the UA XML wire encoding defined in 5.3.

If a Value is not provided and a UANodeSet is used to initialize a Server AddressSpace then the Server shall report a StatusCode of Bad_NoValue or choose a default Value consistent with the DataType and ValueRank.

Translation

TranslationType []

A list of translations for the Value if the Value is a LocalizedText or a structure containing LocalizedTexts.

This field may be omitted.

If the Value is an array the number of elements in this array shall match the number of elements in the Value. Extra elements are ignored.

If the Value is a scalar, then there is one element in this array.

If the Value is a structure, then each element contains translations for one or more fields identified by a name. See the TranslationType for more information.

DataType

NodeId

The data type of the value.

ValueRank

ValueRank

The value rank.

If not specified, the default value is -1 (Scalar).

ArrayDimensions

ArrayDimensions

The number of dimensions in an array value.

AccessLevel

AccessLevel

The access level.

This value is a UInt32 that includes all of the bits exposed by the AccessLevelEx. Servers which do not support the additional bits in AccessLevelEx should ignore them.

UserAccessLevel

AccessLevel

Not used. Kept in schema for backward compatibility.

MinimumSamplingInterval

Duration

The minimum sampling interval.

Historizing

Boolean

Whether history is being archived.

A UAMethod is a subtype of the UAInstance defined in F.7. It represents a Method Node. The fields in the UAMethod type are defined in Table F.9.

Table F.9 – UAMethod

Element

Type

Description

All of the fields from the UAInstance type described in F.7.

MethodDeclarationId

NodeId

May be specified for Method Nodes that are a target of a HasComponent reference from a single Object Node. It is the NodeId of the UAMethod with the same BrowseName contained in the TypeDefinition associated with the Object Node.

If the TypeDefinition overrides a Method inherited from a base ObjectType then this attribute shall reference the Method Node in the subtype.

Executable

Boolean

Indicates that the Method is executable.

The default value is TRUE.

UserExecutable

Boolean

Not used. Kept in schema for backward compatibility.

ArgumentDescription

UAMethodArgument []

A list of Descriptions for the Method Node Arguments.

Each entry has a Name which uniquely identifies the Argument that the Descriptions apply to. There shall only be one entry per Name.

Each entry also has a list of Descriptions for the Argument in different locales. There shall be only one entry per locale per Argument.

A TranslationType contains additional translations for LocalizedTexts used in the Value of a Variable. The fields in the TranslationType are defined in Table F.10. If multiple Arguments existed there would be a Translation element for each Argument.

The type can have two forms depending on whether the Value is a LocalizedText or a Structure containing LocalizedTexts. If it is a LocalizedText is contains a simple list of translations. If it is a Structure, it contains a list of fields which each contain a list of translations. Each field is identified by a Name which is unique within the structure. The mapping between the Name and the Structure requires an understanding of the Structure encoding. If the Structure field is encoded as a LocalizedText with UA XML, then the name is the unqualified path to the XML element where names in the path are separated by ‘/’. For example, a structure with a nested structure containing a LocalizedText could have a path like “Server/ApplicationName”.

The following example illustrates how translations for the Description field in the Argument Structure are represented in XML:

<Value>

<ListOfExtensionObject xmlns="http://opcfoundation.org/UA/2008/02/Types.xsd">

<ExtensionObject>

<TypeId>

<Identifier>i=297</Identifier>

</TypeId>

<Body>

<Argument>

<Name>ConfigData</Name>

<DataType>

<Identifier>i=15</Identifier>

</DataType>

<ValueRank>-1</ValueRank>

<ArrayDimensions />

<Description>

<Text>[English Translation for Description]</Text>

</Description>

</Argument>

</Body>

</ExtensionObject>

</ListOfExtensionObject>

</Value>

<Translation>

<Field Name="Description">

<Text Locale="de-DE">[German Translation for Description]</Text>

<Text Locale="fr-FR">[French Translation for Description]</Text>

</Field>

</Translation>

If multiple Arguments existed there would be a Translation element for each Argument.

Table F.10 – TranslationType

Element

Type

Description

Text

LocalizedText []

An array of translations for the Value.

It only appears if the Value is a LocalizedText or an array of LocalizedText.

Field

StructureTranslationType []

An array of structure fields which have translations.

It only appears if the Value is a Structure or an array of Structures.

Name

String

The name of the field.

This uniquely identifies the field within the structure.

The exact mapping depends on the encoding of the structure.

Text

LocalizedText []

An array of translations for the structure field.

A UADataType is a subtype of the UAType defined in Table F.5. It defines a DataType Node. The fields in the UADataType type are defined in Table F.11.

Table F.11 – UADataType

Element

Type

Description

All of the fields from the UANode type described in F.3.

Definition

DataTypeDefinition

An abstract definition of the data type that can be used by design tools to create code that can serialize the data type in XML and/or Binary forms. This is only used to define subtypes of the Structure, Enumeration or UInteger DataTypes. UInteger DataTypes only have this field if they represent an OptionSet.

Purpose

DataTypePurpose

An enumeration that indicates the purpose of the DataType.

It can be used by modelling tools and code generators to exclude DataTypes that are not needed.

Possible values are:

Normal – The DataType is used in the AddressSpace.

ServicesOnly – The DataType is only used as Service parameters.

CodeGenerator – The DataType is only used by code generation tools.

This field is only specified for the OPC UA NodeSet. Other NodeSets shall omit this field and the value of “Normal” is assumed.

A DataTypeDefinition defines a representation of a UADataType that can be used by design tools to automatically create serialization code. The fields in the DataTypeDefinition type are defined in Table F.12.

This field may not be present for DataTypes that have no fields. Code generators may choose to create a class with no fields if the programming environment supports the concept.

Table F.12 – DataTypeDefinition

Element

Type

Description

Name

QualifiedName

A unique name for the data type.

This name should be the same as the BrowseName for the containing DataType.

SymbolicName

String

A symbolic name for the data type that can be used as a class/structure name in autogenerated code. It should only be specified if the Name cannot be used for this purpose.

Only letters, digits or the underscore (‘_’) are permitted and the first character shall be a letter.

This field is only specified for nested DataTypeDefinitions.

The SymbolicName of the DataType Node is used otherwise.

BaseType

QualifiedName

Not used. Kept in schema for backward compatibility.

IsUnion

Boolean

This flag indicates if the data type represents a union.

Only one of the Fields defined for the data type is encoded into a value.

This field is optional. The default value is false.

If this value is true, the first field is the switch value.

IsOptionSet

Boolean

This flag indicates that the data type defines the OptionSetValues Property.

This field is optional. The default value is false.

Fields

DataTypeField []

The list of fields that make up the data type.

This definition assumes the structure has a sequential layout.

For enumerations, the fields are simply a list of values.

This list does not include fields inherited from a base DataType.

When Applications ingest a UANodeSet they need to follow the HasSubtype References between DataType Nodes to collect all of the fields needed to fill in the DataTypeDefinition Attribute.

The DataTypeDefinition Attribute maybe populated from the DataTypeDefinition belonging to a UADataType. If the UADataType is a subtype of Structure the mapping to the StructureType Enumeration is specified in Table F.13.

Table F.13 – StructureType Enumeration Mapping

Value

IsUnion

Field.IsOptional

Field.AllowSubTypes

Structure

False

All False

All False

StructureWithOptionalFields

False

One or More True

All False

Union

True

All False

All False

StructureWithSubtypedValues

False

All False

One or More True

UnionWithSubtypedValues

True

All False

One or More True

Any combination of flags that does have a mapping is invalid and an error should be raised.

A DataTypeField defines an abstract representation of a field within a UADataType that can be used by design tools to automatically create serialization code. The fields in the DataTypeField type are defined in Table F.14.

Table F.14 – DataTypeField

Element

Type

Description

Name

String

A name for the field that is unique within the DataTypeDefinition.

SymbolicName

String

A symbolic name for the field that can be used in autogenerated code.

It should only be specified if the Name cannot be used for this purpose.

Only letters, digits or the underscore (‘_’) are permitted.

DisplayName

LocalizedText []

A display name for the field in multiple locales.

DataType

NodeId

The NodeId of the DataType for the field.

This NodeId can refer to another Node with its own DataTypeDefinition.

This field is not specified for Enumeration or OptionSet DataTypes.

ValueRank

Int32

The value rank for the field.

It shall be Scalar (-1) or a fixed rank Array (>=1).

This field is not specified for Enumeration or OptionSet DataTypes.

ArrayDimensions

String

The maximum length of an array.

This field is a comma separated list of unsigned integer values. The list has a number of elements equal to the ValueRank.

The value is 0 if the maximum is not known for a dimension.

This field is not specified if the ValueRank <= 0.

This field is not specified for Enumeration or OptionSet DataTypes.

MaxStringLength

UInt32

The maximum length of a String or ByteString value.

If not known the value is 0.

The value is 0 if the DataType is not String or ByteString.

If the ValueRank > 0 the maximum applies to each element in the array.

This field is not specified for Enumeration or OptionSet DataTypes.

Description

LocalizedText []

A description for the field in multiple locales.

Value

Int32

The value associated with the field.

This field is only specified for Enumeration or OptionSet DataTypes.

IsOptional

Boolean

The field indicates if a data type field in a structure is optional.

The default value is false.

This field is not specified for Enumeration, Union or OptionSet DataTypes.

AllowSubTypes

Boolean

For backward compatibility, this field shall be omitted if the DataType is BaseDataType, Structure, Number, Integer or UInteger or if the DataType is a subtype of simple built-in types such as a String or Int32.

This field shall be TRUE for all abstract DataTypes except for BaseDataType, Structure, Number, Integer or UInteger or if the DataType is a subtype of simple built-in types such as a String or Int32.

When TRUE, the field’s value is allowed to contain subtypes of the DataType.

If TRUE, all subtypes of Structure are encoded as an ExtensionObject (see 5.1.6) and all DataTypes that are not subtypes of Structure are encoded as a Variant (see 5.1.9).

The default value is FALSE.

This field is omitted for Enumeration or OptionSet DataTypes.

The Variant type specifies the value for a Variable or VariableType Node. This type is the same as the type defined in 5.3.1.17. As a result, the functions used to serialize Variants during Service calls can be used to serialize Variant in this file syntax.

Variants can contain NodeIds, ExpandedNodeIds and QualifiedNames which must be modified so the NamespaceIndexes and ServerIndexes reference the NamespaceUri and ServerUri tables in the UANodeSet.

Variants can also contain ExtensionObjects which contain an EncodingId and a Structure with fields which with any DataType including NodeIds, ExpandedNodeIds or QualifiedNames. The NamespaceIndexes and ServerIndexes in these fields shall also reference the tables in the UANodeSet.

An example of the UANodeSet can be found below.

This example defines the Nodes for an InformationModel with the URI of “http://sample.com/Instances”. This example references Nodes defined in the base OPC UA InformationModel and an InformationModel with the URI “http://sample.com/Types”.

The XML namespaces declared at the top include the URIs for the Namespaces referenced in the document because the document includes Complex Data. Documents without Complex Data would not have these declarations.

<UANodeSet

xmlns:s1="http://sample.com/Instances"

xmlns:s0="http://sample.com/Types"

xmlns:uax="http://opcfoundation.org/UA/2008/02/Types.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://opcfoundation.org/UA/2011/03/UANodeSet.xsd">

The NamespaceUris table includes all Namespaces referenced in the document except for the base OPC UA InformationModel. A NamespaceIndex of 1 refers to the URI “http://sample.com/Instances”.

<NamespaceUris>

<Uri>http://sample.com/Instances</Uri>

<Uri>http://sample.com/Types</Uri>

</NamespaceUris>

The Aliases table is provided to enhance readability. There are no rules for what is included. A useful guideline would include standard ReferenceTypes and DataTypes if they are referenced in the document. An Alias may be used for any NodeId value in the document except for NodeIds that appear in Values of Variables or VariableTypes.

<Aliases>

<Alias Alias="HasComponent">i=47</Alias>

<Alias Alias="HasProperty">i=46</Alias>

<Alias Alias="HasSubtype">i=45</Alias>

<Alias Alias="HasTypeDefinition">i=40</Alias>

</Aliases>

The BicycleType is a DataType Node that inherits from a DataType defined in another InformationModel (ns=2;i=314). It is assumed that any application importing this file will already know about the referenced InformationModel. A Server could map the references onto another OPC UA Server by adding a ServerIndex to TargetNode NodeIds. The structure of the DataType is defined by the Definition element. This information can be used by code generators to automatically create serializers for the DataType.

<UADataType NodeId="ns=1;i=365" BrowseName="1:BicycleType">

<DisplayName>BicycleType</DisplayName>

<References>

<Reference ReferenceType="HasSubtype" IsForward="false">ns=2;i=314</Reference>

</References>

<Definition Name="BicycleType">

<Field Name="NoOfGears" DataType="UInt32" />

<Field Name="ManufacturerName" DataType="String" />

</Definition>

</UADataType>

This Node is an instance of an Object TypeDefinition Node defined in another InformationModel (ns=2;i=341). It has a single Property which is declared later in the document.

<UAObject NodeId="ns=1;i=375" BrowseName="1:DriverOfTheMonth" ParentNodeId="ns=1;i=281">

<DisplayName>DriverOfTheMonth</DisplayName>

<References>

<Reference ReferenceType="HasProperty">ns=1;i=376</Reference>

<Reference ReferenceType="HasTypeDefinition">ns=2;i=341</Reference>

<Reference ReferenceType="HasComponent" IsForward="false">ns=1;i=281</Reference>

</References>

</UAObject>

This Node is an instance of a Variable TypeDefinition Node defined in base OPC UA InformationModel (i=68). The DataType is the base type for the BicycleType DataType. The AccessLevels declare the Variable as Readable and Writable. The ParentNodeId indicates that this Node is tightly coupled with the Parent (DriverOfTheMonth) and will be deleted if the Parent is deleted.

<UAVariable NodeId="ns=1;i=376" BrowseName="2:PrimaryVehicle"

ParentNodeId="ns=1;i=375" DataType="ns=2;i=314" AccessLevel="3">

<DisplayName>PrimaryVehicle</DisplayName>

<References>

<Reference ReferenceType="HasTypeDefinition">i=68</Reference>

<Reference ReferenceType="HasProperty" IsForward="false">ns=1;i=375</Reference>

</References>

This Value is an instance of a BicycleType DataType. It is wrapped in an ExtensionObject which declares that the value is serialized using the Default XML DataTypeEncoding for the DataType. The Value could be serialized using the Default Binary DataTypeEncoding but that would result in a document that cannot be edited by hand. No matter which DataTypeEncoding is used, the NamespaceIndex used in the ManufactureName field refers to the NamespaceUris table in this document. The application is responsible for changing whatever value it needs to be when the document is loaded by an application.

<Value>

<ExtensionObject xmlns="http://opcfoundation.org/UA/2008/02/Types.xsd">

<TypeId>

<Identifier>ns=1;i=366</Identifier>

</TypeId>

<Body>

<s1:BicycleType>

<s0:Make>Trek</s0:Make>

<s0:Model>Compact</s0:Model>

<s1:NoOfGears>10</s1:NoOfGears>

<s1:ManufactureName>

<uax:NamespaceIndex>1</uax:NamespaceIndex>

<uax:Name>Hello</uax:Name>

</s1:ManufactureName>

</s1:BicycleType>

</Body>

</ExtensionObject>

</Value>

</UAVariable>

These are the DataTypeEncoding Nodes for the BicycleType DataType.

<UAObject NodeId="ns=1;i=366" BrowseName="Default XML">

<DisplayName>Default XML</DisplayName>

<References>

<Reference ReferenceType="HasEncoding" IsForward="false">ns=1;i=365</Reference>

<Reference ReferenceType="HasTypeDefinition">i=76</Reference>

</References>

</UAObject>

<UAObject NodeId="ns=1;i=370" BrowseName="Default Binary">

<DisplayName>Default Binary</DisplayName>

<References>

<Reference ReferenceType="HasEncoding" IsForward="false">ns=1;i=365</Reference>

<Reference ReferenceType="HasTypeDefinition">i=76</Reference>

</References>

</UAObject>

The UANodeSetChanges is the root of a document that contains a set of changes to an AddressSpace. It is expected that a single file will contain either a UANodeSet or a UANodeSetChanges element at the root. It provides a list of Nodes/References to add and/or a list Nodes/References to delete. The UANodeSetChangesStatus structure defined in F.22 is produced when a UANodeSetChanges document is applied to an AddressSpace.

The elements of the type are defined in Table F.15.

Table F.15 – UANodeSetChanges

Element

Type

Description

NamespaceUris

UriTable

Same as described in Table F.1.

ServerUris

UriTable

Same as described in Table F.1.

Models

ModelTableEntry []

Same as described in Table F.1.

Aliases

AliasTable

Same as described in Table F.1.

Extensions

xs:any []

Same as described in Table F.1.

LastModified

DateTime

Same as described in Table F.1.

NodesToAdd

NodesToAdd

A list of new Nodes to add to the AddressSpace.

ReferencesToAdd

ReferencesToChange

A list of new References to add to the AddressSpace.

NodesToDelete

NodesToDelete

A list of Nodes to delete from the AddressSpace.

ReferencesToDelete

ReferencesToChange

A list of References to delete from the AddressSpace.

The Models element specifies the version of one or more Models which the UANodeSetChanges file will create when it is applied to an existing Address Space. The UANodeSetChanges cannot be applied if the current version of the Model in the Address Space is higher. The RequiredModels sub-element (see Table F.1) specifies the versions Models which must already exist before the UANodeSetChanges file can be applied. When checking dependencies, the version of the Model in the existing Address Space must exactly match the required version.

If a UANodeSetChanges file modifies types and there are existing instances of the types in the AddressSpace, then the Server shall automatically modify the instances to conform to the new type or generate an error.

A UANodeSetChanges file is processed as a single operation. This allows mandatory Nodes or References to be replaced by specifying a Node/Reference to delete and a Node/Reference to add.

The NodesToAdd type specifies a list of Nodes to add to an AddressSpace. The structure of these Nodes is defined by the UANodeSet type in Table F.1.

The elements of the type are defined in Table F.16.

Table F.16 – NodesToAdd

Element

Type

Description

<choice>

UAObject

UAVariable

UAMethod

UAView

UAObjectType

UAVariableType

UADataType

UAReferenceType

The Nodes to add to the AddressSpace.

When adding Nodes, References can be specified as part of the Node definition or as a separate ReferencesToAdd.

Note that References to Nodes that could exist are always allowed. In other words, a Node is never rejected simply because it has a reference to an unknown Node.

Reverse References are added automatically when deemed practical by the processor.

The ReferencesToChange type specifies a list of References to add to or remove from an AddressSpace.

The elements of the type are defined in Table F.17.

Table F.17 – ReferencesToChange

Element

Type

Description

Reference

ReferenceToChange

A Reference to add to the AddressSpace.

The ReferenceToChange type specifies a single Reference to add to or remove from an AddressSpace.

The elements of the type are defined in Table F.18.

Table F.18 – ReferencesToChange

Element

Type

Description

Source

NodeId

The identifier for the source Node of the Reference.

ReferenceType

NodeId

The identifier for the type of the Reference.

IsForward

Boolean

TRUE if the Reference is a forward reference.

Target

NodeId

The identifier for the target Node of the Reference.

References to Nodes that could exist are always allowed. In other words, a Reference is never rejected simply because the target is unknown Node.

The source of the Reference must exist in the AddressSpace or in UANodeSetChanges document being processed.

Reverse References are added when deemed practical by the processor.

The NodesToDelete type specifies a list of Nodes to remove from an AddressSpace.

The elements of the type are defined in Table F.19.

Table F.19 – NodesToDelete

Element

Type

Description

Node

NodeToDelete

A Node to delete from the AddressSpace.

The NodeToDelete type specifies a Node to remove from an AddressSpace.

The elements of the type are defined in Table F.20.

Table F.20 – ReferencesToChange

Element

Type

Description

Node

NodeId

The identifier for the Node to delete.

DeleteReverseReferences

Boolean

If TRUE, then References to the Node are deleted as well.

The UANodeSetChangesStatus is the root of a document that is produced when a UANodeSetChanges document is processed.

The elements of the type are defined in Table F.21.

Table F.21 – UANodeSetChangesStatus

Element

Type

Description

NamespaceUris

UriTable

Same as described in Table F.1.

ServerUris

UriTable

Same as described in Table F.1.

Aliases

AliasTable

Same as described in Table F.1.

Extensions

xs:any []

Same as described in Table F.1.

Version

String

Same as described in Table F.1.

LastModified

DateTime

Same as described in Table F.1.

TransactionId

String

A globally unique identifier from the original UANodeSetChanges document.

NodesToAdd

NodeSetStatusList

A list of results for the NodesToAdd specified in the original document.

The list is empty if all elements were processed successfully.

ReferencesToAdd

NodeSetStatusList

A list of results for the ReferencesToAdd specified in the original document.

The list is empty if all elements were processed successfully.

NodesToDelete

NodeSetStatusList

A list of results for the NodesToDelete specified in the original document.

The list is empty if all elements were processed successfully.

ReferencesToDelete

NodeSetStatusList

A list of results for the ReferencesToDelete specified in the original document.

The list is empty if all elements were processed successfully.

The NodeSetStatusList type specifies a list of results produced when applying a UANodeSetChanges document to an AddressSpace.

If no errors occurred this list is empty.

If one or more errors occur, then this list contains one element for each operation specified in the original document.

The elements of the type are defined in Table F.22.

Table F.22 – NodeSetStatusList

Element

Type

Description

Result

NodeSetStatus

The result of a single operation.

The NodeSetStatus type specifies a single result produced when applying an operation specified in a UANodeSetChanges document to an AddressSpace.

The elements of the type are defined in Table F.23.

Table F.23 – NodeSetStatus

Element

Type

Description

Code

StatusCode

The result of the operation.

The possible StatusCodes are defined in OPC 10000-4.

Details

String

A string providing information that is not conveyed by the StatusCode.

This is not a human readable string for the StatusCode.