NodeOPCUA API Documentation
    Preparing search index...

    Interface UAStateMachineHelper

    StateMachineType

    The StateMachineType is the base ObjectType for all StateMachineTypes. It defines a single Variable which represents the current state of the machine. An instance of this ObjectType shall generate an Event whenever a significant state change occurs. The Server decides which state changes are significant. Servers shall use the GeneratesEvent ReferenceType to indicate which Event(s) could be produced by the StateMachine.

    Subtypes may add Methods which affect the state of the machine. The Executable Attribute is used to indicate whether the Method is valid given the current state of the machine. The generation of AuditEvents for Methods is defined in Part 4. A StateMachine may not be active.

    In this case, the CurrentState and LastTransition Variables shall have a status equal to BadStateNotActive (see Table B.17).

    Subtypes may add components which are instances of StateMachineTypes. These components are considered to be sub-states of the StateMachine. SubStateMachines are only active when the parent machine is in an appropriate state. Events produced by SubStateMachines may be suppressed by the parent machine. In some cases, the parent machine will produce a single Event that reflects changes in multiple SubStateMachines

    interface UAStateMachineHelper {
        currentStateNode: UAState | null;
        initialState: UAInitialState | null;
        states: UAState[];
        transitions: UATransitionEx[];
        findTransitionNode(
            fromStateNode: UAState,
            toStateNode: UAState,
            predicate?: TransitionSelector,
        ): UATransitionEx | null;
        getCurrentState(): string | null;
        getStateByName(name: string): UAState | null;
        getStates(): UAState[];
        getTransitions(): UATransitionEx[];
        isValidTransition(
            toStateNode: string | UAState,
            predicate?: TransitionSelector,
        ): boolean;
        setState(
            toStateNode: string | UAState | null,
            predicate?: TransitionSelector,
        ): void;
    }

    Hierarchy (View Summary)

    Index

    Properties

    currentStateNode: UAState | null
    initialState: UAInitialState | null
    states: UAState[]
    transitions: UATransitionEx[]

    Methods

    • return the current state as string

      Returns string | null

    • return the state Node by Name

      Parameters

      • name: string

      Returns UAState | null

    • return all state nodes associated with this state machine

      Returns UAState[]

    • return all state to state transition node associated with this state machine

      Returns UATransitionEx[]

    • returns true if there is a valid transition from currentStateNode to toStateNode

      Parameters

      Returns boolean

    • change the current state

      note:

      • a transition from currentState to toState node must exists
      • a TransitionEventType event will be raised

      Parameters

      Returns void