NodeOPCUA API Documentation
    Preparing search index...

    Interface UAFiniteStateMachineType

    Finite State Machine

    The FiniteStateMachineType is the base ObjectType for StateMachines that explicitly define the possible States and Transitions. Once the States are defined subtypes shall not add new States (see B.4.18). The States of the machine are represented with instances of the StateType ObjectType.

    EachState shall have a BrowseName which is unique within the StateMachine and shall have a StateNumber which shall also be unique across all States defined in the StateMachine.

    Be aware that States in a SubStateMachine may have the same StateNumber or BrowseName as States in the parent machine. A concrete subtype of FiniteStateMachineType shall define at least one State.

    A StateMachine may define one State which is an instance of the InitialStateType. This State is the State that the machine goes into when it is activated.

    The Transitions that may occur are represented with instances of the TransitionType.

    Each Transition shall have a BrowseName which is unique within the StateMachine and may have a TransitionNumber which shall also be unique across all Transitions defined in the StateMachine.

    The initial State for a Transition is a StateType Object which is the target of a FromState Reference. The final State for a Transition is a StateType Object which is the target of a ToState Reference. The FromState and ToState References shall always be specified. A Transition may produce an Event. The Event is indicated by a HasEffect Reference to a subtype of BaseEventType. The StateMachineType shall have GeneratesEvent References to the targets of a HasEffect Reference for each of its Transitions. A FiniteStateMachineType may define Methods that cause a transition to occur. These Methods are targets of HasCause References for each of the Transitions that may be triggered by the Method. The Executable Attribute for a Method is used to indicate whether the current State of the machine allows the Method to be called.

    A FiniteStateMachineType may have sub-state-machines which are represented as instances of StateMachineType ObjectTypes. Each State shall have a HasSubStateMachine Reference to the StateMachineType Object which represents the child States. The SubStateMachine is not active if the parent State is not active. In this case the CurrentState and LastTransition Variables of the SubStateMachine shall have a status equal to BadStateNotActive (see Table B.17).

    interface UAFiniteStateMachineType {
        browseName: QualifiedName;
        currentState: UAStateVariable<LocalizedText>;
        hasMethods: boolean;
        isAbstract: boolean;
        lastTransition?: UATransitionVariable<LocalizedText>;
        nodeClass: ObjectType;
        nodeId: NodeId;
        onFirstBrowseAction?: (this: BaseNode) => Promise<void>;
        subtypeOf: NodeId | null;
        subtypeOfObj: UAObjectType | null;
        get accessRestrictions(): AccessRestrictionsFlag | undefined;
        get addressSpace(): IAddressSpace;
        get description(): LocalizedText;
        get displayName(): LocalizedText[];
        get modellingRule(): ModellingRuleType | undefined;
        get namespace(): INamespace;
        get namespaceIndex(): number;
        get namespaceUri(): string;
        get parentNodeId(): NodeId | undefined;
        get rolePermissions(): RolePermissionType[] | undefined;
        addReference(options: AddReferenceOpts): void;
        allReferences(): UAReference[];
        browseNode(
            browseDescription: BrowseDescriptionOptions2,
            session?: ISessionContext,
        ): ReferenceDescription[];
        browseNodeByTargetName(
            relativePathElement: RelativePathElement,
            isLast: boolean,
        ): NodeId[];
        emit<K extends keyof BaseNodeEvents>(
            event: K,
            ...args: Parameters<BaseNodeEvents[K]>,
        ): boolean;
        findReference(
            referenceType: string | NodeId | UAReferenceType,
            isForward?: boolean,
        ): UAReference | null;
        findReferences(
            referenceType: string | NodeId | UAReferenceType,
            isForward?: boolean,
        ): UAReference[];
        findReferencesAsObject(
            referenceType: string | NodeId | UAReferenceType,
            isForward?: boolean,
        ): BaseNode<BaseNodeEvents>[];
        findReferencesEx(
            referenceType: string | NodeId | UAReferenceType,
            browseDirection?: BrowseDirection,
        ): UAReference[];
        findReferencesExAsObject(
            referenceType: string | NodeId | UAReferenceType,
            browseDirection?: BrowseDirection,
        ): BaseNode<BaseNodeEvents>[];
        fullName(): string;
        getAccessRestrictions(inherited: boolean): AccessRestrictionsFlag;
        getAggregates(): BaseNode<BaseNodeEvents>[];
        getChildByName(
            browseName: QualifiedNameOptions,
        ): BaseNode<BaseNodeEvents> | null;
        getChildByName(
            browseName: string,
            namespaceIndex?: number,
        ): BaseNode<BaseNodeEvents> | null;
        getComponentByName(
            componentName: QualifiedNameOptions,
        ): UAObject<UAObjectEvents> | UAVariable<UAVariableEvents> | null;
        getComponentByName(
            componentName: string,
            namespaceIndex?: number,
        ): UAObject<UAObjectEvents> | UAVariable<UAVariableEvents> | null;
        getComponents(): BaseNode<BaseNodeEvents>[];
        getDisplayName(locale?: string): string;
        getEventSourceOfs(): BaseNode<BaseNodeEvents>[];
        getEventSources(): BaseNode<BaseNodeEvents>[];
        getMethodById(nodeId: NodeId): UAMethod<UAMethodEvents> | null;
        getMethodByName(
            methodName: QualifiedNameOptions,
        ): UAMethod<UAMethodEvents> | null;
        getMethodByName(
            methodName: string,
            namespaceIndex?: number,
        ): UAMethod<UAMethodEvents> | null;
        getMethodByName(
            methodName: QualifiedNameLike,
            namespaceIndex?: number,
        ): UAMethod<UAMethodEvents> | null;
        getMethods(): UAMethod<UAMethodEvents>[];
        getNodeVersion(): UAProperty<UAString, String> | null;
        getNotifiers(): BaseNode<BaseNodeEvents>[];
        getProperties(): BaseNode<BaseNodeEvents>[];
        getPropertyByName(
            propertyName: QualifiedNameOptions,
        ): UAVariable<UAVariableEvents> | null;
        getPropertyByName(
            propertyName: string,
            namespaceIndex?: number,
        ): UAVariable<UAVariableEvents> | null;
        getRolePermissions(inherited: boolean): RolePermissionType[] | null;
        getStateByName(name: string): UAState | null;
        getStates(): UAState[];
        getTransitions(): UATransitionEx[];
        install_extra_properties(): void;
        instantiate(options: InstantiateObjectOptions): UAStateMachineEx;
        isDisposed(): boolean;
        isSubtypeOf(referenceType: NodeIdLike | UAObjectType): boolean;
        isSupertypeOf(referenceType: NodeIdLike | UAObjectType): boolean;
        listenerCount<K extends keyof BaseNodeEvents>(event: K): number;
        off<K extends keyof BaseNodeEvents>(
            event: K,
            listener: BaseNodeEvents[K],
        ): this;
        on<K extends keyof BaseNodeEvents>(
            event: K,
            listener: BaseNodeEvents[K],
        ): this;
        once<K extends keyof BaseNodeEvents>(
            event: K,
            listener: BaseNodeEvents[K],
        ): this;
        readAttribute(
            context: ISessionContext | null,
            attributeId: AttributeIds,
            indexRange?: NumericRange,
            dataEncoding?: QualifiedNameLike | null,
        ): DataValue;
        removeAllListeners(): void;
        removeListener<K extends keyof BaseNodeEvents>(
            event: K,
            listener: BaseNodeEvents[K],
        ): void;
        removeReference(referenceOpts: AddReferenceOpts): void;
        setAccessRestrictions(accessRestrictions: AccessRestrictionsFlag): void;
        setDescription(value: LocalizedTextLike | null): void;
        setDisplayName(value: LocalizedTextLike | LocalizedTextLike[]): void;
        setMaxListeners(n: number): void;
        setRolePermissions(rolePermissions: RolePermissionTypeOptions[]): void;
        writeAttribute(
            context: ISessionContext | null,
            writeValue: WriteValueOptions,
            callback: (err: Error | null, statusCode?: StatusCode) => void,
        ): void;
    }

    Hierarchy (View Summary)

    Index

    Properties

    browseName: QualifiedName
    hasMethods: boolean
    isAbstract: boolean
    nodeClass: ObjectType
    nodeId: NodeId
    onFirstBrowseAction?: (this: BaseNode) => Promise<void>
    subtypeOf: NodeId | null
    subtypeOfObj: UAObjectType | null

    Accessors

    • get accessRestrictions(): AccessRestrictionsFlag | undefined

      Returns AccessRestrictionsFlag | undefined

    • get addressSpace(): IAddressSpace

      Returns IAddressSpace

    • get description(): LocalizedText

      Returns LocalizedText

    • get displayName(): LocalizedText[]

      Returns LocalizedText[]

    • get modellingRule(): ModellingRuleType | undefined

      Returns ModellingRuleType | undefined

    • get namespace(): INamespace

      Returns INamespace

    • get namespaceIndex(): number

      Returns number

    • get namespaceUri(): string

      Returns string

    • get parentNodeId(): NodeId | undefined

      Returns NodeId | undefined

    • get rolePermissions(): RolePermissionType[] | undefined

      Returns RolePermissionType[] | undefined

    Methods

    • find the the references that are strictly of type reference.

      The isForward boolean flag specifies the direction of the references to be looked for.

      Forward direction is implied if omitted.

      • will throw an exception if more than one reference exists with the referenceType.
      • will return null if no reference exists.

      Parameters

      Returns UAReference | null

    • find all the references that are strictly of type reference. The isForward boolean flag specifies the direction of the references to be looked for.

      Forward direction is implied if omitted.

      Parameters

      Returns UAReference[]

    • find all the nodes that are referenced by references strictly of type reference.

      The isForward boolean flag specifies the direction of the references to be looked for.

      Forward direction is implied if omitted.

      • will throw an exception if more than one reference exists with the referenceType.
      • will return null if no reference exists.

      Parameters

      Returns BaseNode<BaseNodeEvents>[]

    • return a complete name of this object by pre-pending name of its parent(s) to its own name

      Returns string

    • get effective accessRestrictions if (inherited is true) and node has no accessRestrictions, then default accessRestriction from namespace is returned if (inherited is false) and node has no accessRestrictions, then AccessRestrictionsFlag.None is returned

      Parameters

      • inherited: boolean

      Returns AccessRestrictionsFlag

    • Parameters

      • Optionallocale: string

        the locale of the text to return (e.g. en-EN)

      Returns string

    • Parameters

      • name: string

      Returns UAState | null

    • return all state nodes associated with this state machine

      Returns UAState[]

    • Returns boolean

    • Parameters

      • n: number

      Returns void