Campbell cs215 Instruction Manual - page 21
CS215 Temperature and Relative Humidity Probe
7.4.3.3 CR3000 Program for Measuring One Sensor Every 10 Seconds
'CR3000
'Example program showing measurement of a single CS215 sensor every 10 seconds
'Declare Variables and Units we are going to use.
Public TRHData(2)
Alias TRHData(1)=AirTC
Alias TRHData(2)=RH
Units AirTC=Deg C
Units RH=%
'Define Data Tables to store data.
DataTable(Table1,True,-1)
DataInterval(0,60,Min,10)'As an example store the data every 60 minutes.
Average(1,AirTC,FP2,False)
Sample(1,RH,FP2)
EndTable
'Main Program
BeginProg
Scan(10,Sec,1,0) 'Scan every 10 seconds
'CS215 Temperature & Relative Humidity Sensor (CSL) measurements AirTC and RH:
SDI12Recorder(AirTC,7,"0","M!",1,0)
'Call Data Tables and Store Data
CallTable(Table1)
NextScan
EndProg
7.4.3.4 CR5000 Program for Measuring One Sensor Every 30 Seconds
'CR5000 Series Datalogger
'Example program showing measurement of a single CS215 sensor every 30 sec
'in the slow sequence
'Declare the variables we are going to use
Public Batt_Volt, PTemp, CS215meas(2) 'An array suitable to reading the SDI12 data
into
Alias CS215meas(1) = Temperature
Alias CS215meas(2) = RH
'Main Program - in this example it is running fast just measuring the
'battery voltage and panel temperature
BeginProg
Scan (50,mSec,0,0) 'Scan every 50 milliseconds
PanelTemp (PTemp,250)
Battery (Batt_volt)
NextScan
SlowSequence
'Define Data Table to hold the stored data for the CS215
DataTable (CS215dat,1,-1)
DataInterval (0,15,min,1) 'As an example store the average every 15 mins
Average (1,Temperature,IEEE4,False)
Average (1,RH,IEEE4,False)
EndTable
Scan (30,sec,0,0)
SDI12Recorder (CS215meas(),1,0M!,1.0,0) 'Read the values into the array
'NOTE: we had to use a control port for SDI-12 as this is in the slow sequence
CallTable CS215dat 'Call the table instruction to calculate and store the Avs
NextScan
EndProg
15