Time Series Database Cache Module by Automation Professionals
E-Mail Support

system.db.getSeriesCache

Query a registered time series cache for data within a timestamp range, immediately returning any cached data. Missing data is retrieved from the data source in the background. Call repeatedly to obtain additional data as it arrives.

Syntax

system.db.getSeriesCache(handle, [priority,] begints, endts, [gapTolerance,] valuecolumns[]) returns Dataset

ArgumentData TypeDescription
handleLongNumeric handle from registerSeriesCache().
priorityIntegerOptional, non-negative. One if omitted. Systemwide bulk queries for missing data will be executed in priority order. EasyNoteChart uses priority=1 for chart data and priority=2 for histogram data.
minTSDateQuery start timestamp. Must not be null.
maxTSDateQuery end timestamp. Must not be null.
gapToleranceLongOptional, Milliseconds. Insert a null row when consecutive timestamps are further apart than this tolerance.
valuecolumnsString[]List of Strings defining the value columns to be delivered.

Usage Notes

If there is a chance you won't call the getSeriesCache() function often enough to keep the handle from expiring, you should wrap a first attempt in a try/except block, where the except clause obtains a fresh handle.

The Dataset returned is actually a supporting subclass: TransientSeriesFragment. It carries additional properties and methods that can describe the progress of the cache query. It also excludes its rows from most serialization, avoiding storing large datasets in your projects.

See the timeSeriesCache expression function for a description of the underlying cache behavior.