
Appendix A. CRBasic Program for Version 18
'Subtracts electronics offset and convert to grams assuming 9.81 m/s2
acceleration due to gravity.
LC_gr=(LC_mV_Avg-Lc_mV_Ofst)*mVtoGram
'Calibrate the raingage with calibration weights in the gauge. This displays
as Step 2:
If TriggerCalibration = "3289.0" OR TriggerCalibration = "4111.0" OR
TriggerCalibration = "6578.0" OR TriggerCalibration = "7400.0" OR TriggerCalibration
= "8222.0" Then
CalibrateNow = TRUE 'enable calibration process
CalWeight_gr = TriggerCalibration '
TriggerCalibration = "In Progress"
Cal_Result = "In Progress"
CalibrationTimer = Timer(CalTim,Sec,2) 'reset and start calibration timer
PostCalTimer = Timer(PostCalTim,Sec,3) 'stop and reset post calibration timer
EndIf
CalibrationTimer = Timer(CalTim,Sec,4) 'read calibration timer
PostCalTimer = Timer(PostCalTim,Sec,4) 'read postcalibration timer
If TareGauge = "Complete" AND CalibrateNow AND CalibrationTimer<CalTime Then
'tare is completed and in the middle of the calibration process
mVtoGram = CalWeight_gr/(LC_mV_Avg-Lc_mV_Ofst) 'calculate mVtoGram multiplier
ElseIf TareGauge <> "Complete" AND CalibrateNow Then
'tare has NOT been completed and calibration process has been started
CalibrateNow = FALSE 'stop calibration process
Cal_Result = "Cal Failed" 'flagged as failed because we didn't tare first
CallTable CalData 'record the event
TareGauge = "Repeat Step 1" 'prompt user to tare
TriggerCalibration = "Repeat Step 1" 'prompt user to tare
RecordAccumulation = TRUE 'enable recording of accumulation
CalibrationTimer = Timer(CalTim,Sec,3) 'stop and reset calibration timer
ElseIf CalibrationTimer>=CalTime AND RecordCalibration = FALSE Then
'calibration is complete and calibration recording is not flagged
CalibrateNow = FALSE 'disable calibration process
Cal_Result = "Cal Succeeded" 'note success
CallTable CalData 'save calibration data
TareGauge = "Complete" 'note completion
TriggerCalibration = "Complete" 'note completion
RecordAccumulation = TRUE 'enable recording of accumulation
RecordCalibration = TRUE 'record calibration information
CalibrationTimer = Timer(CalTim,Sec,3) 'stop and reset calibration timer
PostCalTimer = Timer(PostCalTim,Sec,2) 'reset and start post calibration timer
TimeStampOfLastCal = CalData.TimeStamp(1,1) 'note time of last calibration record saved
ElseIf PostCalTimer>=60 Then
'post calibration period is done
'it seems that this post cal period is simple used for refreshing keyboard
interface - note completion, then note ready
RecordCalibration = FALSE 'enable calibration recording
TareGauge = "Ready" 'notify ready state
TriggerCalibration = "Tare First" 'notify ready state
PostCalTimer = Timer(PostCalTim,Sec,3) 'stop and reset post cal timer
EndIf
'Convert weight to depth.
PrecipF_in=0.001214*LC_gr
Precip_in = Round (PrecipF_in,2) 'round to nearest 1/100 of inch for storage
A-5
Komentarze do niniejszej Instrukcji