Section 4. CRBasic – Native Language Programming
4-5
DataInterval(
TintoInt, Interval, Units, Lapses
)
DataInterval(0,10,msec,10)
DataInterval is an instruction that modifies the conditions under which data are
stored. The four parameters are the time into the interval, the interval on
which data are stored, the units for time, and the number of lapses or gaps in
the interval to keep track of. The example outputs at 0 time into (on) the
interval relative to real time, the interval is 10 milliseconds, and the table will
keep track of 10 lapses. The DataInterval instruction reduces the memory
required for the data table because the time of each record can be calculated
from the interval and the time of the most recent record stored. Other output
condition modifiers are: Worst Case and FillandStop.
The output processing instructions included in a data table declaration
determine the values output in the table. The table must be called by the
program in order for the output processing to take place. That is, each time a
new measurement is made, the data table is called. When the table is called,
the output processing instructions within the table process the current inputs.
If the trigger conditions for the are true, the processed values are output to the
data table. In the example, several averages are output.
Average(
Reps, Source, DataType, DisableVar
)
Average(1,RefTemp,fp2,0)
Average(6,TC(1),fp2,0)
Average is an output processing instruction that will output the average of a
variable over the output interval. The parameters are repetitions - the number
of elements in an array to calculate averages for, the Source variable or array to
average, the data format to store the result in (Table 4.3-1), and a disable
variable that allows excluding readings from the average if conditions are not
met. A reading will not be included in the average if the disable variable is not
equal to 0; the example has 0 entered for the disable variable so all readings are
included in the average.
TABLE 4.3-1 Formats for Output Data
Code Data
Format
Size
Range
Resolution
FP2
Campbell Scientific floating point
2 bytes
±
7999
13 bits (about 4 digits)
IEEE4
IEEE four byte floating point
4 bytes
1.8 E -38 to 1.7 E 38
24 bits (about 7 digits)
LONG
4 byte Signed Integer
4 bytes
-2,147,483,648 to
+2,147,483,647
1 bit (1)
4.3.2 The Scan -- Measurement Timing and Processing
Once you know what you want, the measurements and calculations have been
listed and the output tables defined, the program itself may be relatively short.
The executable program begins with BeginProg and ends with EndProg. The
measurements, processing, and calls to output tables bracketed by the Scan and
NextScan instructions determine the sequence and timing of the datalogging.
Summary of Contents for CR9000
Page 6: ...CR9000 Table of Contents iv This is a blank page ...
Page 22: ...CR9000 Overview OV 16 This is a blank page ...
Page 26: ...Section 1 Installation 1 4 CR9000 FIGURE 1 1 3 CR9000 Battery Pack ...
Page 72: ...Section 3 CR9000 Measurement Details 3 28 This is a blank page ...
Page 88: ...Section 5 Program Declarations 5 6 This is a blank page ...
Page 217: ...This is a blank page ...