CRBasic Example 1: CR1000X program using the CS320 M4! command
SlrMJ
=
SlrRad_W
*
SCANRATE
*
1E-6
CallTable
Hourly
CallTable
Daily
NextScan
EndProg
CRBasic Example 2: CR6 program controlling the CS320 heater
'Program scan rate, in seconds, can be changed here and changes
'will automatically roll into the multiplier for megajoules.
'Must be defined as a constant.
Const
SCANRATE = 10
'Data logger internal measurements.
Public
BattV : Units BattV = Volts
'Battery voltage
Public
PTemp_C : Units PTemp_C = Deg C
'Data logger panel temp.
'HygroVUE10 temperature/relative humidity variables.
Public
TRHData(2)
'Dewpoint calculation variable.
Public
DewPtC : Units DewPtC = Deg C
'Dewpoint temperature
Public
SlrMJ : Units SlrMJ = MJ/m^2
'Total solar flux
Public
HtrCntrl As Boolean
'Flag controls heater state.
'CS320 heated pyranometer variables.
Public
CS320(6)
Dim
AirDewDif
'Stores air temp. & dewpoint differences
Dim
Htr
Alias
TRHData(1)
=
AirTempC : Units AirTempC = Deg C
'Air temp.
Alias
TRHData(2)
=
RH :
Units
RH
=
%
'Relative humidity
Alias
CS320(1)
=
SlrW :
Units
SlrW = W/m^2
'Solar flux density
Alias
CS320(2)
=
Raw_mV :
Units
Raw_mV = mV
Alias
CS320(3)
=
CS320_Temp :
Units
CS320_Temp = Deg C
Alias
CS320(4)
=
CS320_X :
Units
CS320_X
=
Deg
Alias
CS320(5)
=
CS320_Y :
Units
CS320_Y
=
Deg
Alias
CS320(6)
=
CS320_Z :
Units
CS320_Z
=
Deg
DataTable
(Hourly,True,-1)
DataInterval
(0,60,Min,10)
Average
(1,AirTempC,FP2,False)
Sample
(1,RH,FP2)
Average
(1,DewPtC,FP2,False)
CS320 Digital Thermopile Pyranometer
18