OPC Studio User's Guide and Reference
Explicit Type Conversion(UANodeId,UANodeDescriptor) Operator



OpcLabs.EasyOpcUA Assembly > OpcLabs.EasyOpc.UA.AddressSpace Namespace > UANodeId Class > Explicit Type Conversion Operator : Explicit Type Conversion(UANodeId,UANodeDescriptor) Operator
Node descriptor.

Because the OpcLabs.EasyOpc.UA.UANodeDescriptor has implicit conversions from UANodeId, UANodeElement, OpcLabs.EasyOpc.UA.Navigation.UABrowsePath and System.String, in languages that support implicit conversion operators (such as C# or VB.NET), you can simply use a UANodeId object (representing the Id of the OPC UA node), a node element object (from OPC UA browsing), OpcLabs.EasyOpc.UA.Navigation.UABrowsePath object (representing OPC UA absolute browse path), or a string (with expanded node Id text) in place of this parameter, and the corresponding node descriptor will be constructed automatically. When the implicit conversion operators are not supported (such as with Python.NET), you can use the FromString, FromUABrowsePath, FromUANodeElement or FromUANodeId static method instead.

If you are using OPC Wizard (for server development), an implicit conversion from OpcLabs.EasyOpc.UA.NodeSpace.UAServerNode can be used in the same way to simply pass the server node in place of this parameter, which will use its OpcLabs.EasyOpc.UA.NodeSpace.UAServerNode.EffectiveNodeDescriptor property for the operation.

The value of this parameter can be null (Nothing in Visual Basic).

Converts a node descriptor to a node Id.
Syntax
'Declaration
 
<CanBeNullAttribute()>
<ContractAnnotationAttribute("null => null; notnull => notnull")>
Overloads Public Operator Narrowing CType( _
   ByVal nodeDescriptor As UANodeDescriptor _
) As UANodeId
'Usage
 
[CanBeNull()]
[ContractAnnotation("null => null; notnull => notnull")]
public UANodeId operator explicit( 
   UANodeDescriptor nodeDescriptor
)
[CanBeNull()]
[ContractAnnotation("null => null; notnull => notnull")]
public:
UANodeId^ operator explicit( 
   UANodeDescriptor^ nodeDescriptor
)

Parameters

nodeDescriptor
Node descriptor.

Because the OpcLabs.EasyOpc.UA.UANodeDescriptor has implicit conversions from UANodeId, UANodeElement, OpcLabs.EasyOpc.UA.Navigation.UABrowsePath and System.String, in languages that support implicit conversion operators (such as C# or VB.NET), you can simply use a UANodeId object (representing the Id of the OPC UA node), a node element object (from OPC UA browsing), OpcLabs.EasyOpc.UA.Navigation.UABrowsePath object (representing OPC UA absolute browse path), or a string (with expanded node Id text) in place of this parameter, and the corresponding node descriptor will be constructed automatically. When the implicit conversion operators are not supported (such as with Python.NET), you can use the FromString, FromUABrowsePath, FromUANodeElement or FromUANodeId static method instead.

If you are using OPC Wizard (for server development), an implicit conversion from OpcLabs.EasyOpc.UA.NodeSpace.UAServerNode can be used in the same way to simply pass the server node in place of this parameter, which will use its OpcLabs.EasyOpc.UA.NodeSpace.UAServerNode.EffectiveNodeDescriptor property for the operation.

The value of this parameter can be null (Nothing in Visual Basic).

Return Value

Returns the node Id.

Because there is an implicit conversion from UANodeId to OpcLabs.EasyOpc.UA.UANodeDescriptor, in languages that support implicit conversion operators (such as C# or VB.NET), you can simply use the returned UANodeId in any place where the OpcLabs.EasyOpc.UA.UANodeDescriptor is expected as input, and the corresponding node descriptor will be constructed automatically.

Also, because the UANodeId has an implicit conversion to System.String, and it converts to the expanded text of the node Id (ExpandedText), in languages that support implicit conversion operators (such as C# or VB.NET), you can simply use the returned UANodeId in any place where expanded text of a node Id (a string) is expected as input, and the corresponding expanded text will be taken automatically from the node Id.

This method can return null (Nothing in Visual Basic).

Remarks

The conversion operator is explicit, because not in all cases the node descriptor contains a usable node Id.

This method or property does not throw any exceptions, aside from execution exceptions such as System.Threading.ThreadAbortException or System.OutOfMemoryException.

OPC UA node Id, represented by the UANodeId class, directly identifies a node in a server's address space.

Requirements

Target Platforms: .NET Framework: Windows 10 (selected versions), Windows 11 (selected versions), Windows Server 2016, Windows Server 2022; .NET: Linux, macOS, Microsoft Windows

See Also

Reference

UANodeId Class
UANodeId Members
Overload List
OPC UA Node IDs
Namespace indices in OPC UA Node Ids