04.01.2015 Views

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Section 7. Installation<br />

'Main Program<br />

BeginProg<br />

Scan(1,Sec,0,0)<br />

PanelTemp(PTemp,250)<br />

Counter1 = Counter1 + 1<br />

NextScan<br />

'Begin executable section of program<br />

'Begin main scan<br />

'End main scan<br />

SlowSequence<br />

'Begin slow sequence<br />

'Declare Public Variables for Secondary Scan (can be declared at head of program)<br />

Public Batt_Volt<br />

Public Counter2<br />

'Declare Data Table<br />

DataTable(Test,1,-1)<br />

Minimum(1,batt_volt,FP2,0,False)<br />

Sample(1,PTemp,FP2)<br />

Sample(1, counter, fp2)<br />

EndTable<br />

Scan(5,Sec,0,0)<br />

Counter2 = Counter2 + 1<br />

Battery(Batt_volt)<br />

CallTable Test<br />

NextScan<br />

EndProg<br />

'Data Table “Test” is event driven.<br />

'The event is the scan.<br />

'Begin 1st secondary scan<br />

'Call Data Table Test<br />

'End slow sequence scan<br />

'End executable section of program<br />

7.8.17.4 Groundwater Pump Test<br />

CRBasic example Groundwater Pump Test (p. 247) demonstrates:<br />

1. How to write multiple-interval data to the same data table.<br />

2. Use of program-control instructions outside the Scan() / NextScan structure.<br />

3. One way to execute conditional code.<br />

4. Use of multiple sequential scans, each with a scan count.<br />

CRBasic Example 55.<br />

Groundwater Pump Test<br />

'A groundwater pump test requires that water level be measured and recorded<br />

'according to the following schedule:<br />

'Minutes into Test Data Interval<br />

'----------------- -------------<br />

' 0-10 10 seconds<br />

' 10-30 30 seconds<br />

' 30-100 1 minute<br />

' 100-300 2 minute<br />

' 300-1000 5 minute<br />

' 1000 +<br />

10 minute<br />

247

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!