Function
The function GetArchivData is used to get a data from the archive database.
Declaration
APIRET GetArchivData(const char *name, double Begin, double End, unsigned int Step, unsigned short wait, ChainBrowseDataPtr dataPtr)

Parameters
The parameter name defines the name of a historical value, Begin is a beginning of required time interval and End is an end of this time interval. The parameter Step determines a time step for selecting values from the archive, if the parameter is zero then we get all the data from defined time interval. The parameter wait [s] defines a maximal time to wait for data from the archive.
Return code
Code Description
API_OK Archive data was obtained correctly in defined time. The Required data is returned by the parameter dataPtr in the form of a list. After use the data, the allocated memory for each pointer must be freed by calling the function FreeData.
API_TimeoutError Required data was not obtained in the defined time.
API_ParamError The value of the parameter dataPtr is null or both the times Begin and End are invalid.

Napíšte komentár