# OpcStateNode Members

> Reference: Defines an unique state across all states defined in a state machine (e.g. OpcStateMachineNode).

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcStateNode</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 [OpcObjectNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcobjectnode/members), [OpcInstanceNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcinstancenode/members), [OpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnode/members).

## Constructors

### OpcStateNode

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

| Overload | Description |
|---|---|
| [OpcStateNode(IOpcNode, OpcName)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatenode/members#opcstatenode-opc-uafx-iopcnode-opc-uafx-opcname) | Initializes a new instance of the [OpcStateNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatenode/) class using the `parent` and `name` specified. |
| [OpcStateNode(IOpcNode, OpcName, OpcNodeId)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatenode/members#opcstatenode-opc-uafx-iopcnode-opc-uafx-opcname-opc-uafx-opcnodeid) | Initializes a new instance of the [OpcStateNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatenode/) class accessible by the `name` and `id` specified as a child node of the `parent` node given. |
| [OpcStateNode(IOpcNode, OpcName, uint)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatenode/members#opcstatenode-opc-uafx-iopcnode-opc-uafx-opcname-system-uint32) | Initializes a new instance of the [OpcStateNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatenode/) class using the `parent` and `name` specified. |
| [OpcStateNode(IOpcNode, OpcName, OpcNodeId, uint)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatenode/members#opcstatenode-opc-uafx-iopcnode-opc-uafx-opcname-opc-uafx-opcnodeid-system-uint32) | Initializes a new instance of the [OpcStateNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatenode/) class accessible by the `name` and `id` specified as a child node of the `parent` node given. |
| [OpcStateNode(BaseObjectState)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatenode/members#opcstatenode-opc-ua-baseobjectstate)<span class="api-meta">protected · since v2.50</span> | Initializes a new instance of the [OpcStateNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatenode/) class using the `content` as the instance to wrap. |
| [OpcStateNode(BaseObjectState, OpcNodeModel)](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatenode/members#opcstatenode-opc-ua-baseobjectstate-opc-uafx-opcnodemodel)<span class="api-meta">protected · since v2.50</span> | Initializes a new instance of the [OpcStateNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatenode/) class using the `content` as the instance to wrap. |

#### OpcStateNode(IOpcNode, OpcName)

Initializes a new instance of the [OpcStateNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatenode/) class using the `parent` and `name` specified.

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

```csharp
public OpcStateNode(IOpcNode parent, OpcName name)
```

</div>

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

```vbnet
Public Sub New(parent As IOpcNode, name As OpcName)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `parent` | [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) | The [OpcStateNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatenode/) name of the parent Node. |
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) through that the new state node can be accessed. |

#### OpcStateNode(IOpcNode, OpcName, OpcNodeId)

Initializes a new instance of the [OpcStateNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatenode/) class accessible by the `name` and `id` specified as a child node of the `parent` node given.

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

```csharp
public OpcStateNode(IOpcNode parent, OpcName name, OpcNodeId id)
```

</div>

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

```vbnet
Public Sub New(parent As IOpcNode, name As OpcName, id As OpcNodeId)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `parent` | [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) | The [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) used as the parent node or a null reference (Nothing in Visual Basic) in the case there is no parent node available. |
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) through that the new state node can be accessed. |
| `id` | [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/) through that the new state node can be identified and accessed. |

#### OpcStateNode(IOpcNode, OpcName, uint)

Initializes a new instance of the [OpcStateNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatenode/) class using the `parent` and `name` specified.

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

```csharp
public OpcStateNode(IOpcNode parent, OpcName name, uint number)
```

</div>

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

```vbnet
Public Sub New(parent As IOpcNode, name As OpcName, number As UInteger)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `parent` | [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) | The [OpcStateNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatenode/) name of the parent Node. |
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) through that the new state node can be accessed. |
| `number` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | A number used to uniquely identify the state to represent. |

#### OpcStateNode(IOpcNode, OpcName, OpcNodeId, uint)

Initializes a new instance of the [OpcStateNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatenode/) class accessible by the `name` and `id` specified as a child node of the `parent` node given.

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

```csharp
public OpcStateNode(IOpcNode parent, OpcName name, OpcNodeId id, uint number)
```

</div>

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

```vbnet
Public Sub New(
    parent As IOpcNode,
    name As OpcName,
    id As OpcNodeId,
    number As UInteger)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `parent` | [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) | The [IOpcNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.iopcnode/) used as the parent node or a null reference (Nothing in Visual Basic) in the case there is no parent node available. |
| `name` | [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) | The [OpcName](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcname/) through that the new state node can be accessed. |
| `id` | [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/) through that the new state node can be identified and accessed. |
| `number` | [UInt32](https://learn.microsoft.com/dotnet/api/system.uint32) | A number used to uniquely identify the state to represent. |

#### OpcStateNode(BaseObjectState)

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

Initializes a new instance of the [OpcStateNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatenode/) class using the `content` as the instance to wrap.

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

```csharp
protected OpcStateNode(BaseObjectState content)
```

</div>

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

```vbnet
Protected Sub New(content As BaseObjectState)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `content` | <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.BaseObjectState">BaseObjectState</abbr> | The <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.BaseObjectState">BaseObjectState</abbr> to wrap. |

**Exceptions**

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

#### OpcStateNode(BaseObjectState, OpcNodeModel)

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

Initializes a new instance of the [OpcStateNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatenode/) class using the `content` as the instance to wrap.

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

```csharp
protected OpcStateNode(BaseObjectState content, OpcNodeModel model)
```

</div>

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

```vbnet
Protected Sub New(content As BaseObjectState, model As OpcNodeModel)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `content` | <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.BaseObjectState">BaseObjectState</abbr> | The <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.BaseObjectState">BaseObjectState</abbr> to wrap. |
| `model` | [OpcNodeModel](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodemodel/) | The [OpcNodeModel](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodemodel/) which defines the modelling directives for the new node or a null reference (Nothing in Visual Basic) if there are no directives are to be applied to the node. |

**Exceptions**

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

## Properties

### DefaultTypeDefinitionId

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

Gets the default identifier which identifies the type that defines the underlying node reference within this [OpcInstanceNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcinstancenode/) is referenced by its parent node.

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

```csharp
protected override OpcNodeId DefaultTypeDefinitionId { get; }
```

</div>

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

```vbnet
Protected Overrides ReadOnly Property DefaultTypeDefinitionId As OpcNodeId
```

</div>

**Property value**

[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/) of the reference wihin this [OpcInstanceNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcinstancenode/) is referenced. These reference defines the typical behaviour of an instance node and its role in the address space regarding its parent. If there exists no specific reference type a null reference (Nothing in Visual Basic).

**Overrides**

[DefaultTypeDefinitionId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcobjectnode/members#defaulttypedefinitionid)

### StateNumber

Gets or sets an unique number for the state represented by this [OpcStateNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatenode/).

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

```csharp
public uint StateNumber { get; set; }
```

</div>

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

```vbnet
Public Property StateNumber As UInteger
```

</div>

**Property value**

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

A [uint](https://learn.microsoft.com/dotnet/api/system.uint32) which uniquely defines the state represented in the state machine this [OpcStateNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatenode/) belongs to.

### StateNumberNode

Gets the [OpcPropertyNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcpropertynode/) of the [StateNumber](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatenode/members#statenumber) property.

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

```csharp
public OpcPropertyNode StateNumberNode { get; }
```

</div>

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

```vbnet
Public ReadOnly Property StateNumberNode As OpcPropertyNode
```

</div>

**Property value**

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

An instance of the [OpcPropertyNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcpropertynode/) class.
