# IOpcDataTypeInfo Members

> Reference: Defines type declaration information used for data types.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">IOpcDataTypeInfo</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx">Opc.UaFx</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
<dt>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

## Properties

### BaseType

Gets the type from which the current [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) directly inherits.

<div class="api-signature" data-lang="csharp">

```csharp
IOpcDataTypeInfo BaseType { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property BaseType As IOpcDataTypeInfo
```

</div>

**Property value**

[IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/)

An instance of the [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) which represents the type from which the current [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) directly inherits or a null reference (Nothing in Visual Basic) if the type does not inherit from a different [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/).

### Encoding

Gets the information used to identify the type of encoding used for the data of the type represented.

<div class="api-signature" data-lang="csharp">

```csharp
OpcEncoding Encoding { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property Encoding As OpcEncoding
```

</div>

**Property value**

[OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/)

An instance of the [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) class which represents the information used to encode data of the type or a null reference (Nothing in Visual Basic) if is no encoding information associated with the type.

### EncodingMask

Gets the characteristics used to encode the existence of optional fields.

<div class="api-signature" data-lang="csharp">

```csharp
OpcEncodingMask EncodingMask { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property EncodingMask As OpcEncodingMask
```

</div>

**Property value**

[OpcEncodingMask](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingmask/)

An instance of the [OpcEncodingMask](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingmask/) class.

### Encodings

Gets information of all encodings supported by the type represented.

<div class="api-signature" data-lang="csharp">

```csharp
OpcEncoding[] Encodings { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property Encodings As OpcEncoding()
```

</div>

**Property value**

[OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/)[]

An array of [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) instances supported by the type.

### IsArray

Gets a value indicating whether the type is an array.

<div class="api-signature" data-lang="csharp">

