Campbell Scientific CR6 CR6 Measurement and Control System - Page 148
DataInterval, Read More, Status, CardOut, TableFile, OneMin, DataRecordSize, NextScan, SkippedRecord
![]() |
View all Campbell Scientific CR6 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 148 highlights
Section 7. Installation Note While other characters may pass the precompiler and compiler, runtime errors may occur if these naming rules are not adhered to. • TrigVar - Controls whether or not data records are written to storage. Data records are written to storage if TrigVar is true and if other conditions, such as DataInterval(), are met. Default setting is -1 (True). TrigVar may be a variable, expression, or constant. TrigVar does not control intermediate processing. Intermediate processing is controlled by the disable variable, DisableVar, which is a parameter in all output processing instructions (see section, Output Processing Instructions (p. 150) ). Read More Section, TrigVar and DisableVar - Controlling Data Output and Output Processing (p. 195) discusses the use of TrigVar and DisableVar in special applications. • 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 allocated automatically at the time the program compiles. Automatic allocation is preferred in most applications since the CR6 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 memory card. Writing data to a card requires additional memory be allocated as a data copy buffer. The CR6 automatically determines the size the buffer needs to be and increases the data table memory allocation to accommodate the need (see Memory Cards and Record Numbers (p. 457) ). CRBasic example Definition and Use of a Data Table (p. 146) 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 CR6 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 CR6 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 148
![](/manual_guide/products/campbell-scientific-cr6-cr6-measurement-control-a476969/148.png)