a measurement is taken depends on several factors.
The time stamp in common CRBasic programs matches the time at the beginning of the current
scan as measured by the real-time datalogger 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.
9.3.3 Avoiding time skew
Time skew between consecutive measurements is a function of settling and integration times,
ADC, and the number entered into the
Reps
parameter of CRBasic instructions.
Time-stamp skew is not a problem with most applications because:
l
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.
l
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:
l
Making measurements in the scan before time-consuming code.
l
Programming the datalogger such that the time stamp reflects the system time rather than
the scan time using the
DataTime()
instruction. See topics concerning data table
declarations in CRBasic Editor help for more information.
9.4 CRBasic program errors
Analyze data soon after deployment to ensure the datalogger is measuring and storing data as
intended. Most measurement and data-storage problems are a result of one or more CRBasic
program bugs. Watch a video:
CRBasic | Common Errors - Identifying and fixing common errors
in the CRBasic programming language
9. Tips and troubleshooting
117
Содержание CR1000X
Страница 1: ...Revision 02 21 2019 Copyright 2000 2019 Campbell Scientific ...
Страница 2: ......
Страница 4: ......
Страница 6: ......
Страница 8: ......
Страница 16: ...Appendix A Glossary 176 Appendix B Index 214 Table of Contents viii ...
Страница 20: ...l Smart sensors o SDI 12 o RS 232 o Modbus o DNP3 o TCP IP o RS 485 1 Data acquisition system components 4 ...
Страница 192: ......
Страница 237: ...wiring panel 5 Appendix B Index 220 ...