OPC Studio User's Guide and Reference
FromString Method (UANodeDescriptor)



OpcLabs.EasyOpcUA Assembly > OpcLabs.EasyOpc.UA Namespace > UANodeDescriptor Class : FromString Method
An node Id expanded text (contains namespace URI, and namespace-relative node Id).

The value represents an expanded text of an OPC UA node Id. Any string can be passed to this parameter (i.e. will not cause System.ArgumentException), but not all values make sense and will work when an operation using them is attempted. Example of node Id expanded texts are "nsu=http://test.org/UA/Data/;i=10853" or "ns=1;s=SomeNode".

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

Converts a System.String to a node descriptor.
Syntax
'Declaration
 
<CanBeNullAttribute()>
<ContractAnnotationAttribute("null => null; notnull => notnull")>
Public Shared Function FromString( _
   ByVal nodeIdExpandedText As String _
) As UANodeDescriptor
'Usage
 
Dim nodeIdExpandedText As String
Dim value As UANodeDescriptor
 
value = UANodeDescriptor.FromString(nodeIdExpandedText)
[CanBeNull()]
[ContractAnnotation("null => null; notnull => notnull")]
public static UANodeDescriptor FromString( 
   string nodeIdExpandedText
)
[CanBeNull()]
[ContractAnnotation("null => null; notnull => notnull")]
public:
static UANodeDescriptor^ FromString( 
   String^ nodeIdExpandedText
) 

Parameters

nodeIdExpandedText
An node Id expanded text (contains namespace URI, and namespace-relative node Id).

The value represents an expanded text of an OPC UA node Id. Any string can be passed to this parameter (i.e. will not cause System.ArgumentException), but not all values make sense and will work when an operation using them is attempted. Example of node Id expanded texts are "nsu=http://test.org/UA/Data/;i=10853" or "ns=1;s=SomeNode".

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

Return Value

For a non-null input, returns the node descriptor with the given node Id expanded text. Returns null if the input is null.

Because there are implicit conversions to OpcLabs.EasyOpc.UA.Navigation.UANamedNodeDescriptor and OpcLabs.EasyOpc.UA.Navigation.UANamedNodePath from UANodeDescriptor, in languages that support implicit conversion operators (such as C# or VB.NET), you can simply use the returned UANodeDescriptor in any place where OpcLabs.EasyOpc.UA.Navigation.UANamedNodeDescriptor is expected (in this case the UANodeDescriptor contains the final node descriptor) or where OpcLabs.EasyOpc.UA.Navigation.UANamedNodePath is expected (in this case the UANodeDescriptor contains the base and only node in the named node path), and the corresponding OPC UA named node descriptor or named node path will be constructed automatically. When the implicit conversion operators are not supported (such as with Python.NET), you can use the OpcLabs.EasyOpc.UA.Navigation.UANamedNodeDescriptor.FromUANodeDescriptor or OpcLabs.EasyOpc.UA.Navigation.UANamedNodePath.FromUANodeDescriptor static method instead.

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

Remarks

In languages that support implicit conversions (such as C# or VB.NET), in many cases you do not have call this method explicitly. When indicated, a call to an available equivalent implicit conversion operator will be created by the compiler automatically.

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

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