GetHistory
Deprecated. Do not use in new code.
Description: | Get History from a File written by Save or SaveHistory. This threaded function retrieves an array of data from a .DAT file for a certain time span. If the parameters to GetHistory are valid and an attempt is made to get the data, the return value is 0, otherwise, if no attempt is made to get the data, the return value is 1. |
Returns: | Numeric (see discussion of the first parameter) |
Usage: | Script Only. |
Function Groups: | File I/O, Log |
Related to: | GetHistory | HistorianDeleteRecords | HistorianGetData | HistorianGetInfo | HistorianReadRecords | HistorianWriteRecords | Get | GetLog| GetLogInfo | Save | SaveHistory | TGet |
Threaded: | Yes |
Format: | GetHistory(Array, File, StartTime, EndTime [, Error, PathPrefix]) |
Parameters: |
Array | ||||||||||||
Required. A variable that will be set to an array upon completion of the data retrieval. The format of the array is [column][record]. Column 0 is the timestamp in seconds since January 1, 1970. Each subsequent column is the data for that record. Array is not set if there is no data for the requested period. | ||||||||||||
File | ||||||||||||
Required. Any text expression giving the file name for the historical data file. The file extension must be included. If the file name is prefixed with a period, the path will be to the directory in which the module is contained. | ||||||||||||
StartTime | ||||||||||||
Required. Any numeric expression giving the start time of the period for which data is requested in seconds since January 1, 1970. | ||||||||||||
EndTime | ||||||||||||
Required. Any numeric expression giving the end time of the period for which data is requested in seconds since January 1, 1970. | ||||||||||||
Error | ||||||||||||
An optional variable that will always be set to a valid value upon completion of the GetHistory. Its meaning is as follows:
If Error is not required, but PathPrefix is, then Error should be given as an Invalid value. |
PathPrefix |
An optional text expression parameter that enables and controls the retrieval of data from across a set of files. |
Comments: |
This function is threaded - that is to say, it starts its own thread and VTScada will continue executing. When it is finished executing, it will set the data in Array. Note that Array will not be initially invalidated upon execution of this statement, so if Array already contained data when the GetHistory was executed, that data will remain untouched until all of the data requested by GetHistory has been amassed, at which time Array will be set to its new value.
PathPrefix would normally be Invalid or the application path. |