UA Bundle SDK .NET  2.2.3.276
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Groups Pages
UnifiedAutomation.UaBase.NodeId Class Reference

Represents a node id. More...

Inherits IComparable, IFormattable, and ICloneable.

Public Member Functions

 NodeId (uint id)
 Creates a node id. More...
 
 NodeId (uint id, ushort namespaceIndex)
 Creates a node id. More...
 
 NodeId (string id, ushort namespaceIndex)
 Creates a node id. More...
 
 NodeId (Guid id, ushort namespaceIndex)
 Creates a node id. More...
 
 NodeId (byte[] id, ushort namespaceIndex)
 Creates a node id. More...
 
 NodeId (IdType idType, object id, ushort namespaceIndex)
 Creates a node id. More...
 
object Clone ()
 Creates a deep copy of the object. More...
 
override bool Equals (object obj)
 Returns true if the object is equal to the instance. More...
 
override int GetHashCode ()
 Returns a hash code for the instance. More...
 
int CompareTo (object obj)
 Compares the instance to another object. More...
 
override string ToString ()
 Formats the object as a string. More...
 
string ToString (string format, IFormatProvider formatProvider)
 Formats the object as a string. More...
 
string Format ()
 Formats a node id as a string. More...
 
void Format (StringBuilder buffer)
 Formats the node ids as string and adds it to the buffer. More...
 

Static Public Member Functions

static void Format (StringBuilder buffer, object identifier, IdType identifierType, ushort namespaceIndex)
 Formats the node ids as string and adds it to the buffer. More...
 
static NodeId Parse (string text)
 Parses the specified text and returns a node id. More...
 
static NodeId Parse (string text, NamespaceTable currentNamespaces, NamespaceTable targetNamespaces)
 Parses a node id string, translates any namespace indexes and returns the result. More...
 
static operator NodeId (uint id)
 Converts a uint to a Nodeid. More...
 
static implicit operator ExpandedNodeId (NodeId id)
 Converts a node id to an expanded node id. More...
 
static operator NodeId (ExpandedNodeId id)
 Converts an expanded node id to a node id. More...
 
static bool IsNull (NodeId nodeId)
 Returns true if the node id is a NULL node id. More...
 
static bool IsNull (ExpandedNodeId nodeId)
 Returns true if the node id is a NULL node id. More...
 
static ExpandedNodeId ToAbsoluteNodeId (NodeId nodeId, StringTable namespaceUris)
 Converts the NodeId to an absolute node id. More...
 
static bool operator== (NodeId node1, NodeId node2)
 Implements the operator ==. More...
 
static bool operator!= (NodeId node1, NodeId node2)
 Implements the operator !=. More...
 

Static Public Attributes

static readonly NodeId Null = new NodeId()
 A constant representing a NULL NodeId. More...
 

Properties

ushort NamespaceIndex [get, set]
 The index of the namespace uri. More...
 
IdType IdType [get, set]
 The identifier type of a NodeId. More...
 
object Identifier [get, set]
 The actual identifier. More...
 

Detailed Description

Represents a node id.

The NodeId data type is a structure with the following elements:

Name Type Description
namespaceIndex UInt16 The index for a namespace URI used in an OPC UA server
identifierType enum The format and data type of the identifier
identifier * The identifier for a node in the address space of an OPC UA server

The namespace is a URI that identifies the naming authority responsible for assigning the identifier element of the NodeId. Naming authorities include the local server, the underlying system, standards bodies, and consortia. It is expected that most nodes will use the URI of the server or of the underlying system.

Using a namespace URI allows multiple OPC UA servers attached to the same underlying system to use the same identifier to identify the same object. This enables clients that connect to those Servers to recognise Objects that they have in common. The namespace URI is case sensitive. Namespace URIs are identified by numeric values in OPC UA services to permit more efficient transfer and processing (e.g. table lookups). The numeric values used to identify namespaces correspond to the index into the NamespaceArray. The NamespaceArray is a variable that is part of the Server object in the address space.

