NodeOPCUA API Documentation
    Preparing search index...

    Interface UALimitAlarmHelper

    interface UALimitAlarmHelper {
        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;
        getHighHighLimit(): number;
        getHighLimit(): number;
        getInputNodeNode(): UAVariable<UAVariableEvents> | null;
        getInputNodeValue(): number | null;
        getLowLimit(): number;
        getLowLowLimit(): number;
        getMaxTimeShelved(): number;
        getSuppressedOrShelved(): boolean;
        installInputNodeMonitoring(
            inputNode: NodeId | BaseNode<BaseNodeEvents>,
        ): void;
        isSuppressedOrShelved(): boolean;
        onInputDataValueChange(newValue: DataValue): void;
        setHighHighLimit(value: number): void;
        setHighLimit(value: number): void;
        setLowLimit(value: number): void;
        setLowLowLimit(value: number): void;
        setMaxTimeShelved(duration: number): void;
        setStateBasedOnInputValue(value: 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 number

    • Returns number

    • Returns number | null

    • Returns number

    • Returns number

    • Returns number

    • Returns boolean

    • 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

      • value: number

      Returns void

    • Parameters

      • value: number

      Returns void

    • Parameters

      • value: number

      Returns void

    • Parameters

      • value: number

      Returns void

    • Parameters

      • duration: number

      Returns void

    • How the alarm turns the value of its input node into limit states. Assign to it to give a limit alarm a rule of its own:

      alarm.setStateBasedOnInputValue = (value) => {
      const isActive = value > alarm.getHighLimit();
      alarm.signalNewCondition(isActive ? "High" : null, isActive, value.toFixed(3));
      };

      Every concrete limit alarm type already defines this, so assigning to one replaces the rule it came with; the base LimitAlarmType has no limit states of its own and throws.

      The old name _setStateBasedOnInputValue still works and is deprecated.

      Parameters

      • value: 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