
Appendix F. Example CRBasic Programs
DataTable(Tabslow,1,-1) '-1 to auto-allocate all available memory.
DataInterval(0,60,sec,10) 'Averaged 60 second output data.
Average(1,E_field,ieee4,meas_error)
Sample (1,run_Avg10,ieee4)
Totalize (16,E_status,FP2,0) 'Look at Efield status array for last 60 seconds.
Average (1,leakage_cur,FP2,0)
Average(1,panel_temp,FP2,0)
Totalize (1,rain_fall,FP2,0)
WindVector (1,wind_speed,wind_dir,FP2,False,0,0,0)
Average (1,solar_rad,FP2,0)
Average(1,air_temp,FP2,0)
Average (1,RH,FP2,0)
Average (1,battery_volt,FP2,0)
Average (1,internal_RH,FP2,0)
EndTable
DataTable(Tabfast,1,-1) '-1 to auto-allocate all available memory.
Sample(1,E_field,ieee4)
Sample (1,run_Avg10,ieee4)
Sample (1,status,FP2)
Sample (1,leakage_cur,FP2)
Sample (1,rain_fall,FP2)
Sample (1,wind_speed,FP2)
Sample (1,wind_dir,FP2)
Sample (1,solar_rad,FP2)
Sample (1,air_temp,FP2)
Sample (1,RH,FP2)
Sample (1,battery_volt,FP2)
EndTable
BeginProg
E_field_int = FAST_INTERVAL 'Initialize to fast interval.
Scan(1,sec,0,0)
for k = 1 to 16 'Initialize status array.
E_status(k) = 0
next
PanelTemp (panel_temp,250)
panel_temp = panel_temp*1.8 + 32 'Convert to Fahrenheit.
Battery (battery_volt)
VoltDiff (internal_RH,1,mV2500,5,True ,0,250,0.1,0)
PulseCount (rain_fall,1,2,2,0,0.01,0) 'TE525 tipping bucket 0.01 inches per tip.
PulseCount (wind_speed,1,1 ,1,1,0.2192,0) 'Mult for 05103 Wind Monitor.
BrHalf (wind_dir,1,mV2500,4,Vx2,1,2500,False,450,250,355,0) 'Mult. for 05103 Wind Monitor.
VoltDiff (solar_rad,1,mV7_5,3,True,450,250,200,0)
SW12 (1 ) 'Apply switched 12 V power to the probe.
Delay (0,150,mSec) 'Warm up probe before measurements.
VoltSe (RH,1,mV2500,1,1,0,250,0.1,0)
VoltSe (air_temp,1,mV2500,2,1,0,250,.18,-40)
SW12 (0) 'Turn off power to the probe.
if RH > 100 and RH < 108 then
RH = 100
Endif
count = count + 1
if (count >= E_field_int) then
count = 0 'reset the count for SLOW_INTERVAL
meas_error = 0 'Initialize disable variable for Efield average in slow table.
F-2
Comentários a estes Manuais