Skip to content
Version 6.1.0
Contact Us

BACnetStack_AddCalendarObject

bool BACnetStack_AddCalendarObject(
const uint32_t deviceInstance,
const uint32_t calendarObjectInstance);

Adds a Calendar object whose Date_List and Present_Value the stack maintains.

Hands a Calendar object to the stack: from now on the stack holds its Date_List and derives its Present_Value - TRUE if the device’s current Local_Date matches any Date_List entry, FALSE if not (135-2024 cl. 12.9.5). The Date_List starts empty. Populate it with the BACnetStack_AddCalendar*Entry functions below; clients read it with ReadProperty. Present_Value is re-derived every BACnetStack_Tick() and on every read, and a change is reported to COV subscribers.

IMPORTANT: the stack holds no Local_Date. Enable it on the Device object with BACnetStack_SetPropertyEnabled() and serve it, normally from the host clock, with CallbackGetPropertyDate (objectType device, propertyIdentifier LocalDate 56). While it cannot be read, Present_Value is not re-derived: it keeps its last derived value, FALSE before the first.

Opt-in: a Calendar that is only added with BACnetStack_AddObject() keeps being served by your CallbackGetPropertyBool (Present_Value) and other callbacks. Calling this again for a Calendar that is already stack-held keeps its Date_List.

Date_List is read-only to BACnet clients by default. To let clients change it with WriteProperty, AddListElement and RemoveListElement, make it writable with BACnetStack_SetPropertyWritable() (Date_List, property identifier 23). The stack then accepts every BACnetCalendarEntry form (cl. 12.9.6).

A Schedule’s calendar-reference special event (BACnetStack_AddScheduleExceptionEventWithCalendarReference()) matches through the referenced Calendar’s Date_List only when that Calendar is stack-held.

See also: BACnetStack_ObjectExists(), BACnetStack_RemoveObject()

BACnet reference: ANSI/ASHRAE 135-2024 clause 12.9 (Calendar Object Type).

Parameter Direction Description
deviceInstance in The device instance that owns the Calendar object.
calendarObjectInstance in The Calendar object instance. It must already exist (BACnetStack_AddObject(deviceInstance, 6, N)).

True on success; false if the device or Calendar object does not exist, the instance is out of range, or Calendar support was not compiled.

Topic: Schedules, calendars, trend logs and other object configuration. Declared in CASBACnetStackDLL.h.