The URI for the OPC UA namespace is “http://opcfoundation.org/UA/”. Its corresponding index in the namespace table is 0.

The following IdentifierTypes are available:

Value Description
OpcUa_IdentifierType_Numeric Numeric value
OpcUa_IdentifierType_String String value
OpcUa_IdentifierType_Guid Globally Unique Identifier
OpcUa_IdentifierType_Opaque Namespace specific format in a ByteString

Normally the scope of NodeIds is the server in which they are defined. For certain types of NodeIds, NodeIds can uniquely identify a Node within a system, or across systems (e.g. GUIDs). System-wide and globally-unique identifiers allow clients to track Nodes, such as work orders, as they move between OPC UA servers as they progress through the system.

String identifiers are case sensitive. That is, clients shall consider them case sensitive. Servers are allowed to provide alternative NodeIds and using this mechanism severs can handle NodeIds as case insensitive.

The identifier value element is used within the context of the first two elements to identify a node. Its data type and format is defined by the identifierType.

Identifier values of IdentifierType STRING are restricted to 4096 characters. Identifier values of IdentifierType OPAQUE are restricted to 4096 bytes.

A null NodeId has special meaning. For example, many services define special behaviour if a null NodeId is passed as a parameter. A node in the address space cannot have a null NodeId.

Constructor & Destructor Documentation

UnifiedAutomation.UaBase.NodeId.NodeId ( uint  id)
inline

Creates a node id.

UnifiedAutomation.UaBase.NodeId.NodeId ( uint  id,
ushort  namespaceIndex 
)
inline

Creates a node id.

UnifiedAutomation.UaBase.NodeId.NodeId ( string  id,
ushort  namespaceIndex 
)
inline

Creates a node id.

UnifiedAutomation.UaBase.NodeId.NodeId ( Guid  id,
ushort  namespaceIndex 
)
inline

Creates a node id.

UnifiedAutomation.UaBase.NodeId.NodeId ( byte[]  id,
ushort  namespaceIndex 
)
inline

Creates a node id.

UnifiedAutomation.UaBase.NodeId.NodeId ( IdType  idType,
object  id,
ushort  namespaceIndex 
)
inline

Creates a node id.

Member Function Documentation

object UnifiedAutomation.UaBase.NodeId.Clone ( )
inline

Creates a deep copy of the object.

int UnifiedAutomation.UaBase.NodeId.CompareTo ( object  obj)
inline

Compares the instance to another object.

Parameters
objThe object to compare to this object
override bool UnifiedAutomation.UaBase.NodeId.Equals ( object  obj)
inline

Returns true if the object is equal to the instance.

string UnifiedAutomation.UaBase.NodeId.Format ( )
inline

Formats a node id as a string.

See ToString(string format, IFormatProvider formatProvider) for a description of the string format.

void UnifiedAutomation.UaBase.NodeId.Format ( StringBuilder  buffer)
inline

Formats the node ids as string and adds it to the buffer.

See ToString(string format, IFormatProvider formatProvider) for a description of the string format.

static void UnifiedAutomation.UaBase.NodeId.Format ( StringBuilder  buffer,
object  identifier,
IdType  identifierType,
ushort  namespaceIndex 
)
inlinestatic

Formats the node ids as string and adds it to the buffer.

See ToString(string format, IFormatProvider formatProvider) for a description of the string format.

override int UnifiedAutomation.UaBase.NodeId.GetHashCode ( )
inline

Returns a hash code for the instance.

static bool UnifiedAutomation.UaBase.NodeId.IsNull ( NodeId  nodeId)
inlinestatic

Returns true if the node id is a NULL node id.

Parameters
nodeIdThe node id.
Returns
true if the specified node id is null; otherwise, false.
static bool UnifiedAutomation.UaBase.NodeId.IsNull ( ExpandedNodeId  nodeId)
inlinestatic

Returns true if the node id is a NULL node id.

Parameters
nodeIdThe node id.
Returns
true if the specified node id is null; otherwise, false.
static implicit UnifiedAutomation.UaBase.NodeId.operator ExpandedNodeId ( NodeId  id)
inlinestatic

