# OpcEncodingMaskKind Enum

<span class="api-meta">since v2.8</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>Also in</dt>
<dd>Opc.UaFx.Client</dd>
</dl>

Controls the definition and use of the 'EncodingMask' required in types with optional members.

## Syntax

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

```csharp
public enum OpcEncodingMaskKind
```

</div>

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

```vbnet
Public Enum OpcEncodingMaskKind
```

</div>

## Inheritance

[Object](https://learn.microsoft.com/dotnet/api/system.object) → [ValueType](https://learn.microsoft.com/dotnet/api/system.valuetype) → [Enum](https://learn.microsoft.com/dotnet/api/system.enum) → **OpcEncodingMaskKind**

## Fields

| Name | Value | Description |
|---|---|---|
| <a id="auto"></a>`Auto` | `2` | The 'EncodingMask' is automatically constructed and evaluated using the number of optional members defined. Optional members are defined either using [Nullable&lt;T&gt;](https://learn.microsoft.com/dotnet/api/system.nullable-1) as the type of a member or through applying the [OpcDataTypeMemberSwitchAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypememberswitchattribute/) attribute using the default constructor of the attribute or the [OpcDataTypeMemberSwitchAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypememberswitchattribute/members#opcdatatypememberswitchattribute-system-int32) constructor to define the bit which is responsible for the existence of the member. In case there the default constructor [OpcDataTypeMemberSwitchAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypememberswitchattribute/members#opcdatatypememberswitchattribute-noparams) is used the bit an optional member refers to is determined by using the next free bit in the 'EncodingMask' which is not referenced by any other optional member. |
| <a id="explicit"></a>`Explicit` | `1` | The 'EncodingMask' needs to be splitted into multiple members using the value type [Bit](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.bit/). All members representing bits in the encoding mask need to be defined BEFORE any other member. Any subsequent optional members can refer to a single 'EncodingMask' member using the [OpcDataTypeMemberSwitchAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypememberswitchattribute/) attribute using the [OpcDataTypeMemberSwitchAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypememberswitchattribute/members#opcdatatypememberswitchattribute-system-int32) constructor to refer to the bit represented by the 'EncodingMask' member or directly referencing the 'EncodingMask' member by its name using the [OpcDataTypeMemberSwitchAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypememberswitchattribute/members#opcdatatypememberswitchattribute-system-string) constructor. |
| <a id="sequential"></a>`Sequential` | `0` | The 'EncodingMask' is manually defined as a single member. Any subsequent optional member can refer to a single bit in the 'EncodingMask' member using the [OpcDataTypeMemberSwitchAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypememberswitchattribute/) attribute using the [OpcDataTypeMemberSwitchAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypememberswitchattribute/members#opcdatatypememberswitchattribute-system-int32) constructor to refer to a bit in the 'EncodingMask' member or directly referencing the 'EncodingMask' member by its name usig the [OpcDataTypeMemberSwitchAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcdatatypememberswitchattribute/members#opcdatatypememberswitchattribute-system-string) constructor. |

## Applies to

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