# OpcStateMachineNode Members

> Reference: Defines the base class for all state machine nodes.

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

### OpcStateMachineNode

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

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

#### OpcStateMachineNode(OpcName)

Initializes a new instance of the [OpcStateMachineNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatemachinenode/) class accessible by the `name` specified.

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

```csharp
public OpcStateMachineNode(OpcName name)
```

</div>

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

```vbnet
Public Sub New(name As OpcName)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `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 machine node can be accessed. |

#### OpcStateMachineNode(OpcName, OpcNodeId)

Initializes a new instance of the [OpcStateMachineNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatemachinenode/) class accessible by the `name` and `id` specified.

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

```csharp
public OpcStateMachineNode(OpcName name, OpcNodeId id)
```

</div>

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

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

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `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 machine 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 machine node can be identified and accessed. |

#### OpcStateMachineNode(IOpcNode, OpcName)

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

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

```csharp
public OpcStateMachineNode(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 [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 machine node can be accessed. |

#### OpcStateMachineNode(IOpcNode, OpcName, OpcNodeId)

Initializes a new instance of the [OpcStateMachineNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatemachinenode/) 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 OpcStateMachineNode(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 machine 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 machine node can be identified and accessed. |

#### OpcStateMachineNode(StateMachineState)

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

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

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

```csharp
protected OpcStateMachineNode(StateMachineState content)
```

</div>

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

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

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `content` | <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.StateMachineState">StateMachineState</abbr> | The <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.StateMachineState">StateMachineState</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). |

#### OpcStateMachineNode(StateMachineState, OpcNodeModel)

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

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

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

```csharp
protected OpcStateMachineNode(StateMachineState content, OpcNodeModel model)
```

</div>

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

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

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `content` | <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.StateMachineState">StateMachineState</abbr> | The <abbr title="OPC Foundation stack type, not documented here: Opc.Ua.StateMachineState">StateMachineState</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

### CurrentState

<span class="api-meta">virtual</span>

Gets or sets the current state of the [OpcStateMachineNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatemachinenode/) and provides a human readable name for the current state which may not be suitable for use in application control logic. Applications should use the [VariableId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatevariablenode/members#variableid) property of the [CurrentStateNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatemachinenode/members#currentstatenode) if they need a unique identifier for the state.

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

```csharp
public virtual OpcText CurrentState { get; set; }
```

</div>

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

```vbnet
Public Overridable Property CurrentState As OpcText
```

</div>

**Property value**

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

A human readable name for the current state which may not be suitable for use in application control logic.

### CurrentStateNode

Gets the [OpcStateVariableNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatevariablenode/) of the [CurrentState](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatemachinenode/members#currentstate) property.

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

```csharp
public OpcStateVariableNode CurrentStateNode { get; }
```

</div>

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

```vbnet
Public Property CurrentStateNode As OpcStateVariableNode
```

</div>

**Property value**

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

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

### DefaultTypeDefinitionId

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

Gets the default identifier which identifies the node that defines the underlying node type from that this [OpcInstanceNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcinstancenode/) has been created.

<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 type node from that this [OpcInstanceNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcinstancenode/) has been created from. These type node defines the typical structure of an instance node of its type definition. If there exists no specific type definition node 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)

### LastTransition

<span class="api-meta">virtual</span>

Gets or sets the last transition which occurred in an instance and provides a human readable name for the last transition which may not be suitable for use in application control logic. Applications should use the [VariableId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctransitionvariablenode/members#variableid) property of the [LastTransitionNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatemachinenode/members#lasttransitionnode) if they need a unique identifier for the transition.

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

```csharp
public virtual OpcText LastTransition { get; set; }
```

</div>

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

```vbnet
Public Overridable Property LastTransition As OpcText
```

</div>

**Property value**

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

A human readable name for the last transition which may not be suitable for use in application control logic.

### LastTransitionNode

Gets the [OpcTransitionVariableNode](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opctransitionvariablenode/) of the [LastTransition](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcstatemachinenode/members#lasttransition) property.

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

```csharp
public OpcTransitionVariableNode LastTransitionNode { get; }
```

</div>

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

```vbnet
Public Property LastTransitionNode As OpcTransitionVariableNode
```

</div>

**Property value**

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

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