beautypg.com

3 data table export instructions – Campbell Scientific CR9000X Measurement and Control System User Manual

Page 151

background image

Section 4. CRBasic – Native Language Programming

top of the Interval. Example 4.2.8-2 outputs at 10 msec time after the top of the
100 mSec interval, and the table will keep track of 10 lapses (10 lapses is a
standard value if unsure of the value to use -

See Section 6.2 Data Table Trigger Modifiers.

4.2.8.3 Data Table Export Instructions

CardOut is the most commonly used Table Export instruction. This instruction
is used to store the data to a flash memory card. The CardOut instruction has
two parameters, StopRing & Size.

EXAMPLE 4.2.8-3; CardOut
DataTable(Table1,True,2000)
DataInterval(0,100,msec,10)

'CardOut(StopRing,Size)

CardOut(0,-1)

Set StopRing to 0 for ring memory (when Table is full, oldest data will start to
be over-written), or to 1 for setting up a Table as Fill and Stop(when Table is
full, no new data will be written to Table until it is reset). The size parameter
sets the number of records to allocate memory for. Enter a -1 to set the size to
auto-allocate. If set to auto-allocate, all memory that remains after creating
fixed-sized tables will be allocated to this table. If multiple DataTables are
declared with a -1 for size, the available memory will be divided among the
tables. The datalogger attempts to allocate memory to the tables so that all
tables are filled at the same time. Enter -1000 to set the size of the table on the
card to the size of the table in the datalogger's memory.

It should be noted that the Table is created both in datalogger RAM and on the
Card when CardOut is used. The size of the Table in RAM is specified in the
DataTable instruction (2000 records in the case of Example 4.2.8-3). This is
the number of records available for collection if a memory card is not used
(card not inserted, corrupt card, full card, card with same Table name from a
different program). When a memory card is used, this sets the size of the buffer
in logger memory. If the memory card is removed (retrieving data for
example), the logger will continue to write data to this buffer at the DataTable
output rate. When a memory card is reinserted, this buffered data will be written
to the memory card.

Memory cards are hot swappable. When inserting a card into a logger with a
running program, make sure that either the card is formatted, or it is a card that
was used in the same logger with the identical program running (no changes to
program). Prior to removing a memory card, press the white "Card Control"
button and wait for the LED to turn green. The LED color code is described
below:

Dark: No card detected or formatted card present without errors
Yellow:
Either no card or corrupt card with program trying to access the card
Red:

Accessing the card

Green: Can safely remove the card

See Section 6.3 Export Data Instructions for information on Table Export
instructions.

4-23