StartAtTime

This function will attempt to start processing at the specified timestamp. If the specified timestamp cannot be located, it will start processing at the oldest record since the specified timestamp. If the specified timestamp is beyond what is available, it will start processing at the first record that is subsequently written to the data table (i.e., you will have no backfill).

Syntax

StartAtTime ( time, orderOption )

Remarks

The StartAtTime 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 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.

StartAtTime behaves the same with any type of data source (LoggerNet server, database, data file, or http datalogger). 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.

Example

The following example will attempt to start processing at a record with a timestamp one day before the current system time:

StartAtTime(SystemTime() -nsecPerDay,OrderCollected);"Server:CR1000.one_sec.temp_degf"

The following example will attempt to start processing at a record with a timestamp of 7/13/2011 13:35:00:

StartAtTime($"7/13/2011 13:35:00", OrderCollected); "Server.CR1000.one_sec.temp_degf"