Section 4. CRBasic – Native Language Programming
4-4
4.3.1 Data Tables
Data storage follows a fixed structure in the CR9000 in order to optimize the
time and space required. Data are stored in tables such as:
TOA4
StnName Temp
TIMESTAMP
RECORD RefTemp_Avg
TC_Avg(1) TC_Avg(2) TC_Avg(3) TC_Avg(4) TC_Avg(5) TC_Avg(6)
TS
RN
degC
degC
degC
degC
degC
degC
degC
Avg
Avg
Avg
Avg
Avg
Avg
Avg
1995-02-16
15:15:04.61
278822
31.08
24.23 25.12 26.8 24.14 24.47 23.76
1995-02-16
15:15:04.62
278823
31.07
24.23 25.13 26.82 24.15 24.45 23.8
1995-02-16
15:15:04.63
278824
31.07
24.2 25.09 26.8 24.11 24.45 23.75
1995-02-16
15:15:04.64
278825
31.07
24.21 25.1 26.77 24.13 24.39 23.76
The user's program determines the values that are output and their sequence.
The CR9000 automatically assigns names to each field in the data table. In the
above table, TIMESTAMP, RECORD, RefTemp_Avg, and TC_Avg(1) are
fieldnames. The fieldnames are a combination of the variable name (or alias if
one exists) and a three letter mnemonic for the processing instruction that
output the data. Alternatively, the FieldNames instruction can be used to
override the default names.
The data table header also has a row that lists units for the output values. The
units must be declared for the CR9000 to fill this row out (e.g., Units RefTemp
= degC). The units are strictly for the user's documentation; the CR9000
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,msec,10)
Average(1,RefTemp,fp2,0)
Average(6,TC(1),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 CR9000 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.
Содержание CR9000
Страница 6: ...CR9000 Table of Contents iv This is a blank page ...
Страница 22: ...CR9000 Overview OV 16 This is a blank page ...
Страница 26: ...Section 1 Installation 1 4 CR9000 FIGURE 1 1 3 CR9000 Battery Pack ...
Страница 72: ...Section 3 CR9000 Measurement Details 3 28 This is a blank page ...
Страница 88: ...Section 5 Program Declarations 5 6 This is a blank page ...
Страница 217: ...This is a blank page ...