Appendix b. example programs, B.1 cr1000 program, N appendix b – Campbell Scientific CS300 Silicon Pyranometer User Manual
Page 23

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
Color
Description
CR1000 CR10X
Red
Signal
SE 1
SE 1
Black
Signal Ground
AG
Clear
Shield
G
B.1 CR1000 Program
'CR1000
'Declare Variables and Units
Public SlrW
Public SlrMJ
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)
Totalize(1,SlrMJ,IEEE4,False)
EndTable
'Main Program
BeginProg
Scan(10,Sec,1,0)
'Measure CS300 Pyranometer
VoltSe (SlrW,1,mV250,1,1,0,_60Hz,1.0,0) use 1000 mV range for the CR5000, CR9000
For the CR1000, use the Auto Range or
'Set negative values to zero
mV 2500 range for > 1200 w/m
2
intensities.
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
B-1