Skip to content

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.

csharp
OpcText CurrentState { get; set; }
vbnet
Property CurrentState As OpcText

Property value

OpcText

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.

csharp
OpcText LastTransition { get; set; }
vbnet
Property LastTransition As OpcText

Property value

OpcText

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.

csharp
OpcName Name { get; }
vbnet
ReadOnly Property Name As OpcName

Property value

OpcName

The OpcName of the state machine node.

SupportsCurrentState ​

Gets a value indicating whether the state machine supports changes of its current state.

csharp
bool SupportsCurrentState { get; }
vbnet
ReadOnly Property SupportsCurrentState As Boolean

Property value

Boolean

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 ​

2 overloads

OverloadDescription
CanChangeStateTo(OpcContext, object)Determines whether the current state can be changed to the newState specified.
CanChangeStateTo(OpcContext, object, object)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.

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

Parameters

NameTypeDescription
contextOpcContextThe OpcContext to use to determine.
newStateObjectThe state number or the enumeration member of the 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, object, object) ​

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

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

Parameters

NameTypeDescription
contextOpcContextThe OpcContext to use to determine.
oldStateObjectThe state number or the enumeration member of the state to change from.
newStateObjectThe state number or the enumeration member of the 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, object newState)
vbnet
Sub ChangeStateTo(context As OpcContext, newState As Object)

Parameters

NameTypeDescription
contextOpcContextThe OpcContext to use to change.
newStateObjectThe state number or the enumeration member of the 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 ​

2 overloads

OverloadDescription
GetSubStatesMachine()Gets the state machine of the sub-states of the current state.
GetSubStatesMachine(object)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.

csharp
IOpcStateMachine GetSubStatesMachine()
vbnet
Function GetSubStatesMachine() As IOpcStateMachine

Returns

IOpcStateMachine

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.

csharp
IOpcStateMachine GetSubStatesMachine(object state)
vbnet
Function GetSubStatesMachine(state As Object) As IOpcStateMachine

Parameters

NameTypeDescription
stateObjectThe state number or the enumeration member of the state, or a null reference (Nothing in Visual Basic) for the current state.

Returns

IOpcStateMachine

The state machine of the sub-states of the state, or a null reference (Nothing in Visual Basic) if the state has none.