2 cardflush instruction, 3 cardout instruction, 4 powerup.ini – Campbell Scientific SC115 CS I/O 2G Flash Memory Drive with USB Interface User Manual

Page 19: 5 example programs, 1 data collection mode examples, 1 standard data collection mode

Advertising
background image

SC115 CS I/O 2G Flash Memory Drive with USB Interface

TableFile() has been designed to permit the datalogger to continue program
execution while data are baled by a separate process into the table file. The up-
side is that TableFile() does not slow program execution. The down-side is
that notification is delayed that the TableFile() task is complete. This situation
is manifest as follows.

If writing a new file takes longer than the CallTable() interval (the interval of
the Scan() / NextScan construct wherein the CallTable() instruction resides),
then the LastFileName variable will not be updated. In other words, if the table
file is large, and the scan rate is short, LastFileName may not be updated.

10.2 CardFlush Instruction

If a program Scan() / NextScan Count parameter is non-zero, the latest data
may fail to write to the SC115 unless the CardFlush instruction is used. For
example, with a scan count of 600, a scan interval of 100 ms, and writing a file
with TableFile() after every 10 seconds (every 100 records), only 400–575
records may be written to the SC115 due to the program ending at the 600

th

scan prior to transferring all the records to the SC115. To transfer the
remaining data to the SC115, place the CardFlush instruction between the
NextScan and EndProg instructions. See Section 10.5.4, CardFlush Example.

10.3 CardOut Instruction

A datalogger that supports CompactFlash

®

(CF) can be programmed to

simultaneously store data to internal memory, a CF card, and an SC115. The
datalogger program needs to include a CardOut() instruction in the
DataTable() declaration. By including CardOut(), the datalogger can write
data to the SC115 that is present only on the CF card.. See Section 12.4.1,
Card and Collection Speed for more information on SC115 and CF card
interactions. See Section 10.5.5, CardOut Example.

10.4 Powerup.ini

The SC115 supports the use of a powerup.ini file, which allows the host
datalogger to be loaded with a specific program or operating system at
datalogger power-up. Consult the powerup.ini section in the datalogger
manual for more information.

10.5 Example Programs

10.5.1 Data Collection Mode Examples

10.5.1.1 Standard Data Collection Mode

'Plug – Retrieve Data Since Last Plug - Pull

'In this example, the SC115 is connected to the datalogger to retrieve the data
'written to the datalogger memory after the last connection. It only retrieves
'data that were already in datalogger memory when it was connected. To retrieve

'subsequent data, the SC115 must be disconnected then re-connected to the
'datalogger. Note that the file name incorporates the system Status.SerialNumber
‘variable, which inclusion helps avoid file overwrites.

Public PanelTempC, BattVolt

DataTable (Test,1,-1)
DataInterval

(0,60,Min,0)

TableFile

("USB:"+Status.SerialNumber+"_Filename",8,-1,0,0,Min,0,0)

13

Advertising