Skip to content
Version 6.1.0
Contact Us

BACnetStack_SetFaultOutOfRangeAlgorithmReal

bool BACnetStack_SetFaultOutOfRangeAlgorithmReal(
const uint32_t deviceInstance,
const uint16_t objectType,
const uint32_t objectInstance,
const float faultLowLimit,
const float faultHighLimit,
const bool enable);

Enables the FAULT_OUT_OF_RANGE fault algorithm (135-2024 cl. 13.4.7) with REAL limits.

Reliability moves to UNDER_RANGE below faultLowLimit and to OVER_RANGE above faultHighLimit, and back to NO_FAULT_DETECTED inside the range. Cl. 13.4.7 defines no time delay and none is applied here - the transition is indicated on the first evaluation that sees the out-of-range value. The object must exist and have alarms and events enabled by BACnetStack_SetAlarmsAndEventsForObjectEnabled(…, enabled=true) - an Event Enrollment object carries its own and needs no such call; otherwise this returns false.

This REAL setter is the only FAULT_OUT_OF_RANGE export, but the stack ACCEPTS the algorithm on six object types: analogInput and analogValue (REAL), largeAnalogValue (Double), integerValue (SignedInteger), positiveIntegerValue and accumulator (UnsignedInteger). Cl. 13.4.7 requires all three numeric parameters to share the monitored value’s own datatype, so this export - which only carries REAL limits - REFUSES to arm on the four non-REAL object types rather than storing REAL limits that would be compared through the monitored datatype (an arbitrary bit-for-bit reinterpretation). There is currently no typed setter for those four object types; use this export only on analogInput and analogValue.

This function will enable the required properties and store the initial values in memory.

BACnet reference: ANSI/ASHRAE 135-2024 clause 13.4.7 (FAULT_OUT_OF_RANGE Fault Algorithm).

Parameter Direction Description
deviceInstance in The instance number of the device that owns this object.
objectType, objectInstance in The object for alarms and events: one BACnet Object Identifier, carried as two parameters (see the API conventions).
faultLowLimit in The minimum normal value.
faultHighLimit in The maximum normal value.
enable in Initial inhibit state, inverted - NOT a remove. true arms the algorithm; false leaves it armed but INHIBITED through the object’s Event_Algorithm_Inhibit property (or Reliability_Evaluation_Inhibit for a fault algorithm). Both of those properties are made WRITABLE by BACnetStack_SetAlarmsAndEventsForObjectEnabled(), so a remote client can change the state afterwards. To genuinely remove an armed algorithm, disable the object with BACnetStack_SetAlarmsAndEventsForObjectEnabled(…, enabled=false). Recommended value: true

True on success; false if the device or object does not exist, the object type does not support this algorithm, the object type’s Present_Value is not REAL (largeAnalogValue, integerValue, positiveIntegerValue, accumulator), or Alarm-and-Event support was not compiled (STACK_OPTION_ALARMS_AND_EVENTS).

Topic: Alarms and events. Declared in CASBACnetStackDLL.h.