Timekeeping

Measurement of time is an essential data logger function. Time measurement with the onboard clock enables the data logger to run on a precise interval, attach time stamps to data, measure the interval between events, and time the initiation of control functions. Details on clock accuracy and resolution are available in the System specifications. An internal lithium battery backs the clock when the data logger is not externally powered. See Internal battery.

Clock best practices

When setting the clock with LoggerNet, initiate it manually during a maintenance period when the data logger is not actively writing to Data Tables. Click Set in the Clocks field of the LoggerNet Connect Screen.

If you are going to use automated clock check with LoggerNet (clock settings can be found on the LoggerNet Setup Standard View Clock tab). it is recommended that you do this on the order of days (not hours). Set an allowed clock deviation that is appropriate for the expected jitter in the network, and use the initial time setting to offset the clock check away from storage and measurement intervals.

The amount of time required for a Clock Check command to reach the data logger, be processed, and for it to send its response is called round-trip time, or time-of-flight. To calculate an estimate of this time-of-flight, LoggerNet maintains a history (in order) of the round-trip times for the ten previous successful clock check transactions. It adds this average to the time values received from the data logger and subtracts it from any adjustment that it might make.

GPS

When the GPS() instruction is present in the CRBasic program, the system time is synchronized to the GPS PPS signal. GPS settings are configured automatically and the GPS output streams can be monitored in the program.

For more information, refer to the CRBasic help and specifications at GPS:

Time stamps

A measurement without an accurate time reference often has little meaning. Data collected from data loggers is stored with time stamps. How closely a time stamp corresponds to the actual time a measurement is taken depends on several factors.

The time stamp in common ClosedCRBasic Campbell Scientific's BASIC-like programming language that supports analog and digital measurements, data processing and analysis routines, hardware control, and many communications protocols. programs matches the time at the beginning of the current scan as measured by the real-time data logger clock. If a scan starts at 15:00:00, data output during that scan will have a time stamp of 15:00:00 regardless of the length of the scan, or when in the scan a measurement is made. The possibility exists that a scan will run for some time before a measurement is made. For instance, a scan may start at 15:00:00, execute a time-consuming part of the program, then make a measurement at 15:00:00.51. The time stamp attached to the measurement, if the CallTable() instruction is called from within the
Scan() / NextScan construct, will be 15:00:00, resulting in a time-stamp skew of 510 ms.

Avoiding time skew

Time skew between consecutive measurements is a function of settling and integration times, ClosedADC Analog to digital conversion. The process that translates analog voltage levels to digital values., and the number entered into the Reps parameter of CRBasic instructions. A close approximation is:

time skew = reps * (settling time + integration time + ClosedADC Analog to digital conversion. The process that translates analog voltage levels to digital values. time) + instruction setup time
where ClosedADC Analog to digital conversion. The process that translates analog voltage levels to digital values. time equals 170 µs, and instruction setup time is 15 µs.
If reps (repetitions) > 1 (multiple measurements by a single instruction), no setup time is required. If reps = 1 for consecutive voltage instructions, include the setup time for each instruction.

Applications that are very sensitive to time skew should consider using measurement modules such as GRANITE SPECTRUM series. These provide dedicated sampling hardware for every channel and very tight time synchronization.

Time-stamp skew is not a problem with most applications because:

  • Program execution times are usually short; so, time-stamp skew is only a few milliseconds. Most measurement requirements allow for a few milliseconds of skew.

  • Data processed into averages, maxima, minima, and so forth are composites of several measurements. Associated time stamps only reflect the time of the scan when processing calculations were completed; so, the significance of the exact time a specific sample was measured diminishes.

Applications measuring and storing sample data wherein exact time stamps are required can be adversely affected by time-stamp skew. Skew can be avoided by: