![Campbell NR01 Instruction Manual Download Page 36](http://html1.mh-extra.com/html/campbell/nr01/nr01_instruction-manual_3900752036.webp)
Appendix A. Example Programs
A-8
Units panel_temp = C
Units batt_volt = V
Units t_hmp = C
Units rh_hmp = percent
Units e_hmp = kPa
Units nr01 = W/m^2
Units albedo = unitless
Units t_nr01 = K
'Net radiometer heater control variables.
Public set_point_temperature
Public duty_cycle
'Working Variables
Dim scratch_out(3)
Alias scratch_out(1) = t_hmp_mean
Alias scratch_out(2) = e_hmp_mean
Alias scratch_out(3) = e_sat_hmp_mean
Dim rh_hmp_mean
'Mean HMP45C relative humidity.
Dim t_dew_hmp_mean
'Mean dew point temperature.
Dim e_sat_hmp
'HMP45C saturation vapor pressure.
Units t_hmp_mean = C
Units e_hmp_mean = kPa
Units e_sat_hmp_mean = kPa
Units rh_hmp_mean = percent
Units t_dew_hmp_mean = C
DataTable (stats,TRUE,-1)
DataInterval (0,5,Min,10)
Sample (1,t_hmp_mean,IEEE4)
Sample (1,e_hmp_mean,IEEE4)
Sample (1,rh_hmp_mean,IEEE4)
Sample (1,t_dew_hmp_mean,IEEE4)
Sample (1,duty_cycle,IEEE4)
Average (9,Rn,IEEE4,FALSE)
EndTable
DataTable (scratch,TRUE,1)
TableHide
DataInterval (0,5,Min,10)
Average (1,t_hmp,IEEE4,FALSE)
Average (1,e_hmp,IEEE4,FALSE)
Average (1,e_sat_hmp,IEEE4,FALSE)
EndTable
BeginProg
Scan (1,Sec,0,0)
'Control the net radiometer heater.
PWM (duty_cycle,4,250,mSec)
'Datalogger panel temperature.
PanelTemp (panel_temp,250)
'Measure battery voltage.
Battery (batt_volt)
'Measure the HMP45C temperature and relative humidity.
VoltDiff (t_hmp,1,mV1000C,5,TRUE,200,250,0.1,-40)
VoltDiff (rh_hmp,1,mV1000C,6,TRUE,200,250,0.1,0)
'Measure NR 01 Net Radiometer.
Resistance (t_nr01,1,mV200,10,Ix1,1,1675,TRUE,TRUE,200,250,1,0)
VoltDiff (Rs_downwell,1,mV20C,11,TRUE,200,250,NR01_SHORT_DW_CAL,0)
VoltDiff (Rs_upwell,1,mV20C,12,TRUE,200,250,NR01_SHORT_UW_CAL,0)
VoltDiff (Rl_down_meas,1,mV20C,13,TRUE,200,250,NR01_LONG_DW_CAL,0)
VoltDiff (Rl_up_meas,1,mV20C,14,TRUE,200,250,NR01_LONG_UW_CAL,0)