beautypg.com

Measuring cs625 output using cr200(x) periodavg, Instruction – Campbell Scientific CS616 and CS625 Water Content Reflectometers User Manual

Page 16

background image

CS616 and CS625 Water Content Reflectometers

'Main Program
BeginProg
Scan (5,Sec,0,0)

'scan instructions every 5 sec

Battery (Batt_volt)
PanelTemp (Panel_temp,250)
'
'Set flag 1 High every 30 min (Note: User can manually set flag 1 high/low)
If IfTime (0,30,min) Then flag (1) = high '+++++++++++++++++++++++++++
If Flag (1) = high Then
'measure 48ea CS616 probes on AM16/32 in (4x16) mode
PortSet (4,1)

'Set Mux Reset line High

'
I=1

'Set sub scan loop counter

SubScan (0,mSec,16)
PulsePort (5,10000)

'Clock Mux

CS616 (Period(I),3,1,6,3,1.0,0) 'Measure 3ea CS616 probes
I=I+3
NextSubScan
'
For I=1 to 48

'convert CS616 period to Volumetric Water Content

VWC(I)=a0 + al*Period(I) + a2*Period(I)^2
Next
'
PortSet (4,0)

'Set Mux Reset line Low

flag (1) = low
'
EndIf

'+++++++++++++++++++++++++++++++

'
CallTable Dat30min

'Call Output Tables

NextScan
EndProg

6.4.2 Measuring CS625 Output Using CR200(X) PeriodAvg Instruction

The

PeriodAvg() instruction is used to measure the period (in microseconds)

or the frequency (in kHz) of a signal on a single-ended channel. This

instruction can be used to measure the CS625 Water Content Reflectometer.

PeriodAvg(Dest, SEChan, Option, Cycles, Timeout, Port, Mult, Offset)

Dest

: The Dest parameter is a variable in which to store the results of the

measurement.

SEChan

: The SEChan argument is the number of the single-ended channel on

which to make the measurement. Valid options are analog channels 1 through

4. The green wire is connected to this channel number.

Option

: The Option parameter specifies whether to output the frequency or the

period of the signal.

Code

Description

0

Period of the signal is returned (msec)

1

Frequency of the signal is returned (Hz)

Code 0 is typically used with the CS625 with a multiplier (see below) of 1.

Cycles

: The Cycles parameter specifies the number of cycles to average each

scan.

10