A-1
Appendix A. Example Program
The following program measures the SR11 every 10 seconds and converts the
mV output to W m
–2
and MJ m
–2
. A sensor calibration of 15.02 µV per W m
–2
is used for the example programs. Both programs output an hourly average flux
(W m
–2
), and a daily total flux density (MJ m
–2
).
CRBasic Example A-1. CR1000 Program Measuring the SR11
'CR1000
'Declare Variables and Units
Public
Solar_Wm2
Public
Solar_MJ
Units
Solar_Wm2=W/m²
Units
Solar_MJ=MJ/m²
'Hourly Data Table
DataTable
(Table1,True,-1)
DataInterval
(0,60,Min,10)
Average
(1,Solar_Wm2,IEEE4,False)
EndTable
'Daily Data Table
DataTable
(Table2,True,-1)
DataInterval
(0,1440,Min,10)
Totalize
(1,Solar_MJ,IEEE4,False)
EndTable
'Main Program
BeginProg
Scan
(10,Sec,1,0)
'SR11 Pyranometer measurement in Wm-2:
'The Multiplier (M) for this example is based upon a sensor calibration (c) of
'15.02 µV/Wm-2, and will be different for each sensor.
'Multiplier (M) = 1000/c = 66.577896.
VoltDiff
(Solar_Wm2,1,mV25,1,True,0,_60Hz,66.577896,0)
'use the 50 mV range
'for the CR3000, CR5000
'and CR9000
'Calculate units in MJ, where MJ = m * t * 0.000001. m = Solar_Wm2 from above,
'and t = 10 (scan interval)
Solar_MJ=Solar_Wm2*0.00001
'Call Data Tables and Store Data
CallTable
(Table1)
CallTable
(Table2)
NextScan
EndProg