Retrieving Logged Data Using "GetLog"

To retrieve data values for a tag, the "GetLog" module can be used. It allows accessing of historical data by variable name when that data may span several files.

If the data doesn't currently exist, invalid array elements will be returned. The first parameter of the "GetLog" module will be set to the data array retrieved from the files. When this value becomes valid, "GetLog" execution has completed.

"GetLog" module instances are multithreaded, so that file access does not interfere with the normal operation of the application.

The parameters for the "GetLog" module are:

      Result - A pointer to the value to set to the array retrieved from the file.

      Point - The object value of the tag that has logged the data that we want to access.

      Name - Name of the logged data value to access (i.e. a class 1 to 5 variable in the tag). If this value is an empty string ("") the data accessed is the timestamp in number of seconds since January 1, 1970.

      Start - The start time of the data to access, in seconds since midnight on January 1, 1970.

      End - The end time of the data requested, in seconds since midnight on January. 1, 1970.

      TPP - The time period per data point. If this value is not valid, the Size parameter will be used to how to access the data.

      Size - The maximum number of data points to get. If this is a valid value > 0, the data will be accessed "one at a time" from the file, rather than at equal time intervals

      Mode - The retrieval mode:

      0 - Time weighted average

      1 - Minimum in range

      2 - Maximum in range

      3 - Change in value over the range

      4 - Value at start of range

If a workstation is a Log Manager server, as specified in the application's Config.ini configuration file (using the [LOGMANAGER-SERVERS] section – see Configure Separate Servers for Separate Services), that workstation will record data directly to its disk. Then, a call to the GetLog module on a client will automatically go to the server and fetch only the requested data; it will not attempt to access the server's data files directly (see Retrieving Logged Data Using "GetLog"). The same method is used by failed servers to automatically retrieve all of the data they have missed from the current server when they restart.