1 datatable/endtable, 2 data table trigger modifiers – Campbell Scientific CR9000X Measurement and Control System User Manual
Page 150

Section 4. CRBasic – Native Language Programming
4.2.8.1 DataTable/EndTable
Values in variables are temporary and will be lost when the program ends or as
they are updated with new values. Data Tables are used to make a permanent
record of what values have been measured or obtained. Once these items are
stored in a table, they can then be retrieved from the datalogger to files on the
PC during data collection.
All data table descriptions begin with DataTable and end with EndTable.
Within the DataTable/EndTable construct are instructions that dictate what to
store, where to store it, and that can modify the trigger conditions under which
output occurs. The table must be called by the program, from within a
Scan/NextScan, using a CallTable instruction in order for the output processing
to take place.
The DataTable instruction has three parameters: a user specified name for the
table, a trigger condition, and the size to make the table in CR9000X RAM.
Entering a negative number for the size will auto-size the table to take as much
memory as is available.
DataTable(Name, Trigger, Size)
DataTable (Temp,1,2000)
The trigger condition may be a variable, expression, or constant. The trigger is
true if it is not equal to 0. Data are output if the trigger is true and there are no
other conditions to be met. No output occurs if the trigger is false (=0). The
example creates a table name Temp, outputs any time other conditions are met,
and retains 2000 records in RAM. It should be noted that Tables in Logger
RAM memory is volatile, once the program is stopped, or power is lost, data in
logger memory Data Tables will be irretrievable.
See Section 6.1 Data Table Declaration for information on DataTable/EndTable.
4.2.8.2 Data Table Trigger Modifiers
Trigger Modifier instructions, which modify the conditions under which data
are stored, follow the DataTable instruction. Examples of some common
Trigger Modifier instructions include DataInterval, DataEvent and FillStop.
See Section 6.2 Trigger Modifiers for information on Trigger Modifier
instructions.
DataInterval instruction has four parameters: 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.
EXAMPLE 4.2.8-2: CRBasic Code: DataInterval
DataTable(Table1,True,2000)
'DataInterval(TintoInt, Interval, Units, Lapses)
DataInterval(1,24,Hour,10)
The Interval parameter specifies how frequently the data will be stored. The
TIntoInt (time into interval) specifies an offset after the specified interval. For
example, if the Interval argument is set at 24, the TIntoInt is set to 1, and the
Units is set to Hours, data storage will occur at 1:00 AM every morning (1 hour
into a 24 hour period). If the TIntoInt is set to 0, data storage will occur at the
4-22