5.8.2 AddNodes

5.8.2.1 Description

This Service is used to add one or more Nodes into the AddressSpace hierarchy. Using this Service, each Node is added as the TargetNode of a HierarchicalReference to ensure that the AddressSpace is fully connected and that the Node is added as a child within the AddressSpace hierarchy (see OPC 10000-3).

When a Server creates an instance of a TypeDefinitionNode it shall create the same hierarchy of Nodes beneath the new Object or Variable depending on the ModellingRule of each InstanceDeclaration. All Nodes with a ModellingRule of Mandatory shall be created or an existing Node shall be referenced that conforms to the InstanceDeclaration. The creation of Nodes with other ModellingRules is Server specific.

5.8.2.2 Parameters

Table 22 defines the parameters for the Service.

Table 22 – AddNodes Service Parameters
NameTypeDescription
Request

requestHeader

RequestHeaderCommon request parameters (see 7.32 for RequestHeader definition).

nodesToAdd []

AddNodesItemList of Nodes to add. All Nodes are added as a Reference to an existing Node using a hierarchical ReferenceType. This structure is defined in-line with the following indented items.

parentNodeId

Expanded NodeId

ExpandedNodeId of the parent Node for the Reference. The ExpandedNodeId type is defined in 7.16.

If the serverIndex indicates that the parent Node is a remote Node, then the nodeId shall contain the absolute namespace URI. If the parent Node is a local Node the nodeId shall contain the namespace index.

referenceTypeId

NodeId NodeId of the hierarchical ReferenceType to use for the Reference from the parent Node to the new Node.

requestedNewNodeId

Expanded NodeId

Client requested expanded NodeId of the Node to add. The serverIndex in the expanded NodeId shall be 0.

If the Server cannot use this NodeId, it rejects this Node and returns the appropriate error code.

If the Client does not want to request a NodeId, then it sets the value of this parameter to the null expanded NodeId.

If the Node to add is a ReferenceType Node, its NodeId should be a numeric id. See OPC 10000-3 for a description of ReferenceType NodeIds.

browseName

QualifiedNameThe browse name of the Node to add.

nodeClass

NodeClass NodeClass of the Node to add.

nodeAttributes

Extensible Parameter

NodeAttributes

The Attributes that are specific to the NodeClass. The NodeAttributes parameter type is an extensible parameter type specified in 7.24.

A Client is allowed to omit values for some or all Attributes. If an Attribute value is null, the Server shall use the default values from the TypeDefinitionNode. If a TypeDefinitionNode was not provided the Server shall choose a suitable default value.

The Server may still add an optional Attribute to the Node with an appropriate default value even if the Client does not specify a value.

typeDefinition

Expanded NodeId

NodeId of the TypeDefinitionNode for the Node to add. This parameter shall be null for all NodeClasses other than Object and Variable in which case it shall be provided.

If the serverIndex indicates that the type definition Node is a remote Node, then the nodeId shall contain the absolute namespace URI. If the type definition Node is a local Node the nodeId shall contain the namespace index.

Response

responseHeader

Response HeaderCommon response parameters (see 7.33 for ResponseHeader definition).

results []

AddNodesResultList of results for the Nodes to add. The size and order of the list matches the size and order of the nodesToAdd request parameter. This structure is defined in-line with the following indented items.

statusCode

StatusCode StatusCode for the Node to add (see 7.38 for StatusCode definition).

addedNodeId

NodeId Server assigned NodeId of the added Node. Null NodeId if the operation failed.

diagnosticInfos []

DiagnosticInfoList of diagnostic information for the Nodes to add (see 7.12 for DiagnosticInfo definition). The size and order of the list matches the size and order of the nodesToAdd request parameter. This list is empty if diagnostics information was not requested in the request header or if no diagnostic information was encountered in processing of the request.
5.8.2.3 Service results

Table 23 defines the Service results specific to this Service. Common StatusCodes are defined in Table 178.

Table 23 – AddNodes Service Result Codes
Symbolic IdDescription
Bad_NothingToDoSee Table 178 for the description of this result code.
Bad_TooManyOperationsSee Table 178 for the description of this result code.
5.8.2.4 StatusCodes

Table 24 defines values for the operation level statusCode parameter that are specific to this Service. Common StatusCodes are defined in Table 179.

Table 24 – AddNodes Operation Level Result Codes
Symbolic IdDescription
Bad_ParentNodeIdInvalidThe parent node id does not to refer to a valid node.
Bad_ReferenceTypeIdInvalidSee Table 179 for the description of this result code.
Bad_ReferenceNotAllowedThe reference could not be created because it violates constraints imposed by the data model.
Bad_NodeIdRejectedThe requested node id was rejected either because it was invalid or because the Server does not allow node ids to be specified by the Client.
Bad_NodeIdExistsThe requested node id is already used by another node.
Bad_NodeClassInvalidSee Table 179 for the description of this result code.
Bad_BrowseNameInvalidSee Table 179 for the description of this result code.
Bad_BrowseNameDuplicatedThe browse name is not unique among nodes that share the same relationship with the parent.
Bad_NodeAttributesInvalidThe node Attributes are not valid for the node class.
Bad_TypeDefinitionInvalidSee Table 179 for the description of this result code.
Bad_UserAccessDeniedSee Table 178 for the description of this result code.