# OpcData Members

> Reference: Defines an abstract base class of data objects used and provided in the ecosystem of a specific OPC UA Server.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcData</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>

## Constructors

### OpcData

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

| Overload | Description |
|---|---|
| [OpcData()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#opcdata-noparams)<span class="api-meta">protected · since v2.32</span> | Initializes a new instance of the [OpcData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/) class. |
| [OpcData(IOpcDataStore)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#opcdata-opc-uafx-iopcdatastore)<span class="api-meta">protected</span> | Initializes a new instance of the [OpcData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/) class using the `dataStore` specified. |

#### OpcData()

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

Initializes a new instance of the [OpcData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/) class.

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

```csharp
protected OpcData()
```

</div>

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

```vbnet
Protected Sub New()
```

</div>

#### OpcData(IOpcDataStore)

<span class="api-meta">protected</span>

Initializes a new instance of the [OpcData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/) class using the `dataStore` specified.

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

```csharp
protected OpcData(IOpcDataStore dataStore)
```

</div>

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

```vbnet
Protected Sub New(dataStore As IOpcDataStore)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `dataStore` | [IOpcDataStore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatastore/) | The [IOpcDataStore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatastore/) of the object data to represent. |

**Exceptions**

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

## Properties

### DataStore

<span class="api-meta">protected</span>

Gets the [IOpcDataStore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatastore/) which contains the data of this [OpcData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/) instance.

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

```csharp
protected IOpcDataStore DataStore { get; }
```

</div>

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

```vbnet
Protected ReadOnly Property DataStore As IOpcDataStore
```

</div>

**Property value**

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

An instance implementing the [IOpcDataStore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatastore/) interface containing the object data represented by this [OpcData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/) instance.

## Methods

### Decode

<span class="api-meta">static · 3 overloads</span>

| Overload | Description |
|---|---|
| [Decode&lt;T&gt;(OpcContext, byte\[\])](#decode-t1-opc-uafx-opccontext-system-byte-array)<span class="api-meta">static · since v2.40</span> | Converts the `buffer` specified to the `T` defined. |
| [Decode&lt;T&gt;(OpcContext, Stream)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#decode-t1-opc-uafx-opccontext-system-io-stream)<span class="api-meta">static · since v2.40</span> | Converts the data in the `stream` specified to the `T` defined. |
| [Decode&lt;T&gt;(OpcContext, OpcRawObject)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#decode-t1-opc-uafx-opccontext-opc-uafx-opcrawobject)<span class="api-meta">static · since v2.58</span> | Converts the `value` specified to the `T` defined. |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The decoding has failed. For more details exception data. |

#### Decode&lt;T&gt;(OpcContext, byte\[\])

<span class="api-meta">static · since v2.40</span>

Converts the `buffer` specified to the `T` defined.

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

```csharp
public static T Decode<T>(OpcContext context, byte[] buffer) where T : new()
```

</div>

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

```vbnet
Public Shared Function Decode(Of T As New)(
    context As OpcContext,
    buffer As Byte()) As T
```

</div>

**Type parameters**

| Name | Description |
|---|---|
| `T` | The type to decode with a default constructor. |

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) | The [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) to use to decode the `buffer`. |
| `buffer` | [Byte](https://learn.microsoft.com/dotnet/api/system.byte)[] | An array of [byte](https://learn.microsoft.com/dotnet/api/system.byte) values to decode. |

**Returns**

T

A new instance of the type defined by `T` and decoded with the information in the `buffer`.

**Exceptions**

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

#### Decode&lt;T&gt;(OpcContext, Stream)

<span class="api-meta">static · since v2.40</span>

Converts the data in the `stream` specified to the `T` defined.

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

```csharp
public static T Decode<T>(OpcContext context, Stream stream) where T : new()
```

</div>

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

```vbnet
Public Shared Function Decode(Of T As New)(
    context As OpcContext,
    stream As Stream) As T
```

</div>

**Type parameters**

| Name | Description |
|---|---|
| `T` | The type to decode with a default constructor. |

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) | The [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) to use to decode the `stream` data. |
| `stream` | [Stream](https://learn.microsoft.com/dotnet/api/system.io.stream) | A [Stream](https://learn.microsoft.com/dotnet/api/system.io.stream) its data is to be decoded. |

**Returns**

T

A new instance of the type defined by `T` and decoded with the information in the `stream`.

**Exceptions**

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

#### Decode&lt;T&gt;(OpcContext, OpcRawObject)

<span class="api-meta">static · since v2.58</span>

Converts the `value` specified to the `T` defined.

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

```csharp
public static T Decode<T>(
    OpcContext context,
    OpcRawObject value)
    where T : new()
```

</div>

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

```vbnet
Public Shared Function Decode(Of T As New)(
    context As OpcContext,
    value As OpcRawObject) As T
```

</div>

**Type parameters**

| Name | Description |
|---|---|
| `T` | The type to decode with a default constructor. |

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) | The [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) to use to decode the `value`. |
| `value` | [OpcRawObject](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrawobject/) | The [OpcRawObject](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrawobject/) to decode, either binary or XML encoded. |

**Returns**

T

A new instance of the type defined by `T` and decoded with the information in the [RawData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrawobject/members#rawdata) of the `value`.

**Exceptions**

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

### DeepCopy

<span class="api-meta">protected · virtual</span>

Creates a copy of the current [OpcData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/), which the SDK uses whenever it copies an encodable value of it.

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

```csharp
protected virtual object DeepCopy()
```

</div>

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

```vbnet
Protected Overridable Function DeepCopy() As Object
```

</div>

**Returns**

[Object](https://learn.microsoft.com/dotnet/api/system.object)

A new object which is a copy of the current [OpcData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/).

**Remarks**

The default implementation creates a shallow copy (see [MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone)). Override it to copy referenced objects too.

### Encode

<span class="api-meta">static · 2 overloads · since v2.58</span>

| Overload | Description |
|---|---|
| [Encode(OpcContext, object)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#encode-opc-uafx-opccontext-system-object)<span class="api-meta">static · since v2.58</span> | Encodes the `value` specified using its [Binary](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/#binary) encoding. |
| [Encode(OpcContext, object, OpcEncodingType)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#encode-opc-uafx-opccontext-system-object-opc-uafx-opcencodingtype)<span class="api-meta">static · since v2.58</span> | Encodes the `value` specified using its encoding of the `encodingType` specified. |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `context` or `value` is a null reference (Nothing in Visual Basic). |
| [OpcException](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcexception/) | The encoding has failed. |

#### Encode(OpcContext, object)

<span class="api-meta">static · since v2.58</span>

Encodes the `value` specified using its [Binary](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/#binary) encoding.

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

```csharp
public static OpcRawObject Encode(OpcContext context, object value)
```

</div>

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

```vbnet
Public Shared Function Encode(
    context As OpcContext,
    value As Object) As OpcRawObject
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) | The [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) to use to encode the `value`. |
| `value` | [Object](https://learn.microsoft.com/dotnet/api/system.object) | The value of a structured data type to encode. |

**Returns**

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

A new instance of the [OpcRawObject](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrawobject/) class with the encoded `value`.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `value` is not the value of a structured data type or its data type does not state a binary encoding. |

#### Encode(OpcContext, object, OpcEncodingType)

<span class="api-meta">static · since v2.58</span>

Encodes the `value` specified using its encoding of the `encodingType` specified.

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

```csharp
public static OpcRawObject Encode(
    OpcContext context,
    object value,
    OpcEncodingType encodingType)
```

</div>

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

```vbnet
Public Shared Function Encode(
    context As OpcContext,
    value As Object,
    encodingType As OpcEncodingType) As OpcRawObject
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `context` | [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) | The [OpcContext](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opccontext/) to use to encode the `value`. |
| `value` | [Object](https://learn.microsoft.com/dotnet/api/system.object) | The value of a structured data type to encode. |
| `encodingType` | [OpcEncodingType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/) | One of the members defined by the [OpcEncodingType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/) enumeration which states the encoding to use. |

**Returns**

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

A new instance of the [OpcRawObject](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcrawobject/) class with the encoded `value`.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `value` is not the value of a structured data type or its data type does not state an encoding of the `encodingType`. |

### GetDataStore

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

Retrieves the [IOpcDataStore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatastore/) which contains the data of this [OpcData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/) instance.

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

```csharp
protected virtual IOpcDataStore GetDataStore()
```

</div>

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

```vbnet
Protected Overridable Function GetDataStore() As IOpcDataStore
```

</div>

**Returns**

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

The [IOpcDataStore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatastore/) which contains the data of this [OpcData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/) instance. The default implementation returns the data store passed to the constructor.

**Remarks**

The [DataStore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#datastore) property calls this method once, on its first access, if no data store was passed to the constructor. Override it to provide the data store on demand.

### GetType

<span class="api-meta">static</span>

Retrieves the [Type](https://learn.microsoft.com/dotnet/api/system.type) which implementes the data type which is identified by the `typeId` specified.

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

```csharp
public static Type GetType(OpcNodeId typeId)
```

</div>

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

```vbnet
Public Shared Function [GetType](typeId As OpcNodeId) As Type
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `typeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) which identifies the [Type](https://learn.microsoft.com/dotnet/api/system.type) to retrieve. |

**Returns**

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

The [Type](https://learn.microsoft.com/dotnet/api/system.type) which is known under the `typeId` specified or a null reference (Nothing in Visual Basic) if there doesn't exist a known [Type](https://learn.microsoft.com/dotnet/api/system.type) which is associated with the `typeId` specified.

**Exceptions**

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

### GetTypeInfo

<span class="api-meta">static · 4 overloads</span>

| Overload | Description |
|---|---|
| [GetTypeInfo&lt;T&gt;()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#gettypeinfo-t1)<span class="api-meta">static</span> | Retrieves the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) which declares the data type implemented by the `T` specified. |
| [GetTypeInfo(OpcEncoding)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#gettypeinfo-opc-uafx-opcencoding)<span class="api-meta">static</span> | Retrieves the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) which declares the data type which is identified by the `encoding` specified. |
| [GetTypeInfo(OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#gettypeinfo-opc-uafx-opcnodeid)<span class="api-meta">static</span> | Retrieves the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) which declares the data type which is identified by the `typeId` specified. |
| [GetTypeInfo(Type)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#gettypeinfo-system-type)<span class="api-meta">static</span> | Retrieves the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) which declares the data type implemented by the `underlyingType` specified. |

#### GetTypeInfo&lt;T&gt;()

<span class="api-meta">static</span>

Retrieves the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) which declares the data type implemented by the `T` specified.

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

```csharp
public static OpcDataTypeInfo GetTypeInfo<T>()
```

</div>

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

```vbnet
Public Shared Function GetTypeInfo(Of T)() As OpcDataTypeInfo
```

</div>

**Type parameters**

| Name | Description |
|---|---|
| `T` | The [Type](https://learn.microsoft.com/dotnet/api/system.type) which implements the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) to retrieve. |

**Returns**

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

The [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) which declares the `T` specified or a null reference (Nothing in Visual Basic) if there isn't a [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) associated with the `T` specified.

#### GetTypeInfo(OpcEncoding)

<span class="api-meta">static</span>

Retrieves the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) which declares the data type which is identified by the `encoding` specified.

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

```csharp
public static OpcDataTypeInfo GetTypeInfo(OpcEncoding encoding)
```

</div>

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

```vbnet
Public Shared Function GetTypeInfo(encoding As OpcEncoding) As OpcDataTypeInfo
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `encoding` | [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) | The [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) which identifies the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) to retrieve. |

**Returns**

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

The [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) which is known under the `encoding` specified or a null reference (Nothing in Visual Basic) if there doesn't exist a known [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) which is associated with the `encoding` specified.

**Exceptions**

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

#### GetTypeInfo(OpcNodeId)

<span class="api-meta">static</span>

Retrieves the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) which declares the data type which is identified by the `typeId` specified.

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

```csharp
public static OpcDataTypeInfo GetTypeInfo(OpcNodeId typeId)
```

</div>

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

```vbnet
Public Shared Function GetTypeInfo(typeId As OpcNodeId) As OpcDataTypeInfo
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `typeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) which identifies the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) to retrieve. |

**Returns**

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

The [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) which is known under the `typeId` specified or a null reference (Nothing in Visual Basic) if there doesn't exist a known [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) which is associated with the `typeId` specified.

**Exceptions**

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

#### GetTypeInfo(Type)

<span class="api-meta">static</span>

Retrieves the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) which declares the data type implemented by the `underlyingType` specified.

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

```csharp
public static OpcDataTypeInfo GetTypeInfo(Type underlyingType)
```

</div>

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

```vbnet
Public Shared Function GetTypeInfo(underlyingType As Type) As OpcDataTypeInfo
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `underlyingType` | [Type](https://learn.microsoft.com/dotnet/api/system.type) | The [Type](https://learn.microsoft.com/dotnet/api/system.type) which implements the [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) to retrieve. |

**Returns**

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

The [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) which declares the `underlyingType` specified or a null reference (Nothing in Visual Basic) if there isn't a [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) associated with the `underlyingType` specified.

**Exceptions**

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

### New

<span class="api-meta">static</span>

Creates a new instance of the [OpcDataObject](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdataobject/) class using the `dataType` specified.

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

```csharp
public static OpcDataObject New(OpcDataTypeInfo dataType)
```

</div>

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

```vbnet
Public Shared Function [New](dataType As OpcDataTypeInfo) As OpcDataObject
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `dataType` | [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) | The [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) which declares the type of data type instance the new [OpcDataObject](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdataobject/) shall represent. |

