.NET Based OPC UA Client/Server SDK  3.3.3.537
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 new bool Equals (object value1, object value2)
 Determines whether the specified System.Object, is equal to this instance. More...
 
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 node id. 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, IList< string > 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 recognize 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)

Creates a node id.

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

Creates a node id.

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

Creates a node id.

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

Creates a node id.

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

Creates a node id.

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

Creates a node id.

Member Function Documentation

object UnifiedAutomation.UaBase.NodeId.Clone ( )

Creates a deep copy of the object.

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

Compares the instance to another object.

Parameters
objThe object to compare to this object
static new bool UnifiedAutomation.UaBase.NodeId.Equals ( object  value1,
object  value2 
)
static

Determines whether the specified System.Object, is equal to this instance.

Parameters
value1The System.Object to compare with this instance.
value2The value2.
Returns
true if the specified System.Object is equal to this instance; otherwise, false.
override bool UnifiedAutomation.UaBase.NodeId.Equals ( object  obj)

Returns true if the object is equal to the instance.

string UnifiedAutomation.UaBase.NodeId.Format ( )

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)

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 
)
static

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 ( )

Returns a hash code for the instance.

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

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)
static

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)
static

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)
explicitstatic

Converts a uint to a node id.

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

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 
)
static

Implements the operator !=.

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

Implements the operator ==.

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

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 
)
static

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,
IList< string >  namespaceUris 
)
static

Converts the NodeId to an absolute node id.

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

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 
)

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: