B-1
Appendix B.
Example Programs
The following programs measure the CS300 every 10 s and convert the millivolt
output to Wm
–2
and MJm
–2
. Both programs output an hourly average flux
(Wm
–2
), and a daily total flux density (MJm
–2
). Negative values are set to zero
before being processed. Wiring for the examples is given in Table B-1.
Table B-1. Wiring for Example Programs
Colour
Description
CR1000
CR6
Red
Signal
SE 1
U1
Black
Signal Ground
Clear
Shield
B.1 CR1000 Program
'CR1000
'Declare Variables and Units
Public
BattV
Public
PTemp_C
Public
SlrW
Public
SlrMJ
Units
BattV=Volts
Units
PTemp_C=Deg C
Units
SlrW=W/m²
Units
SlrMJ=MJ/m²
'Define Data Tables
DataTable
(Table1,True,-1)
DataInterval
(0,60,Min,10)
Average
(1,SlrW,FP2,False)
EndTable
DataTable
(Table2,True,-1)
DataInterval
(0,1440,Min,10)
Minimum
(1,BattV,FP2,False,False)
Totalize
(1,SlrMJ,IEEE4,False)
EndTable
'Main Program
BeginProg
Scan
(10,Sec,1,0)
'Default Datalogger Battery Voltage measurement 'BattV'
Battery
(BattV)
'Default Wiring Panel Temperature measurement 'PTemp_C'
PanelTemp
(PTemp_C,60)
'CS300 Pyranometer measurements 'SlrMJ' and 'SlrW'
VoltSe
(SlrW,1,mV250,1,1,0,_60Hz,1.0,0)
'Use 1000 mV range for the CR5000, CR9000
'Set negative values to zero.
If
SlrW<0
Then
SlrW=0
'Convert mV to MJ/m² for a 10 second scan rate
SlrMJ=SlrW*0.00005
'Convert mV to W/m²
SlrW=SlrW*5.0
'Call Data Tables and Store Data
CallTable
(Table1)
CallTable
(Table2)
NextScan
EndProg