Campbell Scientific CR9000X Measurement and Control System User Manual

Page 149

Advertising
background image

Section 4. CRBasic – Native Language Programming

tables can be created by the program. The data tables may store individual
measurements, individual calculated values, or summary data such as averages,
maxima, or minima to data tables.

Each data table has overhead information, referred to as "Table Definitions",
that becomes part of the ASCII file header when data are downloaded to a PC.
Overhead information includes:

• table format
• datalogger type, serial number, and operating system version,
• name and signature of the CRBASIC program running in the datalogger
• name of the data table (limited to 8 characters)
• alphanumeric field names to attach at the head of data columns
• user defined units for the output fields
• output processing information (max, min, sample, etc.)

See Section 2.4 Data Format on Computer for more information.

Data storage follows a fixed structure in the CR9000X in order to optimize the
time and space required. Data are stored in tables such as shown in Table
4.2.8-1.

Table 4.2.8-1 Data Table Example

TOA5

StnName CR9000X

Serial#

OSVersion ProgName ProgSignature Table1

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 stored and their sequence.
The CR9000X 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 an underscore and three letter mnemonic (_avg, _smp, _std) for
the processing instruction that output the data. Alternatively, the FieldNames
instruction can be used to override the default names.

See Section 4.3 Program Access to Data Tables for a list of 3 letter
mnemonics.

The data table header also has a row that lists units for the output values. The
units must be declared for the CR9000X to fill this row out (e.g., Units
RefTemp = DegC). The units are optional and are strictly for the user's
documentation; the CR9000X makes no checks on their accuracy.

The table depicted in Table 4.2.8-1 is the result of the data table construct
shown in Example 4.2.8-1.

EXAMPLE 4.2.8-1: CRBasic Code: Data Table

DataTable (Table1,1,2000)

DataInterval(0,10,msec,10)

Average(1,RefTemp,fp2,0)

Average(6,TC(1),fp2,0)

EndTable

4-21

Advertising