Campbell Scientific CR1000 Measurement and Control System User Manual

Page 129

Advertising
background image

Section 7. Installation

129

 

Size

-Table size is the number of records to store in a table before new data

begins overwriting old data. If "10" is entered, 10 records are stored in the
table -- the eleventh record will overwrite the first record. If "-1" is entered,
memory for the table is automatically allocated at the time the program
compiles. Auto allocation is preferred in most applications since the CR1000
sizes all tables such that they fill (and begin overwriting the oldest data) at
about the same time. Approximately 2 kB of extra data-table space are
allocated to minimize the possibility of new data overwriting the oldest data
in ring memory when support software collects the oldest data at the same
time new data are written. These extra records are not reported in the Status
table and are not reported to the support software and so are not collected.

Rules on table size change if a CardOut() instruction or TableFile() 
instruction with 

Option 64

 are included in the table declaration.  These 

instructions support writing of data to a CF card.  Writing data to a CF 
card requires additional memory be allocated as a data copy buffer.  
The CR1000 automatically determines the size the buffer needs to be 
and increases the data table memory allocation to accommodate the 
need (see CF Cards and Records Number

 (p. 414

). 

CRBasic example Definition and Use of a Data Table

(p. 127)

creates a data table

named OneMin, stores data once a minute as defined by DataInterval(), and
retains the most recent records in SRAM, up to the automatically allocated
memory limit. DataRecordSize entries in the Status table report allocated
memory in terms of number of records the tables hold.

DataInterval() Instruction

DataInterval() instructs the CR1000 to both write data records at the specified
interval and to recognize when a record has been skipped. The interval is
independent of the Scan() / NextScan interval; however, it must be a multiple of
the Scan() / NextScan interval.

Sometimes, usually because of a timing issue, program logic prevents a record
from being written. If a record is not written, the CR1000 recognizes the omission
as a "lapse" and increments the SkippedRecord counter in the Status table.
Lapses waste significant memory in the data table and may cause the data table to
fill sooner than expected. DataInterval() instruction parameter

Lapses

controls

the CR1000 response to a lapse. The table DataInterval () Lapse Parameter
Options

(p. 130)

lists

Lapses

parameter options and associated functions.

Note Program logic that results in lapses includes scan intervals inadequate to the
length of the program (skipped scans), the use of DataInterval() in event-driven
data tables, logic that directs program execution around the CallTable()
instruction.

A data table consists of successive 1-kB data frames. Each data frame contains a
time stamp, frame number, and one or more records. By default, a time stamp and
record number are not stored with each record. Rather, the data extraction
software uses the frame time stamp and frame number to time stamp and number
each record when it is stored to computer memory. This technique saves
telecommunications bandwidth and 16 bytes of CR1000 memory per record.
However, when a record is skipped, or several records are skipped contiguously, a

Advertising