Appendix B. Example Programs
B-11
'Set this flag to measure and store the initial distance from the
'SR50A to the ground.
Public
SR50A_MID
As Boolean
'Declare SR50AData as a dimensioned string of maximum 50 chrs
Public
SR50AData
As String
* 50
'Values returned from the SR50A.
Public
ParseVals(5)
As Float
Alias
ParseVals(1)=SerialAddress :
Units
SerialAddress = addr
Alias
ParseVals(2)=Raw_Distance :
Units
Raw_Distance = meters
Alias
ParseVals(3)=SignalQuality :
Units
SignalQuality = value
Alias
ParseVals(4)=Diagnostics :
Units
Diagnostics = value
Alias
ParseVals(5)=Chcksum :
Units
Chcksum = value
'Array to hold 11 SR50A measurements composed of a distance and
'quality number.
Public
SR50A(11,2)
'Sorted array of 11 SR50A measurements composed of a distance and
'quality number. Measurements are sorted by the distance value from
'smallest to largest.
Public
Result_SR50A(11,2)
Public
TCDT :
Units
TCDT = meters
'Temperature corrected distance
Public
Q :
Units
Q = unitless
'Quality number
Public
Inital_Dist :
Units
Inital_Dist = meters
'Distance to ground.
Public
Snow_Depth :
Units
Snow_Depth = meters
'Snow depth.
Dim
n
'used as a counter
'SR50A diagnostic counters. Values are incremented if an error occurs.
Public
ROM_Cntr :
Units
ROM_Cntr = value
Public
SR50A_WtchDg_Cntr :
Units
SR50A_WtchDg_Cntr = value
Dim
scratch
'Define Data Tables
DataTable
(Daily,True,-1)
DataInterval
(0,1440,Min,10)
Minimum
(1,BattV,FP2,False,False)
Maximum
(1,BattV,FP2,False,False)
Minimum
(1,PnlTmp_C,FP2,False,False)
Maximum
(1,PnlTmp_C,FP2,False,False)
Sample
(1,ROM_Cntr,FP2)
Sample
(1,SR50A_WtchDg_Cntr,FP2)
EndTable
DataTable
(Hour,True,-1 )
DataInterval
(0,60,Min,10)
Sample
(1,AirTempC,FP2)
Sample
(1,TCDT,IEEE4)
Sample
(1,Q,FP2)
EndTable
PreserveVariables
'Subroutine to sum up errors from the SR50A across the day.
Sub
Diag
scratch =
INT
(Diagnostics/1000)
Select Case
scratch
Case
0
SR50A_WtchD= 1
RO= 1
Case
1
SR50A_WtchD= 1
Case
10
RO= 1
Содержание SR50A
Страница 2: ......
Страница 6: ......
Страница 30: ...SR50A Series Sonic Ranging Sensors 20...
Страница 32: ......
Страница 53: ...Appendix B Example Programs B 21 CallTable Daily CallTable Hour NextScan EndProg...
Страница 54: ...Appendix B Example Programs B 22...
Страница 56: ......
Страница 78: ...Appendix E Tera Term QuickStart E 10...
Страница 83: ......