Specifications
Section 4. CRBasic - Native Language Programming
4-5
The data table header also has a row that lists units for the output values. The
units must be declared for the CR3000 to fill this row out (e.g., Units RefTemp
= degC). The units are strictly for the user's documentation; the CR3000
makes no checks on their accuracy.
The above table is the result of the data table description in the example
program:
DataTable (Temp,1,2000)
DataInterval(0,10,min,10)
Average(1,RefTemp,fp2,0)
Average(6,TC(),fp2,0)
EndTable
All data table descriptions begin with DataTable and end with EndTable.
Within the description are instructions that tell what to output and that can
modify the conditions under which output occurs.
' DataTable(Name, Trigger, Size)
DataTable (Temp,1,2000)
The DataTable instruction has three parameters: a user specified name for the
table, a trigger condition, and the size to make the table in CR3000 RAM. 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.
' DataInterval(TintoInt, Interval, Units, Lapses)
DataInterval(0,10,min,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 minutes, 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: WorstCase 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 data table 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)