BACnetStack_AddScheduleObject
bool BACnetStack_AddScheduleObject( const uint32_t deviceInstance, const uint32_t scheduleObjectInstance);Creates the stack-held BACnetStackSchedule for a Schedule object so the stack serves its properties natively.
The only Schedule properties that are handled and stored by the CAS BACnet Stack are:
- ObjectIdentifier, ObjectType, PropertyList, StatusFlags
- WeeklySchedule (BACnetStack_AddScheduleWeeklyTimeValue(); client-writable)
- ScheduleDefault (BACnetStack_SetScheduleDefault(); client-writable)
- PresentValue (computed by the Schedule engine; read-only to clients)
- EffectivePeriod, ListOfObjectPropertyReferences and PriorityForWriting (served from the engine itself - see BACnetStack_SetScheduleEffectivePeriod(), BACnetStack_AddScheduleObjectPropertyReference() and BACnetStack_SetSchedulePriorityForWriting()). Until BACnetStack_SetScheduleEffectivePeriod() is called, EffectivePeriod reads as the date range with both dates unspecified (“always”), the range the engine then evaluates.
- ExceptionSchedule (BACnetStack_AddScheduleExceptionEventWithCalendarEntry(), BACnetStack_AddScheduleExceptionEventWithCalendarReference(), BACnetStack_AddScheduleExceptionTimeValue()) - see below
ExceptionSchedule is held by the engine, which evaluates it along with WeeklySchedule to compute PresentValue, and is served from there: the whole array, array index 0 for the number of special events, or array index n for the n-th event. This function does not enable it; the first successful BACnetStack_AddScheduleExceptionEvent* call does. It is read-only to clients unless you make it writable with BACnetStack_SetPropertyWritable(); a client can then write the whole array, one element, or a new size through array index 0 (135-2024 cl. 12.24.8), up to 255 special events.
The other properties are the application’s:
-------------------------------------------------------------------------------- Property Datatype Callback -------------------------------------------------------------------------------- ObjectName CharacterString CallbackGetPropertyCharacterString Reliability Enumerated CallbackGetPropertyEnumerated OutOfService Boolean CallbackGetPropertyBool --------------------------------------------------------------------------------IMPORTANT: the Schedule engine evaluates against the Device object’s Local_Date and Local_Time, not the system-time callback, and the stack holds no value for either. Enable both on the Device object with BACnetStack_SetPropertyEnabled() and serve them, normally from the host clock, with CallbackGetPropertyDate and CallbackGetPropertyTime (objectType device, propertyIdentifier LocalDate 56 / LocalTime 57). Until both read, the Schedule is not evaluated: Present_Value is not computed and no ListOfObjectPropertyReferences target is written (the debug log reports it once, as an error naming the Schedule). A TimeSynchronization reaches the Schedule only through those same two properties.
See also: BACnetStack_ObjectExists(), BACnetStack_RemoveObject()
BACnet reference: ANSI/ASHRAE 135-2024 clause 12.24 (Schedule Object Type).
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The device instance that owns this Schedule object. |
scheduleObjectInstance |
in | The instance of an existing Schedule object (add it with BACnetStack_AddObject() first). SIDE EFFECT - WIRE VISIBLE: this call makes Weekly_Schedule and Schedule_Default WRITABLE over BACnet, so any client that can reach this device can rewrite the schedule. That is what SCHED-E-B conformance requires, but it is a real change in what the network can do to this device and is stated here rather than left to be discovered. |
Returns
Section titled “Returns”True on success; false if the device does not exist, the Schedule object instance was not first added with BACnetStack_AddObject(), or Schedule support was not compiled (STACK_OPTION_OBJECT_TYPE_SCHEDULE).
Topic: Schedules, calendars, trend logs and other object configuration. Declared in CASBACnetStackDLL.h.