OPC Studio User's Guide and Reference
DataType Property (_GenericData)



OpcLabs.BaseLib Assembly > OpcLabs.BaseLib.DataTypeModel.ComTypes Namespace > _GenericData Interface : DataType Property
The associated data type of the generic data.
Syntax
'Declaration
 
<CanBeNullAttribute()>
Property DataType As DataType
'Usage
 
Dim instance As _GenericData
Dim value As DataType
 
instance.DataType = value
 
value = instance.DataType
[CanBeNull()]
DataType DataType {get; set;}
[CanBeNull()]
property DataType^ DataType {
   DataType^ get();
   void set (    DataType^ value);
}

Property Value

This value of this property can be null (Nothing in Visual Basic).

The default value of this property is null.

Exceptions
ExceptionDescription

One of the arguments provided to a method is not valid.

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

When the OpcLabs.BaseLib.DataTypeModel.GenericData is returned from the server by the component (e.g. from read operations or by subscriptions), this property is always filled in (i.e. not null).

When the OpcLabs.BaseLib.DataTypeModel.GenericData is passed in to the component for transfer to the server (e.g. to a write operation), it is optional. When not null, the component checks the value in OpcLabs.BaseLib.DataTypeModel.GenericData against the data type given by this property, and issues an error if the value does not conform to the type. It is allowed for this property to be not null at some higher level, and be null at lower level, such as for an individual field of a structure.

When the data type is given and passed to the component, it is only used for the checks described above. It does not influence the actual encoding of the values, and the encoding process may further reject some input values as not conforming to the encoding.

This member or type is for use from COM. It is not meant to be used from .NET or Python. Refer to the corresponding .NET member or type instead, if you are developing in .NET or Python.

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