# OpcStateMachineStateAttribute Members

> Reference: Defines an unique state that a custom OpcStateMachineNode can enter.

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

### OpcStateMachineStateAttribute

Initializes a new instance of the [OpcStateMachineStateAttribute](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatemachinestateattribute/) class using the `number` and `name` of the state to define.

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

```csharp
public OpcStateMachineStateAttribute(uint number, string name)
```

</div>

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

```vbnet
Public Sub New(number As UInteger, name As String)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `number` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | The unique number of the state to define. |
| `name` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The unique name of the state to define. |

**Exceptions**

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

## Properties

### Name

Gets the unique name of the state to define.

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

```csharp
public string Name { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Name As String
```

</div>

**Property value**

[String](https://learn.microsoft.com/dotnet/api/system.string)

A [string](https://learn.microsoft.com/dotnet/api/system.string) used to define the unique name of the state.

### Number

Gets the unique number of the state to define.

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

```csharp
public uint Number { get; }
```

</div>

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

```vbnet
Public ReadOnly Property Number As UInteger
```

</div>

**Property value**

[UInt32](https://learn.microsoft.com/dotnet/api/system.uint32)

An [uint](https://learn.microsoft.com/dotnet/api/system.uint32) used to define the unique number of the state.
