04.01.2015 Views

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Section 8. Operation<br />

8.1 Measurements<br />

Several features give the <strong>CR1000</strong> the flexibility to measure many sensor types.<br />

Contact a <strong>Campbell</strong> <strong>Scientific</strong> applications engineer if assistance is required in<br />

assessing <strong>CR1000</strong> compatibility to a specific application or sensor type. Some<br />

sensors require precision excitation or a source of power. See Powering Sensors<br />

and Devices (p. 84).<br />

8.1.1 Time<br />

8.1.1.1 Time Stamps<br />

Measurement of time is an essential function of the <strong>CR1000</strong>. Time measurement<br />

with the on-board clock enables the <strong>CR1000</strong> to attach time stamps to data,<br />

measure the interval between events, and time the initiation of control functions.<br />

A measurement without an accurate time reference has little meaning. Data on<br />

the <strong>CR1000</strong> are stored with time stamps. How closely a time stamp corresponds<br />

to the actual time a measurement is taken depends on several factors.<br />

The time stamp in common CRBasic programs matches the time at the beginning<br />

of the current scan as measured by the real-time clock in the <strong>CR1000</strong>. If a scan<br />

starts at 15:00:00, data output during that scan will have a time stamp of 15:00:00<br />

regardless of the length of the scan or when in the scan a measurement is made.<br />

The possibility exists that a scan will run for some time before a measurement is<br />

made. For instance, a scan may start at 15:00:00, execute time-consuming code,<br />

then make a measurement at 15:00:00.51. The time stamp attached to the<br />

measurement, if the CallTable() instruction is called from within the Scan() /<br />

NextScan construct, will be 15:00:00, resulting in a time-stamp skew of 510 ms.<br />

Time-stamp skew is not a problem with most applications because,<br />

• program execution times are usually short, so time stamp skew is only a few<br />

milliseconds. Most measurement requirements allow for a few milliseconds<br />

of skew.<br />

• data processed into averages, maxima, minima, and so forth are composites<br />

of several measurements. Associated time stamps only reflect the time the<br />

last measurement was made and processing calculations were completed, so<br />

the significance of the exact time a specific sample was measured diminishes.<br />

Applications measuring and storing sample data wherein exact time stamps are<br />

required can be adversely affected by time-stamp skew. Skew can be avoided by<br />

• Making measurements in the scan before time-consuming code.<br />

• Programming the <strong>CR1000</strong> such that the time stamp reflects the system time<br />

rather than the scan time. When CallTable() is executed from within the<br />

Scan() / NextScan construct, as is normally done, the time stamp reflects<br />

scan time. By executing the CallTable() instruction outside the Scan() /<br />

NextScan construct, the time stamp will reflect system time instead of scan<br />

time. CRBasic example Time Stamping with System Time (p. 274) shows the<br />

273

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!