# OpcStruct Class

> Reference: Defines a structured data type at runtime, e.g. to provide it by a server using Create.

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

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

Defines a structured data type at runtime, e.g. to provide it by a server using [Create](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypenode/members#create-opc-uafx-iopcdatatypebuilder).

## Syntax

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

```csharp
public class OpcStruct
```

</div>

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

```vbnet
Public Class OpcStruct
```

</div>

## Inheritance

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

## Implements

<ul class="api-implements">
<li><a href="../opc.uafx.iopcdatatypebuilder/">IOpcDataTypeBuilder</a></li>
</ul>

## Remarks

The structure keeps the fields specified; it does not copy them, so that a field changed afterwards (e.g. using [AsArray](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstructfield/members#asarray-noparams)) changes the structure.

## Properties

| Name | Description |
|---|---|
| [BaseId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstruct/members#baseid) | Gets the identifier of the base data type of the structure. |
| [EncodingMask](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstruct/members#encodingmask) | Gets the encoding mask of the structure. |
| [Encodings](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstruct/members#encodings) | Gets the encodings of the structure. |
| [Id](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstruct/members#id) | Gets the identifier of the structure. |
| [Name](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstruct/members#name) | Gets the name of the structure. |

## Methods

| Name | Description |
|---|---|
| [CreateTypeInfo](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstruct/members#createtypeinfo) | Creates the type information of the structure using the `context` and the `typeId` specified. |
| [DefineSubType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstruct/members#definesubtype)<span class="api-meta">static · 4 overloads</span> | Defines a structure derived from the base data type specified. |
| [DefineType](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstruct/members#definetype)<span class="api-meta">static · 4 overloads</span> | Defines a structure derived from the Structure data type. |
| [GetFields](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstruct/members#getfields) | Returns the fields of the structure. |
| [GetNames](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstruct/members#getnames) | Returns the names of the fields of the structure. |
| [WithEncodingMask](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstruct/members#withencodingmask) | Sets the encoding mask of the structure. |
| [WithEncodings](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstruct/members#withencodings) | Sets the encodings of the structure. |

## Applies to

| Package | Versions |
|---|---|
| Opc.UaFx.Advanced | v2.53–v2.59 |