**Returns**

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

An instance of the [OpcDataObject](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdataobject/) which can be used to dynamically access data type instance information.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `dataType` is not a structured data type (see [IsStruct](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/members#isstruct)). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `dataType` is a null reference (Nothing in Visual Basic). |

### NewArray

<span class="api-meta">static</span>

Creates a one-dimensional array of [OpcDataObject](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdataobject/) objects using the `dataType` and `length` with zero-based indexing.

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

```csharp
public static OpcDataObject[] NewArray(OpcDataTypeInfo dataType, int length)
```

</div>

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

```vbnet
Public Shared Function NewArray(
    dataType As OpcDataTypeInfo,
    length As Integer) As OpcDataObject()
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `dataType` | [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) | The [OpcDataTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/) which declares the type of data type instance the new [OpcDataObject](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdataobject/) shall represent. |
| `length` | [Int32](https://learn.microsoft.com/dotnet/api/system.int32) | An size of the array to create. |

**Returns**

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

A new one-dimensional array of [OpcDataObject](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdataobject/) instances which can be used to dynamically access array-based data type information

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `dataType` is not a structured data type (see [IsStruct](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeinfo/members#isstruct)). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `dataType` is a null reference (Nothing in Visual Basic). |

### RegisterType

<span class="api-meta">static · 6 overloads</span>

| Overload | Description |
|---|---|
| [RegisterType&lt;T&gt;()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#registertype-t1)<span class="api-meta">static</span> | Registers the type defined by `T` as the data object type to create in case there a data instance is to be created for the type definition identified by the [OpcDataTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/) defined on the `T` specified. |
| [RegisterType(Type)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#registertype-system-type)<span class="api-meta">static · since v2.14</span> | Registers the `dataType` specified as the data object type to create in case there a data instance is to be created for the type definition identified by the [OpcDataTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/) defined on the `dataType` specified. |
| [RegisterType&lt;T&gt;(OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#registertype-t1-opc-uafx-opcnodeid)<span class="api-meta">static</span> | Registers the type defined by `T` as the data object type to create in case there a data instance is to be created for the type definition identified by the `dataTypeId` specified. |
| [RegisterType(Type, OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#registertype-system-type-opc-uafx-opcnodeid)<span class="api-meta">static · since v2.14</span> | Registers the `dataType` specified as the data object type to create in case there a data instance is to be created for the type definition identified by the `dataTypeId` specified. |
| [RegisterType&lt;T&gt;(OpcNodeId, params OpcEncoding\[\])](#registertype-t1-opc-uafx-opcnodeid-opc-uafx-opcencoding-array)<span class="api-meta">static</span> | Registers the type defined by `T` as the data object type to create in case there a data instance is to be created for the type definition identified by the `dataTypeId` or by one of the `dataTypeEncodings` specified. |
| [RegisterType(Type, OpcNodeId, params OpcEncoding\[\])](#registertype-system-type-opc-uafx-opcnodeid-opc-uafx-opcencoding-array)<span class="api-meta">static · since v2.14</span> | Registers the `dataType` specified as the data object type to create in case there a data instance is to be created for the type definition identified by the `dataTypeId` or by one of the `dataTypeEncodings` specified. |

#### RegisterType&lt;T&gt;()

<span class="api-meta">static</span>

Registers the type defined by `T` as the data object type to create in case there a data instance is to be created for the type definition identified by the [OpcDataTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/) defined on the `T` specified.

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

```csharp
public static void RegisterType<T>()
```

</div>

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

```vbnet
Public Shared Sub RegisterType(Of T)()
```

</div>

**Type parameters**

| Name | Description |
|---|---|
| `T` | The type to use in case there a data object for the data definition equals to the data type identifier defined using the [OpcDataTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/) is to be created. The type needs to provide either a public accessible parameterless constructor or a public accessible constructor accepting an instance of the [IOpcDataStore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatastore/) interface and then needs to be a subclass of the [OpcData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/) class. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The type `T` does not define a public accessible parameterless constructor or a public accessible constructor accepting an instance of the [IOpcDataStore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatastore/) interface or any data type specific attribute offers invalid information about the data type to associate with the [Type](https://learn.microsoft.com/dotnet/api/system.type). |

#### RegisterType(Type)

<span class="api-meta">static · since v2.14</span>

Registers the `dataType` specified as the data object type to create in case there a data instance is to be created for the type definition identified by the [OpcDataTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/) defined on the `dataType` specified.

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

```csharp
public static void RegisterType(Type dataType)
```

</div>

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

```vbnet
Public Shared Sub RegisterType(dataType As Type)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `dataType` | [Type](https://learn.microsoft.com/dotnet/api/system.type) | The [Type](https://learn.microsoft.com/dotnet/api/system.type) to use in case there a data object for the data type definition equals to the data type identifier defined using the [OpcDataTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/) is to be created. The type needs to provide either a public accessible parameterless constructor or a public accessible constructor accepting an instance of the [IOpcDataStore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatastore/) interface and then needs to be a subclass of the [OpcData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/) class. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `dataType` does not define a public accessible parameterless constructor or a public accessible constructor accepting an instance of the [IOpcDataStore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatastore/) interface or any data type specific attribute offers invalid information about the data type to associate with the [Type](https://learn.microsoft.com/dotnet/api/system.type). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `dataType` is a null reference (Nothing in Visual Basic). |

#### RegisterType&lt;T&gt;(OpcNodeId)

<span class="api-meta">static</span>

Registers the type defined by `T` as the data object type to create in case there a data instance is to be created for the type definition identified by the `dataTypeId` specified.

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

```csharp
public static void RegisterType<T>(OpcNodeId dataTypeId)
```

</div>

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

```vbnet
Public Shared Sub RegisterType(Of T)(dataTypeId As OpcNodeId)
```

</div>

**Type parameters**

| Name | Description |
|---|---|
| `T` | The type to use in case there a data object for the data definition equals to `dataTypeId` is to be created. The type needs to provide either a public accessible parameterless constructor or a public accessible constructor accepting an instance of the [IOpcDataStore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatastore/) interface and then needs to be a subclass of the [OpcData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/) class. |

**Parameters**

| Name | Type | Description |
|---|---|---|
| `dataTypeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The identifier of the type definition for which the `T` is to be used to create a data object instance. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The type `T` does not define a public accessible parameterless constructor or a public accessible constructor accepting an instance of the [IOpcDataStore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatastore/) interface or any data type specific attribute offers invalid information about the data type to associate with the [Type](https://learn.microsoft.com/dotnet/api/system.type). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `dataTypeId` is a null reference (Nothing in Visual Basic). |

**Remarks**

It is not possible to register the same or a different data type for the `dataTypeId` specified as long there is already a data type registered for the type definition specified by `dataTypeId`.

#### RegisterType(Type, OpcNodeId)

<span class="api-meta">static · since v2.14</span>

Registers the `dataType` specified as the data object type to create in case there a data instance is to be created for the type definition identified by the `dataTypeId` specified.

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

```csharp
public static void RegisterType(Type dataType, OpcNodeId dataTypeId)
```

</div>

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

```vbnet
Public Shared Sub RegisterType(dataType As Type, dataTypeId As OpcNodeId)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `dataType` | [Type](https://learn.microsoft.com/dotnet/api/system.type) | The [Type](https://learn.microsoft.com/dotnet/api/system.type) to use in case there a data object for the data type definition equals to `dataTypeId` is to be created. The type needs to provide either a public accessible parameterless constructor or a public accessible constructor accepting an instance of the [IOpcDataStore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatastore/) interface and then needs to be a subclass of the [OpcData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/) class. |
| `dataTypeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The identifier of the type definition for which the `dataType` is to be used to create a data object instance. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `dataType` does not define a public accessible parameterless constructor or a public accessible constructor accepting an instance of the [IOpcDataStore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatastore/) interface or any data type specific attribute offers invalid information about the data type to associate with the [Type](https://learn.microsoft.com/dotnet/api/system.type). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `dataType` or `dataTypeId` is a null reference (Nothing in Visual Basic). |

**Remarks**

It is not possible to register the same or a different data type for the `dataTypeId` specified as long there is already a data type registered for the type definition specified by `dataTypeId`.

#### RegisterType&lt;T&gt;(OpcNodeId, params OpcEncoding\[\])

<span class="api-meta">static</span>

Registers the type defined by `T` as the data object type to create in case there a data instance is to be created for the type definition identified by the `dataTypeId` or by one of the `dataTypeEncodings` specified.

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

```csharp
public static void RegisterType<T>(
    OpcNodeId dataTypeId,
    params OpcEncoding[] dataTypeEncodings)
```

</div>

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

```vbnet
Public Shared Sub RegisterType(Of T)(
    dataTypeId As OpcNodeId,
    ParamArray dataTypeEncodings As OpcEncoding())
```

</div>

**Type parameters**

| Name | Description |
|---|---|
| `T` | The type to use in case there a data object for the data definition equals to `dataTypeId` or equals to one of the `dataTypeEncodings` specified is to be created. The type needs to provide either a public accessible parameterless constructor or a public accessible constructor accepting an instance of the [IOpcDataStore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatastore/) interface and then needs to be a subclass of the [OpcData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/) class. |

**Parameters**

| Name | Type | Description |
|---|---|---|
| `dataTypeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The identifier of the type definition for which the `T` is to be used to create a data object instance. |
| `dataTypeEncodings` | params [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 identifying the different encodings supported by the `T` specified. Using [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) instances enables the possibility to define [OpcEncodingType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/) specific identifiers to use to identify the according encoding information required to encode or decode the data object information. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The type `T` does not define a public accessible parameterless constructor or a public accessible constructor accepting an instance of the [IOpcDataStore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatastore/) interface or any data type specific attribute offers invalid information about the data type to associate with the [Type](https://learn.microsoft.com/dotnet/api/system.type). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `dataTypeId` or `dataTypeEncodings` or one of its items is a null reference (Nothing in Visual Basic). |

#### RegisterType(Type, OpcNodeId, params OpcEncoding\[\])

<span class="api-meta">static · since v2.14</span>

Registers the `dataType` specified as the data object type to create in case there a data instance is to be created for the type definition identified by the `dataTypeId` or by one of the `dataTypeEncodings` specified.

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

```csharp
public static void RegisterType(
    Type dataType,
    OpcNodeId dataTypeId,
    params OpcEncoding[] dataTypeEncodings)
```

</div>

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

```vbnet
Public Shared Sub RegisterType(
    dataType As Type,
    dataTypeId As OpcNodeId,
    ParamArray dataTypeEncodings As OpcEncoding())
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `dataType` | [Type](https://learn.microsoft.com/dotnet/api/system.type) | The [Type](https://learn.microsoft.com/dotnet/api/system.type) to use in case there a data object for the data type definition equals to the data type identifier defined using the [OpcDataTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/) is to be created. The type needs to provide either a public accessible parameterless constructor or a public accessible constructor accepting an instance of the [IOpcDataStore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatastore/) interface and then needs to be a subclass of the [OpcData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/) class. |
| `dataTypeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The identifier of the type definition for which the `dataType` is to be used to create a data object instance. |
| `dataTypeEncodings` | params [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 identifying the different encodings supported by the `dataType` specified. Using [OpcEncoding](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencoding/) instances enables the possibility to define [OpcEncodingType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcencodingtype/) specific identifiers to use to identify the according encoding information required to encode or decode the data object information. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The type `dataType` does not define a public accessible parameterless constructor or a public accessible constructor accepting an instance of the [IOpcDataStore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatastore/) interface or any data type specific attribute offers invalid information about the data type to associate with the [Type](https://learn.microsoft.com/dotnet/api/system.type). |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `dataType`, `dataTypeId` or `dataTypeEncodings` or one of its items is a null reference (Nothing in Visual Basic). |

### RegisterTypeMapper

<span class="api-meta">static · 2 overloads · since v2.27</span>

| Overload | Description |
|---|---|
| [RegisterTypeMapper&lt;T&gt;()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#registertypemapper-t1)<span class="api-meta">static · since v2.27</span> | Registers the `T` implementing the [IOpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypemapper/) interface as a custom mapper for data types. |
| [RegisterTypeMapper(IOpcDataTypeMapper)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#registertypemapper-opc-uafx-iopcdatatypemapper)<span class="api-meta">static · since v2.27</span> | Registers the `mapper` as a custom mapper for data types. |

#### RegisterTypeMapper&lt;T&gt;()

<span class="api-meta">static · since v2.27</span>

Registers the `T` implementing the [IOpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypemapper/) interface as a custom mapper for data types.

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

```csharp
public static void RegisterTypeMapper<T>() where T : IOpcDataTypeMapper, new()
```

</div>

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

```vbnet
Public Shared Sub RegisterTypeMapper(Of T As {IOpcDataTypeMapper, New})()
```

</div>

**Type parameters**

| Name | Description |
|---|---|
| `T` | The type implementing the [IOpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypemapper/) interface and providing a default constructor. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `T` does not inherit from [OpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypemapper/) nor defines any [OpcDataTypeMapperAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypemapperattribute/) to indicate which types are mapped to each other. |

#### RegisterTypeMapper(IOpcDataTypeMapper)

<span class="api-meta">static · since v2.27</span>

Registers the `mapper` as a custom mapper for data types.

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

```csharp
public static void RegisterTypeMapper(IOpcDataTypeMapper mapper)
```

</div>

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

```vbnet
Public Shared Sub RegisterTypeMapper(mapper As IOpcDataTypeMapper)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `mapper` | [IOpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypemapper/) | The [IOpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypemapper/) to register. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `mapper` does not inherit from [OpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypemapper/) nor defines any [OpcDataTypeMapperAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypemapperattribute/) to indicate which types are mapped to each other. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `mapper` is a null reference (Nothing in Visual Basic). |

### RegisterTypes

<span class="api-meta">static · 3 overloads</span>

| Overload | Description |
|---|---|
| [RegisterTypes(Assembly)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#registertypes-system-reflection-assembly)<span class="api-meta">static</span> | Registers all non-abstract types in the `assembly` specified which defines the [OpcDataTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/). |
| [RegisterTypes(IEnumerable&lt;Type&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#registertypes-system-collections-generic-ienumerable-of-system-type)<span class="api-meta">static</span> | Registers the `dataTypes` specified as the data object type to create in case there a data instance is to be created for the type definitions identified by the [OpcEventTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opceventtypeattribute/) used on one of the `dataTypes` specified. |
| [RegisterTypes(Type, params Type\[\])](#registertypes-system-type-system-type-array)<span class="api-meta">static</span> | Registers the `dataType` and the further specified `dataTypes` as the data object type to create in case there a data instance is to be created for the type definition identified by the [OpcDataTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/) used on the `dataType` or on one of the `dataTypes` specified. |

**Exceptions (all overloads)**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | A [Type](https://learn.microsoft.com/dotnet/api/system.type) does not define a public accessible parameterless constructor or a public accessible constructor accepting an instance of the [IOpcDataStore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatastore/) interface or any data type specific attribute offers invalid information about the data type to associate with the [Type](https://learn.microsoft.com/dotnet/api/system.type). |

#### RegisterTypes(Assembly)

<span class="api-meta">static</span>

Registers all non-abstract types in the `assembly` specified which defines the [OpcDataTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/).

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

```csharp
public static void RegisterTypes(Assembly assembly)
```

</div>

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

```vbnet
Public Shared Sub RegisterTypes(assembly As Assembly)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `assembly` | [Assembly](https://learn.microsoft.com/dotnet/api/system.reflection.assembly) | The [Assembly](https://learn.microsoft.com/dotnet/api/system.reflection.assembly) its types are inspected for types which using the [OpcDataTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/). |

**Exceptions**

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

**Remarks**

The [Type](https://learn.microsoft.com/dotnet/api/system.type) instances to register need to define the [OpcDataTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/) and either a public accessible parameterless constructor or a public accessible constructor accepting an instance of the [IOpcDataStore](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatastore/) interface and then needs to be a subclass of the [OpcData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/) class.

#### RegisterTypes(IEnumerable&lt;Type&gt;)

<span class="api-meta">static</span>

Registers the `dataTypes` specified as the data object type to create in case there a data instance is to be created for the type definitions identified by the [OpcEventTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opceventtypeattribute/) used on one of the `dataTypes` specified.

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

```csharp
public static void RegisterTypes(IEnumerable<Type> dataTypes)
```

</div>

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

```vbnet
Public Shared Sub RegisterTypes(dataTypes As IEnumerable(Of Type))
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `dataTypes` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[Type](https://learn.microsoft.com/dotnet/api/system.type)&gt; | A sequence of [Type](https://learn.microsoft.com/dotnet/api/system.type) instances representing the types to use in case there a data object for the data definition equals to the data type identifier defined using the [OpcDataTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/) is to be created. |

**Exceptions**

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

**Remarks**

Any null reference (Nothing in Visual Basic) in `dataTypes` is ignored.

#### RegisterTypes(Type, params Type\[\])

<span class="api-meta">static</span>

Registers the `dataType` and the further specified `dataTypes` as the data object type to create in case there a data instance is to be created for the type definition identified by the [OpcDataTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/) used on the `dataType` or on one of the `dataTypes` specified.

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

```csharp
public static void RegisterTypes(Type dataType, params Type[] dataTypes)
```

</div>

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

```vbnet
Public Shared Sub RegisterTypes(
    dataType As Type,
    ParamArray dataTypes As Type())
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `dataType` | [Type](https://learn.microsoft.com/dotnet/api/system.type) | The [Type](https://learn.microsoft.com/dotnet/api/system.type) instance to use in case there a data object for the data definition equals to the data type identifier defined using the [OpcDataTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/) is to be created. |
| `dataTypes` | params [Type](https://learn.microsoft.com/dotnet/api/system.type)[] | An array of additional [Type](https://learn.microsoft.com/dotnet/api/system.type) instances to use in case there a data object for the data definitions equals to the data type identifier defined using the [OpcDataTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/) is to be created. |

**Exceptions**

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

### ShallowCopy

<span class="api-meta">protected · virtual</span>

Creates a shallow copy of the current [OpcData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/).

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

```csharp
protected virtual object ShallowCopy()
```

</div>

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

```vbnet
Protected Overridable Function ShallowCopy() As Object
```

</div>

**Returns**

[Object](https://learn.microsoft.com/dotnet/api/system.object)

A new object which is a shallow copy of the current [OpcData](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/).

### ToExtension

<span class="api-meta">static · since v2.40</span>

Wraps the `instance` into an <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.ExtensionObject">ExtensionObject</abbr>, so that it can be encoded as the instance of its data type.

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

```csharp
public static ExtensionObject ToExtension(object instance)
```

</div>

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

```vbnet
Public Shared Function ToExtension(instance As Object) As ExtensionObject
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `instance` | [Object](https://learn.microsoft.com/dotnet/api/system.object) | The instance of a data type to wrap. |

**Returns**

<abbr title="OPC Foundation stack type, not documented here: Opc.Ua.ExtensionObject">ExtensionObject</abbr>

A new <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.ExtensionObject">ExtensionObject</abbr> whose body holds the `instance` wrapped for the encoding (see [To](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.extensionobjectextensions/members#to)), or the `instance` itself if it already is an <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.ExtensionObject">ExtensionObject</abbr>.

### TryGetTypeMapper

<span class="api-meta">static · 3 overloads · since v2.27</span>

| Overload | Description |
|---|---|
| [TryGetTypeMapper&lt;TSource&gt;(out IOpcDataTypeMapper)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#trygettypemapper-t1-opc-uafx-iopcdatatypemapper-ref)<span class="api-meta">static · since v2.27</span> | Determines the [IOpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypemapper/) associated with the type specified by `TSource`. |
| [TryGetTypeMapper(Type, out IOpcDataTypeMapper)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#trygettypemapper-system-type-opc-uafx-iopcdatatypemapper-ref)<span class="api-meta">static · since v2.27</span> | Determines the [IOpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypemapper/) associated with the type specified by `sourceType`. |
| [TryGetTypeMapper(Type, out IOpcDataTypeMapper, out Type)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#trygettypemapper-system-type-opc-uafx-iopcdatatypemapper-ref-system-type-ref)<span class="api-meta">static · since v2.27</span> | Determines the [IOpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypemapper/) associated with the type specified by `sourceType` and the resulting `targetType`. |

#### TryGetTypeMapper&lt;TSource&gt;(out IOpcDataTypeMapper)

<span class="api-meta">static · since v2.27</span>

Determines the [IOpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypemapper/) associated with the type specified by `TSource`.

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

```csharp
public static bool TryGetTypeMapper<TSource>(out IOpcDataTypeMapper mapper)
```

</div>

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

```vbnet
Public Shared Function TryGetTypeMapper(Of TSource)(
    mapper As IOpcDataTypeMapper) As Boolean
```

</div>

**Type parameters**

| Name | Description |
|---|---|
| `TSource` | The [Type](https://learn.microsoft.com/dotnet/api/system.type) its mapper is to be determined. |

**Parameters**

| Name | Type | Description |
|---|---|---|
| `mapper` | out [IOpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypemapper/) | The [IOpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypemapper/) which is responsible for [object](https://learn.microsoft.com/dotnet/api/system.object)'s of the type specified by `TSource` or a null reference (Nothing in Visual Basic) if there does not exist a mapper for the type specified by `TSource`. |

**Returns**

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

The value true if a mapper exists for the type specified by the `TSource` type; otherwise the value false.

#### TryGetTypeMapper(Type, out IOpcDataTypeMapper)

<span class="api-meta">static · since v2.27</span>

Determines the [IOpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypemapper/) associated with the type specified by `sourceType`.

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

```csharp
public static bool TryGetTypeMapper(
    Type sourceType,
    out IOpcDataTypeMapper mapper)
```

</div>

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

```vbnet
Public Shared Function TryGetTypeMapper(
    sourceType As Type,
    mapper As IOpcDataTypeMapper) As Boolean
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `sourceType` | [Type](https://learn.microsoft.com/dotnet/api/system.type) | The [Type](https://learn.microsoft.com/dotnet/api/system.type) its mapper is to be determined. |
| `mapper` | out [IOpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypemapper/) | The [IOpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypemapper/) which is responsible for [object](https://learn.microsoft.com/dotnet/api/system.object)'s of the type specified by `sourceType` or a null reference (Nothing in Visual Basic) if there does not exist a mapper for the type specified by `sourceType`. |

**Returns**

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

The value true if a mapper exists for the type specified by `sourceType`; otherwise the value false.

**Exceptions**

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

#### TryGetTypeMapper(Type, out IOpcDataTypeMapper, out Type)

<span class="api-meta">static · since v2.27</span>

Determines the [IOpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypemapper/) associated with the type specified by `sourceType` and the resulting `targetType`.

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

```csharp
public static bool TryGetTypeMapper(
    Type sourceType,
    out IOpcDataTypeMapper mapper,
    out Type targetType)
```

</div>

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

```vbnet
Public Shared Function TryGetTypeMapper(
    sourceType As Type,
    mapper As IOpcDataTypeMapper,
    targetType As Type) As Boolean
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `sourceType` | [Type](https://learn.microsoft.com/dotnet/api/system.type) | The [Type](https://learn.microsoft.com/dotnet/api/system.type) its mapper is to be determined. |
| `mapper` | out [IOpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypemapper/) | The [IOpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypemapper/) which is responsible for [object](https://learn.microsoft.com/dotnet/api/system.object)'s of the type specified by `sourceType` or a null reference (Nothing in Visual Basic) if there does not exist a mapper for the type specified by `sourceType`. |
| `targetType` | out [Type](https://learn.microsoft.com/dotnet/api/system.type) | The [Type](https://learn.microsoft.com/dotnet/api/system.type) the `sourceType` is mapped to by the associated `mapper` or a null reference (Nothing in Visual Basic) if there does not exist a mapper for the type specified by `sourceType`. |

**Returns**

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

The value true if a mapper exists for the type specified by `sourceType`; otherwise the value false.

**Exceptions**

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

### UnregisterType

<span class="api-meta">static · 3 overloads</span>

| Overload | Description |
|---|---|
| [UnregisterType&lt;T&gt;()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#unregistertype-t1)<span class="api-meta">static</span> | Unregisters the previously registered (see [RegisterType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#registertype-t1)) type defined by `T` as the [object](https://learn.microsoft.com/dotnet/api/system.object) type to not longer create for the type definition identified by the [OpcDataTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/) defined on the `T` specified. |
| [UnregisterType&lt;T&gt;(OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#unregistertype-t1-opc-uafx-opcnodeid)<span class="api-meta">static</span> | Unregisters the previously registered (see [RegisterType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#registertype-t1-opc-uafx-opcnodeid)) type defined by `T` as the [object](https://learn.microsoft.com/dotnet/api/system.object) type to not longer create for the type definition identified by the `dataTypeId` specified. |
| [UnregisterType&lt;T&gt;(OpcNodeId, params OpcEncoding\[\])](#unregistertype-t1-opc-uafx-opcnodeid-opc-uafx-opcencoding-array)<span class="api-meta">static</span> | Unregisters the previously registered (see [RegisterType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#registertype-t1-opc-uafx-opcnodeid-opc-uafx-opcencoding-array)) type defined by `T` as the [object](https://learn.microsoft.com/dotnet/api/system.object) type to not longer create for the type definition identified by the `dataTypeId` or by one of the `dataTypeEncodings` specified. |

#### UnregisterType&lt;T&gt;()

<span class="api-meta">static</span>

Unregisters the previously registered (see [RegisterType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#registertype-t1)) type defined by `T` as the [object](https://learn.microsoft.com/dotnet/api/system.object) type to not longer create for the type definition identified by the [OpcDataTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/) defined on the `T` specified.

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

```csharp
public static void UnregisterType<T>()
```

</div>

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

```vbnet
Public Shared Sub UnregisterType(Of T)()
```

</div>

**Type parameters**

| Name | Description |
|---|---|
| `T` | The data type to unregister for the data definition equals to data type identifier defined using the [OpcDataTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/). |

#### UnregisterType&lt;T&gt;(OpcNodeId)

<span class="api-meta">static</span>

Unregisters the previously registered (see [RegisterType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#registertype-t1-opc-uafx-opcnodeid)) type defined by `T` as the [object](https://learn.microsoft.com/dotnet/api/system.object) type to not longer create for the type definition identified by the `dataTypeId` specified.

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

```csharp
public static void UnregisterType<T>(OpcNodeId dataTypeId)
```

</div>

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

```vbnet
Public Shared Sub UnregisterType(Of T)(dataTypeId As OpcNodeId)
```

</div>

**Type parameters**

| Name | Description |
|---|---|
| `T` | The data type to unregister for the data definition equals to `dataTypeId`. |

**Parameters**

| Name | Type | Description |
|---|---|---|
| `dataTypeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The identifier of the type definition for which the `T` is to be unregistered. |

**Exceptions**

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

#### UnregisterType&lt;T&gt;(OpcNodeId, params OpcEncoding\[\])

<span class="api-meta">static</span>

Unregisters the previously registered (see [RegisterType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#registertype-t1-opc-uafx-opcnodeid-opc-uafx-opcencoding-array)) type defined by `T` as the [object](https://learn.microsoft.com/dotnet/api/system.object) type to not longer create for the type definition identified by the `dataTypeId` or by one of the `dataTypeEncodings` specified.

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

```csharp
public static void UnregisterType<T>(
    OpcNodeId dataTypeId,
    params OpcEncoding[] dataTypeEncodings)
```

</div>

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

```vbnet
Public Shared Sub UnregisterType(Of T)(
    dataTypeId As OpcNodeId,
    ParamArray dataTypeEncodings As OpcEncoding())
```

</div>

**Type parameters**

| Name | Description |
|---|---|
| `T` | The data type to unregister for the data definition equals to `dataTypeId` or one of the `dataTypeEncodings`. |

**Parameters**

| Name | Type | Description |
|---|---|---|
| `dataTypeId` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The identifier of the type definition for which the `T` is to be unregistered. |
| `dataTypeEncodings` | params [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 identifying the different encodings supported by the `T` specified for which the `T` is to be unregistered as well. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `dataTypeId` or `dataTypeEncodings` or one of its items is a null reference (Nothing in Visual Basic). |

### UnregisterTypeMapper

<span class="api-meta">static · 2 overloads · since v2.27</span>

| Overload | Description |
|---|---|
| [UnregisterTypeMapper&lt;T&gt;()](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#unregistertypemapper-t1)<span class="api-meta">static · since v2.27</span> | Unregisters the `T` implementing the [IOpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypemapper/) interface as a custom mapper for data types. |
| [UnregisterTypeMapper(IOpcDataTypeMapper)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#unregistertypemapper-opc-uafx-iopcdatatypemapper)<span class="api-meta">static · since v2.27</span> | Unregisters the `mapper` as a custom mapper for data types. |

#### UnregisterTypeMapper&lt;T&gt;()

<span class="api-meta">static · since v2.27</span>

Unregisters the `T` implementing the [IOpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypemapper/) interface as a custom mapper for data types.

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

```csharp
public static void UnregisterTypeMapper<T>() where T : IOpcDataTypeMapper, new()
```

</div>

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

```vbnet
Public Shared Sub UnregisterTypeMapper(Of T As {IOpcDataTypeMapper, New})()
```

</div>

**Type parameters**

| Name | Description |
|---|---|
| `T` | The type implementing the [IOpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypemapper/) interface. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `T` does not inherit from [OpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypemapper/) nor defines any [OpcDataTypeMapperAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypemapperattribute/) to indicate which types are mapped to each other. |

#### UnregisterTypeMapper(IOpcDataTypeMapper)

<span class="api-meta">static · since v2.27</span>

Unregisters the `mapper` as a custom mapper for data types.

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

```csharp
public static void UnregisterTypeMapper(IOpcDataTypeMapper mapper)
```

</div>

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

```vbnet
Public Shared Sub UnregisterTypeMapper(mapper As IOpcDataTypeMapper)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `mapper` | [IOpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypemapper/) | The [IOpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcdatatypemapper/) to unregister. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `mapper` does not inherit from [OpcDataTypeMapper](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypemapper/) nor defines any [OpcDataTypeMapperAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypemapperattribute/) to indicate which types are mapped to each other. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `mapper` is a null reference (Nothing in Visual Basic). |

### UnregisterTypes

<span class="api-meta">static · 3 overloads</span>

| Overload | Description |
|---|---|
| [UnregisterTypes(Assembly)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#unregistertypes-system-reflection-assembly)<span class="api-meta">static</span> | Unregisters all previously registered types (see [RegisterTypes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#registertypes-system-reflection-assembly)) in the `assembly` specified. |
| [UnregisterTypes(IEnumerable&lt;Type&gt;)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#unregistertypes-system-collections-generic-ienumerable-of-system-type)<span class="api-meta">static</span> | Unregisters the previously registered (see [RegisterTypes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#registertypes-system-collections-generic-ienumerable-of-system-type)) `dataTypes` specified. |
| [UnregisterTypes(Type, params Type\[\])](#unregistertypes-system-type-system-type-array)<span class="api-meta">static</span> | Unregisters the previously registered `dataType` and the further specified `dataTypes` (see [RegisterTypes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#registertypes-system-type-system-type-array)). |

#### UnregisterTypes(Assembly)

<span class="api-meta">static</span>

Unregisters all previously registered types (see [RegisterTypes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#registertypes-system-reflection-assembly)) in the `assembly` specified.

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

```csharp
public static void UnregisterTypes(Assembly assembly)
```

</div>

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

```vbnet
Public Shared Sub UnregisterTypes(assembly As Assembly)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `assembly` | [Assembly](https://learn.microsoft.com/dotnet/api/system.reflection.assembly) | The [Assembly](https://learn.microsoft.com/dotnet/api/system.reflection.assembly) its types are inspected for types using the [OpcDataTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/). |

**Exceptions**

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

#### UnregisterTypes(IEnumerable&lt;Type&gt;)

<span class="api-meta">static</span>

Unregisters the previously registered (see [RegisterTypes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#registertypes-system-collections-generic-ienumerable-of-system-type)) `dataTypes` specified.

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

```csharp
public static void UnregisterTypes(IEnumerable<Type> dataTypes)
```

</div>

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

```vbnet
Public Shared Sub UnregisterTypes(dataTypes As IEnumerable(Of Type))
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `dataTypes` | [IEnumerable](https://learn.microsoft.com/dotnet/api/system.collections.generic.ienumerable-1)&lt;[Type](https://learn.microsoft.com/dotnet/api/system.type)&gt; | A sequence of [Type](https://learn.microsoft.com/dotnet/api/system.type) instances to unregister for the data definitions equals to the data type identifiers defined using the [OpcDataTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/). |

**Exceptions**

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

#### UnregisterTypes(Type, params Type\[\])

<span class="api-meta">static</span>

Unregisters the previously registered `dataType` and the further specified `dataTypes` (see [RegisterTypes](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdata/members#registertypes-system-type-system-type-array)).

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

```csharp
public static void UnregisterTypes(Type dataType, params Type[] dataTypes)
```

</div>

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

```vbnet
Public Shared Sub UnregisterTypes(
    dataType As Type,
    ParamArray dataTypes As Type())
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `dataType` | [Type](https://learn.microsoft.com/dotnet/api/system.type) | The [Type](https://learn.microsoft.com/dotnet/api/system.type) instance to unregister for the data definitions equals to the data type identifiers defined using the [OpcDataTypeAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypeattribute/). |
| `dataTypes` | params [Type](https://learn.microsoft.com/dotnet/api/system.type)[] |  |

**Exceptions**

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

## Events

### TypeResolve

<span class="api-meta">static</span>

Occurs when the resolution of a data type fails. Use this event to manually provide the [Type](https://learn.microsoft.com/dotnet/api/system.type) to use for a specific data type definition identifier.

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

```csharp
public static event OpcTypeResolveEventHandler TypeResolve
```

</div>

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

```vbnet
Public Shared Event TypeResolve As OpcTypeResolveEventHandler
```

</div>

**Event type**

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