StartAtRecord

This function will attempt to start processing at the specified file mark and record number. If the specified record cannot be located, it will start processing at the oldest record since the specified record. If the specified record is beyond what is available, it starts processing at the oldest available record.

NOTE: As LoggerNet collects data from a table, the table's record number, which normally increases by one with each record stored, can get reset to zero for various reasons (e.g., the datalogger recompiles its program). Therefore, the record number alone is not sufficient to identify a record within LoggerNet's cache table. LoggerNet uses the file mark number to keep these discontinuities straight. Each time that a missed hole event is detected or the record number regresses, LoggerNet will increment the file mark number that it uses to store new records.

NOTE: Starting with LoggerNet 4.1, you can specify this parameter with a value of &HFFFFFFFF. The LoggerNet server will interpret this by looking for the starting record number in the latest file mark.

NOTE: Tablemon2.exe can be used to look at file marks for a data table.  It can be found in the LoggerNet program directory (C:\Program Files\Campbellsci\LoggerNet by default).

Syntax

StartAtRecord ( fileMarkNo, recordNo, orderOption )

Remarks

The StartAtRecord function can be used to specify the starting condition and order option for any variable referenced in the expression. This function, as well as its parameters, will only be evaluated once when the expression is first compiled and should not reference any source variables. It should appear at the beginning of the expression and either be enclosed in parentheses or followed by a semi-colon. The fileMarkNo and recordNo parameters specify the file mark and record number at which to start processing. The orderOption parameter specifies the order in which records will be read from the table and should be one of the following constants:

OrderCollected - Records will be processed in the order in which they were collected by the datalogger. This will generally correspond with the order in which records were logged unless the data was collected from a station using one-way data or data advise.

OrderLoggedWithHoles - Records will be processed in the order that they were logged by the datalogger based upon the datalogger assigned record number. If the LoggerNet server anticipates that it will collect a gap in the record numbers (a hole), no records will be processed until the hole is collected or determined by the LoggerNet server to be uncollectible.

OrderLoggedWithoutHoles - Records will be processed in the order that they were logged by the datalogger based upon the datalogger assigned record number.  If a range of records is missing and newer records have been collected, the missing records will be skipped.

OrderRealTime - Only the newest of any record in a set of records collected from the datalogger will be collected.

NOTE: For all data sources except LoggerNet server data sources, there will be little or no difference in the behavior of OrderCollected, OrderLoggedWithHoles, or OrderLoggedWithoutHoles.

StartAtRecord behaves the same with any type of data source (LoggerNet server, database, data file, or http datalogger). However, the fileMarkNo parameter is ignored for all but LoggerNet server data sources. Note that because a virtual data source and the Public table in a server data source each have only one record, a start option function will have no effect in these cases.

Examples

The following example will force the expression to start processing at the oldest record:

StartAtRecord(0, 0, OrderCollected); "Server:CR1000.one_sec.temp_degf"

The following example will force the expression to start processing at record number 3 with the latest file mark.

StartAtRecord (&HFFFFFFFF, 3, OrderCollected); "Server:CR1000.one_sec.temp"