# OpcStateMachineStatesAttribute Members

> Reference: Defines unique states that a custom OpcStateMachineNode can enter using an enumeration type.

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

Inherits members from [Attribute](https://learn.microsoft.com/dotnet/api/system.attribute).

## Constructors

### OpcStateMachineStatesAttribute

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

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

```csharp
public OpcStateMachineStatesAttribute(Type statesType)
```

</div>

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

```vbnet
Public Sub New(statesType As Type)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `statesType` | [Type](https://learn.microsoft.com/dotnet/api/system.type) | The enumeration [Type](https://learn.microsoft.com/dotnet/api/system.type) used to define the different states. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentException](https://learn.microsoft.com/dotnet/api/system.argumentexception) | The `statesType` is not an enumeration type. |
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `statesType` is a null reference (Nothing in Visual Basic). |

## Properties

### StatesType

Gets the [Type](https://learn.microsoft.com/dotnet/api/system.type) which defines the different states.

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

```csharp
public Type StatesType { get; }
```

</div>

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

```vbnet
Public ReadOnly Property StatesType As Type
```

</div>

**Property value**

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

An enumeration [Type](https://learn.microsoft.com/dotnet/api/system.type) used to define the different states.
