Reference
IOpcStateMachine Members
Defines an interface which provides the state of a state machine and methods to change it (see OpcFiniteStateMachineNode).
Reference
IOpcStateMachine Members
- Type
- IOpcStateMachine
- Namespace
- Opc.UaFx
- Assembly
- Opc.UaFx.Advanced.dll
- Package
- Opc.UaFx.Advanced v2.59.0
Properties
CurrentState
Gets or sets a human readable name for the current state of the state machine.
OpcText CurrentState { get; set; }Property CurrentState As OpcTextProperty value
A human readable name for the current state which may not be suitable for use in application control logic.
LastTransition
Gets or sets a human readable name for the last transition which occurred in the state machine.
OpcText LastTransition { get; set; }Property LastTransition As OpcTextProperty value
A human readable name for the last transition which may not be suitable for use in application control logic.
Name
Gets the name of the state machine.
OpcName Name { get; }ReadOnly Property Name As OpcNameProperty value
The OpcName of the state machine node.
SupportsCurrentState
Gets a value indicating whether the state machine supports changes of its current state.
bool SupportsCurrentState { get; }ReadOnly Property SupportsCurrentState As BooleanProperty value
The value true if the state machine supports changes of its current state; otherwise the value false.
Remarks
If the value is false, CanChangeStateTo returns false and ChangeStateTo does not change the state.
Methods
CanChangeStateTo
| Overload | Description |
|---|---|
| CanChangeStateTo( | Determines whether the current state can be changed to the newState specified. |
| CanChangeStateTo( | Determines whether the oldState can be changed to the newState specified. |
CanChangeStateTo(OpcContext, object)
Determines whether the current state can be changed to the newState specified.
bool CanChangeStateTo(OpcContext context, object newState)Function CanChangeStateTo(context As OpcContext, newState As Object) As BooleanParameters
| Name | Type | Description |
|---|---|---|
context | OpcContext | The OpcContext to use to determine. |
newState | Object | The state number or the enumeration member of the state to change to. |
Returns
The value true if the newState is a known state other than the current state and a transition leads from the current state to it, or if neither a current state nor a last transition is set; otherwise the value false.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The context or newState is a null reference ( |
CanChangeStateTo(OpcContext, object, object)
Determines whether the oldState can be changed to the newState specified.
bool CanChangeStateTo(OpcContext context, object oldState, object newState)Function CanChangeStateTo(
context As OpcContext,
oldState As Object,
newState As Object) As BooleanParameters
| Name | Type | Description |
|---|---|---|
context | OpcContext | The OpcContext to use to determine. |
oldState | Object | The state number or the enumeration member of the state to change from. |
newState | Object | The state number or the enumeration member of the state to change to. |
Returns
The value true if both states are known and different and a transition leads from the oldState to the newState; otherwise the value false.
Exceptions
| Exception | Condition |
|---|---|
| Argument | The context, oldState or newState is a null reference ( |
ChangeStateTo
Changes the current state of the state machine to the newState specified.
void ChangeStateTo(OpcContext context, object newState)Sub ChangeStateTo(context As OpcContext, newState As Object)Parameters
| Name | Type | Description |
|---|---|---|
context | OpcContext | The OpcContext to use to change. |
newState | Object | The state number or the enumeration member of the state to change to. |
Exceptions
| Exception | Condition |
|---|---|
| Argument | The newState is not a known state. |
| Argument | The context or newState is a null reference ( |
| Invalid | No transition leads from the current state to the newState. |
| OpcException | The change operation failed ( |
Remarks
The method does not change the state if SupportsCurrentState is false or the newState is the current state. If neither a current state nor a last transition is set, the state can be changed to any known state.
GetSubStatesMachine
| Overload | Description |
|---|---|
| Get | Gets the state machine of the sub-states of the current state. |
| Get | Gets the state machine of the sub-states of the state specified. |
GetSubStatesMachine()
Gets the state machine of the sub-states of the current state.
IOpcStateMachine GetSubStatesMachine()Function GetSubStatesMachine() As IOpcStateMachineReturns
The state machine of the sub-states of the current state, or a null reference (Nothing in Visual Basic) if the current state has none.
GetSubStatesMachine(object)
Gets the state machine of the sub-states of the state specified.
IOpcStateMachine GetSubStatesMachine(object state)Function GetSubStatesMachine(state As Object) As IOpcStateMachineParameters
| Name | Type | Description |
|---|---|---|
state | Object | The state number or the enumeration member of the state, or a null reference ( |
Returns
The state machine of the sub-states of the state, or a null reference (Nothing in Visual Basic) if the state has none.

