Appendix b. example programs, B.1 crbasic programs, B.1.1 example cr200(x) program – Campbell Scientific CS215 Temperature and Relative Humidity Probe User Manual

Page 31: B.1.1, Appendix b

Advertising
background image

Appendix B. Example Programs

B.1 CRBasic Programs

B.1.1 Example CR200(X) Program

This example program shows the measurement of a single CS215 and can be

used directly with CR200(X) series dataloggers.

'CR200(X) Series Datalogger
'Program measures one CS215 sensor every 30 seconds and stores the average
'temperature and a sample of relative humidity every 10 minutes.

'Wiring Diagram
'==============
'CS215

' Wire
' Color Function

CR200(X)

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

-------

' Red

Power (12V)

Battery +

' Green

SDI-12 signal

C1/SDI-12

' Black

Power ground

G

' White

Power ground

G

' Clear

Shield

AG*


'*AG = Analog Ground (represented by ground symbol on CR200 wiring panel

'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 a data table for ten-minute data

DataTable

(TenMin,True,-1)

DataInterval

(0,10,Min)

Average

(1,AirTC,False)

Sample

(1,RH)

EndTable

'Main Program

BeginProg

Scan

(30,Sec)

'Scan every 30 seconds

'CS215 Temperature & Relative Humidity Sensor measurements 'AirTC' and 'RH'

SDI12Recorder

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

'Call Data Tables and Store Data

CallTable

TenMin

NextScan

EndProg

B-1

Advertising