OPC Studio User's Guide and Reference
DataTypeId Property (UADataVariable)



OpcLabs.ServerOpcUA Assembly > OpcLabs.EasyOpc.UA.NodeSpace Namespace > UADataVariable Class : DataTypeId Property
Specifies the OPC UA data type of the variable value.
Syntax
'Declaration
 
<NotNullAttribute()>
Public Property DataTypeId As UANodeId
'Usage
 
Dim instance As UADataVariable
Dim value As UANodeId
 
instance.DataTypeId = value
 
value = instance.DataTypeId
[NotNull()]
public UANodeId DataTypeId {get; set;}
[NotNull()]
public:
property UANodeId^ DataTypeId {
   UANodeId^ get();
   void set (    UANodeId^ value);
}

Property Value

The data type Id, represented by a OpcLabs.EasyOpc.UA.AddressSpace.UANodeId, that specifies the type of data this variable holds.

The value of this property cannot be null (Nothing in Visual Basic).

Because there is an implicit conversion from OpcLabs.EasyOpc.UA.AddressSpace.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 OpcLabs.EasyOpc.UA.AddressSpace.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 OpcLabs.EasyOpc.UA.AddressSpace.UANodeId has an implicit conversion to System.String, and it converts to the expanded text of the node Id (OpcLabs.EasyOpc.UA.AddressSpace.UANodeId.ExpandedText), in languages that support implicit conversion operators (such as C# or VB.NET), you can simply use the returned OpcLabs.EasyOpc.UA.AddressSpace.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.

Exceptions
ExceptionDescription

A null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument.

This is a usage error, i.e. it will never occur (the exception will not be thrown) in a correctly written program. Your code should not catch this exception.

Remarks

The data type ID is crucial for clients to understand the type of data the variable contains, also allowing for appropriate encoding and decoding of the variable's value.

For standard data types, see OpcLabs.EasyOpc.UA.AddressSpace.Standard.UADataTypeIds.

Because the OpcLabs.EasyOpc.UA.AddressSpace.UANodeId has an implicit conversion from System.String, in languages that support implicit conversion operators (such as C# or VB.NET), you can simply use a string (representing the expanded text of the nodeId) in place of OpcLabs.EasyOpc.UA.AddressSpace.UANodeId value when setting this property, and the corresponding OPC UA node Id will be constructed automatically. When the implicit conversion operators are not supported (such as with Python.NET), you can use the OpcLabs.EasyOpc.UA.AddressSpace.UANodeId.UANodeId Constructor(String) constructor instead.

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