Converts a node id to an expanded node id.

Parameters
idThe id.
Returns
The result of the conversion.
static UnifiedAutomation.UaBase.NodeId.operator NodeId ( uint  id)
inlineexplicitstatic

Converts a uint to a Nodeid.

Parameters
idThe id.
Returns
The result of the conversion.
static UnifiedAutomation.UaBase.NodeId.operator NodeId ( ExpandedNodeId  id)
inlineexplicitstatic

Converts an expanded node id to a node id.

Parameters
idThe id.
Returns
The result of the conversion.
static bool UnifiedAutomation.UaBase.NodeId.operator!= ( NodeId  node1,
NodeId  node2 
)
inlinestatic

Implements the operator !=.

Parameters
node1The node1.
node2The node2.
Returns
The result of the operator.
static bool UnifiedAutomation.UaBase.NodeId.operator== ( NodeId  node1,
NodeId  node2 
)
inlinestatic

Implements the operator ==.

Parameters
node1The node1.
node2The node2.
Returns
The result of the operator.
static NodeId UnifiedAutomation.UaBase.NodeId.Parse ( string  text)
inlinestatic

Parses the specified text and returns a node id.

See ToString(string format, IFormatProvider formatProvider) for a description of the string format.

static NodeId UnifiedAutomation.UaBase.NodeId.Parse ( string  text,
NamespaceTable  currentNamespaces,
NamespaceTable  targetNamespaces 
)
inlinestatic

Parses a node id string, translates any namespace indexes and returns the result.

See ToString(string format, IFormatProvider formatProvider) for a description of the string format.

static ExpandedNodeId UnifiedAutomation.UaBase.NodeId.ToAbsoluteNodeId ( NodeId  nodeId,
StringTable  namespaceUris 
)
inlinestatic

Converts the NodeId to an absolute node id.

Parameters
nodeIdThe node id.
namespaceUrisThe namespace uris.
Returns
override string UnifiedAutomation.UaBase.NodeId.ToString ( )
inline

Formats the object as a string.

See ToString(string format, IFormatProvider formatProvider) for a description of the string format.

string UnifiedAutomation.UaBase.NodeId.ToString ( string  format,
IFormatProvider  formatProvider 
)
inline

Formats the object as a string.

Converts all elements of a NodeId to a string where the syntax is defined by the OPC UA XML Schema.

The format of the string is
ns=<namespaceindex>;<identifier type>=<identifier>

with the fields

<namespace index>
The namespace index formatted as a base 10 number. If the index is 0, then the entire 'ns=0;' clause is omitted.
<identifier type>
A flag that specifies the identifier type. The flag has the following values:
Flag Identifier Type
i NUMERIC (UInteger)
s STRING (String)
g GUID (Guid)
b OPAQUE (ByteString)
<identifier>
The identifier encoded as string. The identifier is formatted using the XML data type mapping for the identifier type. Note that the identifier may contain any non-null UTF8 character including whitespace.

Examples are

'i=13'
namespace index 0, numeric identifier
'ns=10;i=5001'
namespace index 10, numeric identifier
'ns=10;s=Hello:World'
namespace index 10, string identifier
'ns=1;g=09087e75-8e5e-499b-954f-f2a9603db28a'
namespace index 1, GUID identifier
'ns=1;b=M/RbKBsRVkePCePcx24oRA=='
namespace index 1, Opaque/ByteString identifier

Member Data Documentation

readonly NodeId UnifiedAutomation.UaBase.NodeId.Null = new NodeId()
static

A constant representing a NULL NodeId.

Property Documentation

object UnifiedAutomation.UaBase.NodeId.Identifier
getset

The actual identifier.

IdType UnifiedAutomation.UaBase.NodeId.IdType
getset

The identifier type of a NodeId.

Possible values are:

  • Numeric
  • String
  • Guid
  • Opaque
ushort UnifiedAutomation.UaBase.NodeId.NamespaceIndex
getset

The index of the namespace uri.


The documentation for this class was generated from the following file: