BACnetStack_ReadTrendLogMultipleRecord
uint32_t BACnetStack_ReadTrendLogMultipleRecord( const uint32_t deviceInstance, const uint32_t objectInstance, const uint32_t offset, CASBACnetTime * timestamp, uint8_t * dataType, char * dataAsString, uint32_t * dataLength, const uint32_t maxDataStringLength, bool * more);Gets a record from the Trend Log Multiple in a string format that can be used to backup the record.
Returns true if successful or false if failed. Can fail for the following reasons:
- Object doesn’t exist
- Device doesn’t exist
- If required parameters are NULL or invalid
- If polling for an offset that doesn’t exist.
Every out-parameter is required: passing NULL for timestamp, dataType, dataLength or more fails the call (it returns 0) and nothing is written. dataAsString is required too, unless maxDataStringLength is 0, and then the call fails because no record string fits in it. There is no “skip this output” convention.
BACnet reference: ANSI/ASHRAE 135-2024 clause 12.30 (Trend Log Multiple Object Type).
Parameters
Section titled “Parameters”| Parameter | Direction | Description |
|---|---|---|
deviceInstance |
in | The instance of the device that contains the trend log multiple object |
objectInstance |
in | The instance of the trend log multiple object. |
offset |
in | The record number to retrieve. 0 is the first record. An offset at or past the current record count fails. |
timestamp |
out | Receives the record timestamp in UTC epoch seconds: the stored local time converted with the UTC_Offset (and Daylight_Savings_Status) your application serves for the Device at the time of this call - the conversion BACnetStack_InsertTrendLogMultipleRecord() applies. A record stored under the other Daylight_Savings_Status reads out one hour off. |
dataType |
out | Receives the record kind, the alternative of the record’s BACnetLogData CHOICE (cl. 21): 0 = Log Status, 1 = Log Data, 2 = Time Change. See BACnetStack_InsertTrendLogMultipleRecord(). |
dataAsString |
out | Receives the record value in the same string format BACnetStack_InsertTrendLogMultipleRecord() accepts, so a record read here can be inserted back verbatim, with the same value, and reads out as the same string again. NOT NUL-TERMINATED - the bytes are copied raw, and a record that exactly fills the buffer leaves no room for a terminator. Use dataLength, never strlen. |
dataLength |
out | Receives the number of bytes written to dataAsString. Always written when this call returns true. |
maxDataStringLength |
in | The capacity of dataAsString in bytes. A record longer than this does NOT truncate - the ENTIRE read fails and returns false, and nothing is written. Size the buffer for the widest record the log can hold, which grows with the number of logged objects. |
more |
out | Set true while further records follow, false on the last record. |
Returns
Section titled “Returns”The number of bytes written to dataAsString (matching the value written to dataLength) on success, 0 if the device or the Trend Log Multiple object does not exist, the offset is past the end, an out-parameter is NULL, dataAsString is too small, or Trend Log Multiple support was not compiled. Every record has a non-empty string, so a successful read never returns 0.
Topic: Schedules, calendars, trend logs and other object configuration. Declared in CASBACnetStackDLL.h.