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 a defined time interval. The parameter wait [s] defines a maximal time to wait for data from the archive.
Return code
Code Description
API_OKArchive data was obtained correctly in a defined time. The Required data is returned by the parameter dataPtr in the form of a list. After using the data, the allocated memory for each pointer must be freed by calling the function FreeData.
API_TimeoutErrorRequired data was not obtained in the defined time.
API_ParamErrorThe value of the parameter dataPtr is null or both the times Begin and End are invalid.
Napíšte komentár