HistorianReadRecords

(Engine-Level Function)

Description: Reads a range of records from the data store. The range is specified by the Start and End counter values supplied.
Warning:

This function should be used only by advanced programmers.

The function GetTagHistory is recommended for most uses.

Returns: Invalid if parameters are invalid, 0 otherwise.
Usage: Script Only.
Threaded: Yes
Related to: HistorianConnect | HistorianDeleteRecords | HistorianGetData | HistorianGetInfo | HistorianWriteRecords
Format: HistorianReadRecords (ConnectionHandle, TagName, Schema, Data, MID-S, StartCounter, EndCount, ErrorCode)
Parameters:  
ConnectionHandle
As returned by an HistorianConnect call.
TagName
A text string representing the desired table name. Engine code may modify this to conform with storage limitations.
Schema
This is a textual representation of a schema structure.
Data
A variable in which the values will be returned.

This will be a single dimension array representing the Fields (columns). The entries in the array will be an array of values (all fields will be the same) and the size of one of these arrays gives the number of records (rows) in the result set.
Mid-S
A  64 bit binary token.
StartCounter
Starting counter number. Starts counting at 1 rather than zero.
EndCounter
Ending counter number. Starts counting at 1 rather than zero.
ErrorCode

FileDB or SQL DB error code returned.

Defined error codes are provided in the reference chapter. See: Historian Error Codes

Comments: Data will be set on completion of the operation.
ErrorCode will be set on completion of the operation. This will be set to zero if the operation was successful

Together, the Schema and the MID-S parameters define the subset of records in the Index file from which the data in the required Counter range will be retrieved. If this filtered subset has no data, then none will be returned.

Example:

No example provided. This function is not recommended for most use.