B-1
Appendix B. Example Program
The following program measures the CMP3 every 10 s 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 program. The program outputs an hourly average flux
(W/m^2), and a daily total flux density (MJ/m
2
).
Wiring for the example is given in TABLE
TABLE B-1. Wiring for Example Program
Colo
u
r
Description
CR1000X
White
Signal (+)
1H
Black
Signal (–)
1L
Shield
Shield
⏚
1
Jumper to
⏚
with user-supplied wire.
B.1 CR1000X Example Program
CRBasic Example B-1. CR1000X Example Program
'CR1000X
'Declare Variables and Units
Public
Solar_Wm2
Public
Solar_MJ
Units
Solar_Wm2=W/m²
Units
Solar_MJ=MJ/m²
'Hourly Data Table
DataTable
(Hourly,True,-1)
DataInterval
(0,60,Min,10)
Average
(1,Solar_Wm2,FP2,False)
EndTable
'Daily Data Table
DataTable
(Daily,True,-1)
DataInterval
(0,1440,Min,10)
Totalize
(1,Solar_MJ,IEEE4,False)
EndTable
'Main Program
BeginProg
Scan
(10,Sec,1,0)
'CMP3 Pyranometer measurement in W/m^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,mV200,1,True,0,60,66.577896,0)
'use mV50 for the CR3000
'and mV34 for the CR300-series
'Set negative readings to zero: