logSeek (Function) |
Top Previous Next |
logSeek will move the current read position a number of records forward/backward (in time) in the Datalogger. It is possible to specify a specific tag value and the number of rows, and whether the search should be forward or backward in time. If the tag value is specified, the function will move the current read position"'n" a number of records with the specified tag value in the specified direction. If no tag value is specified, the current read position will just move "n" number of rows - regardless of the tag values of the rows. The direction of the search is given by the sign of "n". If it is positive, the search will be forward in time, if it is negative, the search will be backwards.
Please note: The search will start at the next record in the specified direction. This means that in case the tag value of the current record is the same as specified in logSeek(), this record will not be returned. This is especially important when using logLast() / logFirst().
Note for multithreading application: There is only 1 global read-pointer available for each Datalogger which means that several threads navigating the Datalogger should implement critical sections to avoid problems.
Input: tag : INT Which tag value to search for. -1 indicates that no tag value is specified.
n : INT Number of rows to move. If positive, the search will be forward, if negative, the search will be backwards.
handle : SYSHANDLE A handle to the Datalogger to navigate. If not provided, it will work on the flash-based log. Only supported on NX32L with firmware 1.50.00 or newer.
Returns: INT Number of records actually moved (maintains the sign of "n").
Declaration: FUNCTION logSeek : INT;
Example: INCLUDE rtcu.inc |