Skip to content
Version 6.1.0
Contact Us

BACnetStack_SendReadRangeWithTime

bool BACnetStack_SendReadRangeWithTime(
uint8_t * sentInvokeId,
const uint16_t objectType,
const uint32_t objectInstance,
const uint32_t propertyIdentifier,
const bool usePropertyArrayIndex,
const uint32_t propertyArrayIndex,
const uint8_t referenceYearMinus1900,
const uint8_t referenceMonth,
const uint8_t referenceDay,
const uint8_t referenceWeekday,
const uint8_t referenceHour,
const uint8_t referenceMinute,
const uint8_t referenceSecond,
const uint8_t referenceHundredthSecond,
const int16_t count,
const uint8_t * connectionString,
const uint8_t connectionStringLength,
const uint32_t networkPortInstance,
const uint16_t destinationNetwork,
const uint8_t * destinationAddress,
const uint8_t destinationAddressLength);

Sends a ReadRange request that selects entries by time.

Sends a confirmed ReadRange request using the By Time reference (cl. 15.8), reading count entries starting at the entry whose timestamp is nearest the given reference date/time (negative count reads backwards from the reference). Only meaningful for properties with timestamped entries (e.g. log buffers). The reference is sent as the by-time [7] arm of the request’s range CHOICE (cl. 21).

See also: Client response hooks

BACnet reference: ANSI/ASHRAE 135-2024 clause 15.8 (ReadRange Service).

Parameter Direction Description
sentInvokeId out The invoke-id of the sent request, valid only if this function returns true.
objectType, objectInstance in The object being queried: one BACnet Object Identifier, carried as two parameters (see the API conventions).
propertyIdentifier in The list/array property to read a range of.
usePropertyArrayIndex, propertyArrayIndex in If usePropertyArrayIndex is true, read a range of this array element.
referenceYearMinus1900, referenceMonth, referenceDay, referenceWeekday, referenceHour, referenceMinute, referenceSecond, referenceHundredthSecond in The reference date/time to read relative to, sent as the by-time arm’s BACnetDateTime (cl. 21: a Date followed by a Time). Date fields are the BACnet WIRE form (cl. 20.2.12): year is the calendar year MINUS 1900, so 2026 is 126 - these are uint8_t, and passing a 4-digit year truncates silently at the call site into a valid-looking wrong date; month has January = 1 (13 = odd months, 14 = even months); day is 1..31 (32 = last day of month, 33 = odd days, 34 = even days); weekday is Monday = 1 .. Sunday = 7. 255 = unspecified in any of them.
count in The number of entries to read; negative reads backwards from the reference time. 0 is refused (135-2024 cl. 15.8.1.1.4.3.2): the function returns false and sends nothing.
connectionString, connectionStringLength in The datalink address to send TO (the destination) - not the local address to send from. For IPv4 this is 6 bytes: 4 octets of IPv4 address followed by 2 octets of port, big-endian (e.g. 0xC0,0xA8,0x01,0x05,0xBA,0xC0 = 192.168.1.5:47808; see BACnetStack_SendRegisterForeignDevice() for a worked example); on BACnet/IPv4 the stack refuses to send to a connection string of any other length, except that a broadcast from a device registered as a foreign device goes to its BBMD and does not use the connection string. MS/TP and BACnet/SC use a different connection-string shape; see their respective Set/Send exports.
networkPortInstance in The Network Port object instance to send the message on, or BACNET_NETWORK_PORT_DEFAULT (4194303) for the default/single port.
destinationNetwork, destinationAddress, destinationAddressLength in The destination to send the request to.

True if the request was sent, otherwise false.

Topic: Client requests. Declared in CASBACnetStackDLL.h.