Skip to content
Version 6.1.0
Contact Us

BACnetStack_AddScheduleExceptionTimeValue

bool BACnetStack_AddScheduleExceptionTimeValue(
const uint32_t deviceInstance,
const uint32_t scheduleObjectInstance,
const uint32_t exceptionIndex,
const uint8_t hour,
const uint8_t minute,
const uint8_t second,
const uint8_t hundredthSecond,
const uint8_t valueDatatype,
const uint32_t valueAsUnsigned,
const float valueAsReal);

Appends one (time, value) transition to the special event identified by exceptionIndex.

The transition is one BACnetTimeValue in that BACnetSpecialEvent’s list of time values (cl. 21).

BACnet reference: ANSI/ASHRAE 135-2024 clause 12.24 (Schedule Object Type).

Parameter Direction Description
deviceInstance in The device instance that owns this Schedule object.
scheduleObjectInstance in The Schedule object to modify.
exceptionIndex in The special-event handle returned by BACnetStack_AddScheduleExceptionEventWithCalendarEntry() or BACnetStack_AddScheduleExceptionEventWithCalendarReference(): the zero-based position of the event in Exception_Schedule. It stays valid only while that position holds the same event. If Exception_Schedule has been made writable, a client’s write of the whole array, or of a smaller size through array index 0, can replace or remove the event, and the handle then names a different event or none.
hour in Hour of the transition, 0..23.
minute in Minute of the transition, 0..59.
second in Second of the transition, 0..59.
hundredthSecond in Hundredths of a second, 0..99.
valueDatatype in The application datatype of the value: 0 = Null (no value / relinquish), 1 = Boolean, 2 = UnsignedInteger, 3 = SignedInteger, 4 = Real, 9 = Enumerated. See CASBACnetStack::BACnetStackDatatypes. Use 9 = Enumerated for a Binary Value or Binary Output target - BACnetBinaryPV is an ENUMERATED, and scheduling it as 2 = UnsignedInteger produces a Schedule whose value datatype does not match its references (135-2024 cl. 12.24.13 makes that a CONFIGURATION_ERROR). Any other datatype, including 5 = Double, is rejected and the call returns false; Double is excluded deliberately because the FFI payload below is a 32-bit float. CharacterString, OctetString, BitString, Date, Time and ObjectIdentifier are spec-legal for a Schedule but are not reachable through this triple.
valueAsUnsigned in The value when valueDatatype is Boolean (0 = false, non-zero = true), UnsignedInteger, SignedInteger (reinterpreted as int32_t, so pass a negative value by cast) or Enumerated; ignored otherwise.
valueAsReal in The value when valueDatatype is Real; ignored otherwise.

True on success; false if the device or Schedule object does not exist, exceptionIndex is not a known special event, or Schedule support was not compiled.

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