Creating data tables in a program

Data is stored in tables as directed by the ClosedCRBasic Campbell Scientific's BASIC-like programming language that supports analog and digital measurements, data processing and analysis routines, hardware control, and many communications protocols. program. In ClosedShort Cut A CRBasic programming wizard suitable for many data logger applications. Knowledge of CRBasic is not required to use Short Cut., data tables are created in the Output steps. See Creating a Short Cut data logger program Data tables are created within the CRBasic data logger program using the DataTable()/EndTable instructions. They are placed after variable declarations and before the BeginProg instruction.

Public 'Declare Public Variables


DataTable()
   'Output Trigger Condition(s)
    'Output Processing Instructions

EndTable

 

'Main Program

BeginProg

Between DataTable() and EndTable() are instructions that define what data to store and under what conditions data is stored. A data table must be called by the CRBasic program for data processing and storage to occur. Typically, data tables are called by the CallTable() instruction once each program scan.

See the CRBasic Editor help for detailed instruction information and program examples: https://help.campbellsci.com/crbasic/cr6/ .

Use the DataTable() instruction to define the number of records, or rows, allocated to a data table. You can set a specific number of records, which is recommended for conditional tables, or allow your data logger to auto-allocate table size. With auto-allocation, the data logger balances the memory so the tables “fill up” (newest data starts to overwrite the oldest data) at about the same time. It is recommended you reserve the use of auto-allocation for data tables that store data based only on time (tables that store data based on the DataInterval() instruction). Event or conditional tables are usually set to a fixed number of records. View data table fill times for your program on the Station Status > Table Fill Times tab (see Checking station status for more information). An example of the Table Fill Times tab follows. For information on data table storage see Data memory.


(Click image to expand/collapse display)

For additional information on data logger memory, visit the Campbell Scientific blog article, How to Know when Your Datalogger Memory is Getting Full .