BACnetStack_SetIntrinsicChangeOfStateAlgorithmEnum
bool BACnetStack_SetIntrinsicChangeOfStateAlgorithmEnum( const uint32_t deviceInstance, const uint16_t objectType, const uint32_t objectInstance, const uint32_t alarmValue, const uint32_t timeDelay, const bool useTimeDelayNormal, const uint32_t timeDelayNormal, const bool enable);Enables the Intrinsic Change of State Algorithm with an ENUMERATED primitive for an 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.
This is the enumerated variant of BACnetStack_SetIntrinsicChangeOfStateAlgorithmBool(), used for objects whose monitored Present_Value is enumerated (e.g. Binary objects whose Present_Value is BACnetBinaryPV). The alarm value is stored as the property-state type of the object’s own monitored value (binary-value for Binary Input/Value, door-alarm-state for Access Door, shed-state for Load Control, zone-occupancy-state for Access Zone), so its type matches the monitored value’s type.
On a Binary Input or Binary Value each call REPLACES the previous alarm value. On an Access Door or Access Zone each call ADDS the value to the object’s Alarm_Values list, and on a Load Control to the algorithm’s alarm values (a Load Control serves no Alarm_Values property); a value already present is not added twice. To remove values, disable the object with BACnetStack_SetAlarmsAndEventsForObjectEnabled(…, enabled=false) and arm it again.
This function will enable the required properties and store the initial values in memory.
BACnet reference: ANSI/ASHRAE 135-2024 clause 13.3.2 (CHANGE_OF_STATE Event Algorithm).
Parameters
Section titled “Parameters”| 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). |
alarmValue |
in | The enumerated alarm value (e.g. BACnetBinaryPV active=1, inactive=0). |
timeDelay |
in | How long, in seconds, an offnormal condition has to persist before the event state changes to offnormal. |
useTimeDelayNormal |
in | Whether to use a different time delay value for the timeDelayNormal, or just use the timeDelay value. |
timeDelayNormal |
in | How long, in seconds, a normal condition has to persist before the event state returns to normal. |
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 |
Returns
Section titled “Returns”True on success; false if the device or object does not exist, the object type does not support this algorithm, or Alarm-and-Event support was not compiled (STACK_OPTION_ALARMS_AND_EVENTS).
Topic: Alarms and events. Declared in CASBACnetStackDLL.h.