Appendix B. Example Programs
B-4
B.4 CR1000 Analog Program
Although this is a CR1000 program, other CRBasic dataloggers are
programmed similarly.
CRBasic Example B-4. CR1000 Analog Program
'CR1000 Series Datalogger
'OBS501_analog_O&M.CR1 for the CR1000
'wiring: Green to 1H; Brown to 1L; Red to SW12; Black to Grnd; Blue to C1; and White to C2
'Declare Public Variables
Public
PTemp, batt_volt
Public
Results (2)
Alias
Results(1)=obs
Alias
Results(2)=ss
Units
obs=NTU
Units
ss=NTU
DataTable
(OBS501_analog,1,-1)
DataInterval
(0,3,min,10)
Minimum
(1,batt_volt,FP2,0,False)
Sample
(1,PTemp,FP2)
Sample
(1,obs,FP2)
Sample
(1,ss,FP2)
EndTable
'Main Program
BeginProg
Scan
(30,sec,3,0)
PanelTemp
(PTemp,250)
Battery
(batt_volt)
PortSet
(1 ,1 )
'blue wire -- drive high to open shutter
PortSet
(2,0)
'white wire selects obs (0) or ss (1)
Delay
(0,9500,msec)
'6 secs (shutter open) + 3.5 secs
VoltDiff
(obs,1,0,1,1,0,_60Hz,1,0)
'1 mV = 1 TU
PortSet
(2 ,1 )
'white wire to +5 volts for ss meas
Delay
(0,800,msec)
'wait until meas is done
VoltDiff
(ss,1,0,1,1,0,_60Hz,1,0)
PortSet
(1,0)
'blue wire -- drive low to close shutter
CallTable
(OBS501_analog)
NextScan
EndProg