beautypg.com

4 groundwater pump test, Crbasic example 51. program signatures – Campbell Scientific CR800 and CR850 Measurement and Control Systems User Manual

Page 248

background image

Section 7. Installation

248 

 

 

'Main Program

BeginProg

'Begin executable section of program

Scan

(1,Sec,0,0)

'Begin main scan

PanelTemp

(PTemp,250)

Counter1 = Counter1 + 1

NextScan

'End main scan

SlowSequence

'Begin slow sequence

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

Public

Batt_Volt

Public

Counter2

'Declare Data Table

DataTable

(Test,1,-1)

'Data Table “Test” is event driven.

'The event is the scan.

Minimum

(1,batt_volt,FP2,0,False)

Sample

(1,PTemp,FP2)

Sample

(1, counter, fp2)

EndTable

Scan

(5,Sec,0,0)

'Begin 1st secondary scan

Counter2 = Counter2 + 1

Battery

(Batt_volt)

CallTable

Test

'Call Data Table Test

NextScan

'End slow sequence scan

EndProg

'End executable section of program

 

7.8.17.4 Groundwater Pump Test

CRBasic example Groundwater Pump Test

(p. 248)

demonstrates:

1. How to write multiple-interval data to the same data table.

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

3. One way to execute conditional code.

4. Use of multiple sequential scans, each with a scan count.

CRBasic Example 55. Groundwater Pump Test 

'A groundwater pump test requires that water level be measured and recorded

'according to the following schedule:

'Minutes into Test Data Interval

'----------------- -------------

' 0-10 10 seconds

' 10-30 30 seconds

' 30-100 1 minute

' 100-300 2 minute

' 300-1000 5 minute

' 1000 + 10 minute