Skip to content

Reference

IOpcStateMachine Members

Defines an interface which provides the state of a state machine whose states are identified by values of the type T and methods to change it (see OpcFiniteStateMachineNode<T>).

Reference

IOpcStateMachine<T> Members ​

Type
IOpcStateMachine<T>
Namespace
Opc.UaFx
Assembly
Opc.UaFx.Advanced.dll
Package
Opc.UaFx.Advanced v2.59.0

Inherits members from IOpcStateMachine.

Methods ​

CanChangeStateTo ​

2 overloads

OverloadDescription
CanChangeStateTo(OpcContext, T)Determines whether the current state can be changed to the newState specified.
CanChangeStateTo(OpcContext, T, T)Determines whether the oldState can be changed to the newState specified.

CanChangeStateTo(OpcContext, T) ​

Determines whether the current state can be changed to the newState specified.

csharp
bool CanChangeStateTo(OpcContext context, T newState)
vbnet
Function CanChangeStateTo(context As OpcContext, newState As T) As Boolean

Parameters

NameTypeDescription
contextOpcContextThe OpcContext to use to determine.
newStateTThe state to change to.

Returns

Boolean

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

ExceptionCondition
ArgumentNullExceptionThe context or newState is a null reference (Nothing in Visual Basic).

CanChangeStateTo(OpcContext, T, T) ​

Determines whether the oldState can be changed to the newState specified.

csharp
bool CanChangeStateTo(OpcContext context, T oldState, T newState)
vbnet
Function CanChangeStateTo(
    context As OpcContext,
    oldState As T,
    newState As T) As Boolean

Parameters

NameTypeDescription
contextOpcContextThe OpcContext to use to determine.
oldStateTThe state to change from.
newStateTThe state to change to.

Returns

Boolean

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

ExceptionCondition
ArgumentNullExceptionThe context, oldState or newState is a null reference (Nothing in Visual Basic).

ChangeStateTo ​

Changes the current state of the state machine to the newState specified.

csharp
void ChangeStateTo(OpcContext context, T newState)
vbnet
Sub ChangeStateTo(context As OpcContext, newState As T)

Parameters

NameTypeDescription
contextOpcContextThe OpcContext to use to change.
newStateTThe state to change to.

Exceptions

ExceptionCondition
ArgumentExceptionThe newState is not a known state.
ArgumentNullExceptionThe context or newState is a null reference (Nothing in Visual Basic).
InvalidOperationExceptionNo transition leads from the current state to the newState.
OpcExceptionThe change operation failed (see exception details for more information).

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 ​

Gets the state machine of the sub-states of the state specified whose states are identified by values of the type TSubStates.

csharp
IOpcStateMachine<TSubStates> GetSubStatesMachine<TSubStates>(T state)
vbnet
Function GetSubStatesMachine(Of TSubStates)(
    state As T) As IOpcStateMachine(Of TSubStates)

Type parameters

NameDescription
TSubStatesThe type which identifies the sub-states.

Parameters

NameTypeDescription
stateTThe state whose sub-states machine is to be retrieved.

Returns

IOpcStateMachine<TSubStates>

The state machine of the sub-states of the state, or a null reference (Nothing in Visual Basic) if the state has none or its states are not identified by TSubStates.