```csharp
bool IsArray { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property IsArray As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the current type is an array; otherwise the value false.

### IsEnum

Gets a value indicating whether the current [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) represents an enumeration.

<div class="api-signature" data-lang="csharp">

```csharp
bool IsEnum { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property IsEnum As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the current [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) represents an enumeration; otherwise the value false.

**Remarks**

The OPC UA handles enumerations as a numeric value that has a fixed set of valid values. The encoded value described by an enumeration is always an unsigned integer (see [uint](https://learn.microsoft.com/dotnet/api/system.uint32)) with a fixed size.

### IsOpaque

Gets a value indicating whether the current [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) describes a primitive fixed size type.

<div class="api-signature" data-lang="csharp">

```csharp
bool IsOpaque { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property IsOpaque As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the current [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) represents an opaque type; otherwise the value false.

### IsPrimitive

Gets a value indicating whether the [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) is one of the primitive types.

<div class="api-signature" data-lang="csharp">

```csharp
bool IsPrimitive { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property IsPrimitive As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) is one of the primitive types; otherwise the value false.

### IsStruct

Gets a value indicating whether the [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) is a structured type; that is not a value type.

<div class="api-signature" data-lang="csharp">

```csharp
bool IsStruct { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property IsStruct As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) is a structured type; otherwise the value false.

**Remarks**

The OPC UA handles structures as a sequence of values. Each value in the sequence is called a field. A field may specify that zero, one or multiple instances of the type appear within the sequence described by the structure. Some fields have lengths that are not multiples of 8 bits. Several of these fields may appear in a sequence in a structure, however, the total number of bits used in the sequence shall be aligned on a byte boundary. A sequence of fields which do not line up on byte boundaries are specified from the least significant bit to the most significant bit. Sequences which are longer than one byte overflow from the most significant bit to the first byte into the least significant bit of the next byte.

### IsSystemType

Gets a value indicating whether the current [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) represents one of the predefined built-in data types defined by the OPC UA.

<div class="api-signature" data-lang="csharp">

```csharp
bool IsSystemType { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property IsSystemType As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the current data type represents a OPC UA is a built-in type; otherwise the value false.

### IsUnion

<span class="api-meta">since v2.32</span>

Gets a value indicating whether the current [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) represents a type which is only transported using a field indicator and the field indicated.

<div class="api-signature" data-lang="csharp">

```csharp
bool IsUnion { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property IsUnion As Boolean
```

</div>

**Property value**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the current data type represents an union type; otherwise the value false.

### Name

Gets a value which defines the non-localizable human-readable name of the type represented. A node which represents this [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) uses the [Name](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/members#name) as its [BrowseName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#browsename).

<div class="api-signature" data-lang="csharp">

```csharp
OpcName Name { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property Name As OpcName
```

</div>

**Property value**

[OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/)

An instance of the [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) class with the [string](https://learn.microsoft.com/dotnet/api/system.string) used as the name of the type which does not unambiguously identify the [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/).

### Size

Gets the size of the type represented as the number of bytes required.

<div class="api-signature" data-lang="csharp">

```csharp
long? Size { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property Size As Long?
```

</div>

**Property value**

[Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[Int64](https://learn.microsoft.com/dotnet/api/system.int64)&gt;

The size of the type as the number of bytes required; if this [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) represents a type with a fixed size (see [IsOpaque](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/members#isopaque)).

### SizeInBits

Gets the size of the type represented as the number of bits required.

<div class="api-signature" data-lang="csharp">

```csharp
long? SizeInBits { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property SizeInBits As Long?
```

</div>

**Property value**

[Nullable](https://learn.microsoft.com/dotnet/api/system.nullable-1)&lt;[Int64](https://learn.microsoft.com/dotnet/api/system.int64)&gt;

The size of the type as the number of bits required; if this [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) represents a type with a fixed size (see [IsOpaque](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/members#isopaque)).

### TypeId

Gets a value which identifies the type represented. A node which represents this [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) uses the [TypeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/members#typeid) as its [NodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcattribute/#nodeid).

<div class="api-signature" data-lang="csharp">

```csharp
OpcNodeId TypeId { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property TypeId As OpcNodeId
```

</div>

**Property value**

[OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/)

An instance of the [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) class used as the identifier of the type which unambiguously identifies the [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/).

### UnderlyingType

Gets the type which provides the implementation of the [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/).

<div class="api-signature" data-lang="csharp">

```csharp
Type UnderlyingType { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
ReadOnly Property UnderlyingType As Type
```

</div>

**Property value**

[Type](https://learn.microsoft.com/dotnet/api/system.type)

The [Type](https://learn.microsoft.com/dotnet/api/system.type) which implements the type declared or a null reference (Nothing in Visual Basic) if there does not exist a declaration of the type described by this [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/).

## Methods

### GetArrayRank

Gets the number of dimensions in an array.

<div class="api-signature" data-lang="csharp">

```csharp
int GetArrayRank()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Function GetArrayRank() As Integer
```

</div>

**Returns**

[Int32](https://learn.microsoft.com/dotnet/api/system.int32)

An integer that contains the number of dimensions in the current type.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The current type is not an array. |

### GetElementType

Returns the [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) of the object encompassed or referred to by the current array.

<div class="api-signature" data-lang="csharp">

```csharp
IOpcDataTypeInfo GetElementType()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Function GetElementType() As IOpcDataTypeInfo
```

</div>

**Returns**

[IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/)

The [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) of the object encompassed or referred to by the current array or null if the current [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) is not an array.

### GetField

Searches for the field with the specified `name`.

<div class="api-signature" data-lang="csharp">

```csharp
IOpcDataFieldInfo GetField(string name)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Function GetField(name As String) As IOpcDataFieldInfo
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `name` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The [string](https://learn.microsoft.com/dotnet/api/system.string) containing the name of the data field to get. |

**Returns**

[IOpcDataFieldInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatafieldinfo/)

An instance of the [IOpcDataFieldInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatafieldinfo/) representing the field with the specified name, if found; otherwise a null reference (Nothing in Visual Basic).

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `name` is a null reference (Nothing in Visual Basic). |

**Remarks**

The `name` specified is compared using [Ordinal](https://learn.microsoft.com/dotnet/api/system.stringcomparison#system-stringcomparison-ordinal).

### GetFields

Returns all the fields of the current [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/).

<div class="api-signature" data-lang="csharp">

```csharp
IOpcDataFieldInfo[] GetFields()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Function GetFields() As IOpcDataFieldInfo()
```

</div>

**Returns**

[IOpcDataFieldInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatafieldinfo/)[]

An array of [IOpcDataFieldInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatafieldinfo/) objects representing all the fields defined for the current [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) or an empty array of type [IOpcDataFieldInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatafieldinfo/) if no fields are defined for the current [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/).

### MakeArrayType

<span class="api-meta">2 overloads</span>

| Overload | Description |
|---|---|
| [MakeArrayType()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/members#makearraytype-noparams) | Returns a [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) object representing a one-dimensional array of the current type, with a lower bound of zero. |
| [MakeArrayType(int)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/members#makearraytype-system-int32) | Returns a [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) object representing an array of the current type, with the specified number of dimensions. |

#### MakeArrayType()

Returns a [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) object representing a one-dimensional array of the current type, with a lower bound of zero.

<div class="api-signature" data-lang="csharp">

```csharp
IOpcDataTypeInfo MakeArrayType()
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Function MakeArrayType() As IOpcDataTypeInfo
```

</div>

**Returns**

[IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/)

A [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) object representing a one-dimensional array of the current type, with a lower bound of zero.

#### MakeArrayType(int)

Returns a [IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/) object representing an array of the current type, with the specified number of dimensions.

<div class="api-signature" data-lang="csharp">

```csharp
IOpcDataTypeInfo MakeArrayType(int rank)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Function MakeArrayType(rank As Integer) As IOpcDataTypeInfo
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `rank` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | The number of dimensions for the array. This number must be less than or equal to 32. |

**Returns**

[IOpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypeinfo/)

An object representing an array of the current type, with the specified number of dimensions.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentOutOfRangeException](https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception) | The `rank` is not between 1 and 32 (inclusive). |
