NodeOPCUA API Documentation
    Preparing search index...

    Interface UAAlarmConditionHelper

    interface UAAlarmConditionHelper {
        acknowledgeAndAutoConfirmBranch(
            branch: ConditionSnapshot,
            comment: LocalizedText | LocalizedTextLike,
        ): void;
        activateAlarm(): void;
        autoConfirmBranch(
            branch: ConditionSnapshot,
            comment: LocalizedTextLike,
        ): void;
        calculateConditionInfo(
            stateName: string | null,
            isActive: boolean,
            value: string,
            oldConditionInfo: ConditionInfo,
        ): ConditionInfo;
        deactivateAlarm(retain?: boolean): void;
        getCurrentConditionInfo(): ConditionInfo;
        getInputNodeNode(): UAVariable<UAVariableEvents> | null;
        getInputNodeValue(): number | null;
        getMaxTimeShelved(): number;
        getSuppressedOrShelved(): boolean;
        installInputNodeMonitoring(
            inputNode: NodeId | BaseNode<BaseNodeEvents>,
        ): void;
        isSuppressedOrShelved(): boolean;
        onInputDataValueChange(newValue: DataValue): void;
        setMaxTimeShelved(duration: number): void;
        signalNewCondition(
            stateName: string | null,
            isActive: boolean,
            value: string,
        ): void;
        updateState(): void;
    }

    Hierarchy (View Summary)

    Index
    • Returns void

    • What the alarm reports when its state changes. Assign to it to give an alarm a message and a severity of its own:

      alarm.calculateConditionInfo = (state, isActive, value, oldConditionInfo) =>
      new ConditionInfo({
      message: `Tank is almost ${Math.ceil(Number(value) * 100)}% full`,
      severity: 100,
      quality: StatusCodes.Good,
      retain: true
      });

      The default returns the previous ConditionInfo unchanged, so an alarm that does not assign one reports nothing new.

      This has been the documented way to give an alarm its own message for years, but under the name _calculateConditionInfo and only on the implementation class, so following the documentation meant importing from inside the package. That name still works and is deprecated.

      Parameters

      • stateName: string | null
      • isActive: boolean
      • value: string
      • oldConditionInfo: ConditionInfo

      Returns ConditionInfo

    • Parameters

      • Optionalretain: boolean

      Returns void

    • Returns ConditionInfo

    • Returns number | null

    • Returns number

    • Returns boolean

    • Parameters

      Returns void

    • Returns boolean

    • What the alarm does when the value of its input node changes. Assign to it to give an alarm a behaviour of its own, without deriving from an implementation class:

      alarm.onInputDataValueChange = (newValue) => {
      const tooHot = newValue.value.value > 80;
      if (tooHot !== alarm.activeState.getValue()) {
      alarm.signalNewCondition(tooHot ? "Active" : "Inactive", tooHot, `${newValue.value.value}`);
      }
      };

      The default does nothing: a plain AlarmConditionType cannot know what its input means. Alarm types that do know (limit alarms, off-normal alarms) already define it, so assigning to one of those replaces the behaviour it came with.

      The old name _onInputDataValueChange still works and is deprecated.

      Parameters

      Returns void

    • Parameters

      • duration: number

      Returns void

    • Raise a new condition event for this alarm, moving it to the given state.

      Call this only when the condition has actually changed: it throws when the ConditionInfo it computes is equal to the current one, because an event that reports nothing new is a bug in the caller rather than a state the alarm can represent.

      The old name _signalNewCondition still works and is deprecated.

      Parameters

      • stateName: string | null
      • isActive: boolean
      • value: string

      Returns void

    • Returns void