Skip to content
Version 6.1.0
Contact Us

BACnetStack_SetIntrinsicChangeOfBitstringAlgorithm

bool BACnetStack_SetIntrinsicChangeOfBitstringAlgorithm(
const uint32_t deviceInstance,
const uint16_t objectType,
const uint32_t objectInstance,
const uint32_t bitmask,
const uint32_t alarmValue,
const uint32_t bitstringLength,
const uint32_t timeDelay,
const bool useTimeDelayNormal,
const uint32_t timeDelayNormal,
const bool enable);

Enables the ChangeOfBitstring intrinsic event algorithm for a bitstringValue object.

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. The monitored value is the Present_Value (a BACnet BIT STRING). bitmask is a packed-uint32 mask (bit i = bit i of the bitstring, bit 0 = first defined bit) of which monitored bits are significant, and alarmValue is a single packed-uint32 alarm value. The object transitions to OFFNORMAL when (monitored AND bitmask) equals alarmValue and back to NORMAL when it does not, honoring the configured time delays.

Note: the engine holds 64 bits but this API’s bitmask and alarmValue are uint32, so bits 32..63 are always supplied as zero - they can never be made significant and never be required to be set. Only the first 32 bits of a bitstringValue can be armed through this export. See BACnetStack_SetIntrinsicChangeOfBitstringAlgorithm64() below for a sibling export that reaches all 64.

BACnet reference: ANSI/ASHRAE 135-2024 clause 13.3.1 (CHANGE_OF_BITSTRING Event 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).
Parameter Direction Description
bitmask in Packed-uint32 mask of the significant bits (cl. 13.3.1 pBitmask). Bit i of this uint32 is bit i of the BACnet BIT STRING, bit 0 being the FIRST bit of the bitstring, not the least significant bit of the wire octet.
alarmValue in Packed-uint32 alarm value, same bit order, compared against (monitored AND bitmask). Cl. 13.3.1 defines pAlarmValues as a LIST; this API sets exactly one alarm value, which is a DEVIATION.
bitstringLength in The number of significant bits in the monitored bitstring. MUST be 1..64 - 0 is rejected (an all-zero mask/alarm-value pair would match every monitored value, putting the object OFFNORMAL immediately and permanently) and a value above 64 is rejected rather than silently clamped; the call returns false and changes nothing.
timeDelay in The time delay for the transition to the OFFNORMAL state.
useTimeDelayNormal in Whether to use a separate timeDelayNormal for the to-normal transition.
timeDelayNormal in The time delay for the transition back to the NORMAL state.
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, bitstringLength is out of range, or Alarm-and-Event support was not compiled (STACK_OPTION_ALARMS_AND_EVENTS).

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