CRBasic example program

This CR1000X program can be adapted for use with the CR6, CR3000, CR800-series, CR300-series, and CR1000 data loggers. For a CR200(X)-series program, see an older manual at www.campbellsci.com/old-manuals .

CR1000X program measuring the HygroVue 5

'Program measures one HygroVue 5 sensor every 10 seconds and stores the

'average temperature and a sample of relative humidity every 10 minutes.

 

'Wiring Diagram

'==============

'HygroVue 5

 

' Wire

' Color  Function       CR1000X

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

' Brown  Power (12V)    Battery +

' White  SDI-12 signal  C1/SDI-12

' Black  Power ground   G

' Clear  Shield         G

 

'Declare the variable array for the measurement

Public TRHData(2)

 

Alias TRHData(1)=AirTC

Alias TRHData(2)=RH

 

Units AirTC=Deg C

Units RH=%

 

'Define Data Tables

DataTable(TenMin,True,-1)

  DataInterval(0,10,Min,10)

  Average(1,AirTC,FP2,False)

  Sample(1,RH,FP2)

EndTable

 

'Main Program

BeginProg

  'Main Scan

  Scan(10,Sec,1,0)

    'HygroVue 5 Temperature & Relative Humidity Sensor measurements 'AirTC'

    'and 'RH'

    SDI12Recorder(TRHData(),C1,"0","M!",1,0)

    'Call Data Tables and Store Data

    CallTable(TenMin)

  NextScan

EndProg