beautypg.com

Fillstop – Campbell Scientific CR9000X Measurement and Control System User Manual

Page 192

background image

Section 6. Data Table Declarations and Output Processing Instructions

DataEvent Example:
The start trigger for the event is when TCTemp(1) > 30 degrees C. The stop trigger is when
TCTemp(1) < 29 degrees C. The event has 20 pre-trigger records and 10 post-trigger records.

Const RevDiff 1

‘Reverse input to cancel offsets

Const Del 0

'Use default delay

Const Integ 0

'Use default integration

Public RefTemp

'Declare the variable used for reference temperature

Public TC(5)

'Declare the variable used for thermocouple measurements

Units RefTemp=degC
Units TC=degC
DataTable (Event,1,1000)

DataInterval(0,00,msec,10)

'Set the sample interval equal to the scan

DATAEVENT

(20,TC(1)>30,TC(1)<29,10)

'20 records before TC(1)>30, and

‘after TC(1)<29 store 10 more records

Sample(1,RefTemp,IEEE4)

'Sample the reference temperature

Sample(5,TC,IEEE4)

'Sample the 5 thermocouple temperatures

EndTable
BeginProg

Scan(500,mSec,0,0)

ModuleTemp(RefTemp,1,5,30)

TCDiff(TC(),5,mV50C,5,9,TypeT,RefTemp,RevDiff,Del,Integ,1,0)

CallTable Event

NextScan

EndProg

FillStop

DataTables are by default ring memory where, once full, new data are written
over the oldest data. Entering FillStop into a data table declaration sets the
CPU memory for the Datatable as fill and stop. Once the DataTable is filled,
no more data are stored until the DataTable has been reset. The DataTable
can be reset from within the program by executing the ResetTable instruction.
Tables can also be reset from RTDAQ's Status Table window
(Datalogger/Status Table).

See the CardOut instruction for instructions on setting memory allocated for
DataTables on a PC card as Fill and Stop.

If either the CPU (FillStop instruction) or the Card is set to "fill
and stop", when either media is filled, the writing to the Table in
both will be stopped. Data storage will not resume until the
DataTable has been reset, either under program control using the
CardFlush instruction, or through the Status window in one of
CSI's software packages.

NOTE

FillStop Example:
DataTable (Temp,1,2000)

DataInterval(0,10,msec,10)

FILLSTOP

' the table will stop collecting data after 2000 records.

Average(1,RefTemp,fp2,0)
Average(6,TC(1),fp2,0)
EndTable

6-8