![Campbell SR50AT Скачать руководство пользователя страница 37](http://html1.mh-extra.com/html/campbell/sr50at/sr50at_instruction-manual_488987037.webp)
Appendix B. Example Programs
B-3
SR50AT(n,1) = SR50AT_M(1)
SR50AT(n,2) = SR50AT_M(2)
SR50AT(n,3) = SR50AT_M(3)
n += 1
If
n > 11
Then
n = 1
SR50ATCtrl = False
SortSpa
(Result_SR50AT(1,1),11,SR50AT(1,1),2)
TCDT = Result_SR50AT(6,1)
Q = Result_SR50AT(6,2)
AirTempC = Result_SR50AT(6,3)
If
SR50AT_MID
Then
Inital_Dist = TCDT
SR50AT_MID = False
EndIf
Snow_Depth = Inital_Dist - TCDT
EndIf
EndIf
'Call Data Tables and Store Data
CallTable
Daily
CallTable
Hour
NextScan
EndProg
B.1.2 CR6 SDI-12 Program
CRBasic Example B-2. CR6 SDI-12 Program
'CR6
'Program: SR50AT_SDI12_FILTER.CR6
'This program contains a number of features not found in Short Cut.
'
'The initial distance value from the SR50AT head to the ground is
'measured by setting the flag SR50AT_MID to TRUE. Set this flag after
'installing the SR50AT in the field. Setting this flag will initiate
'a measurement cycle and the resulting value stored as the initial
'distance. The initial distance is used to calculate snow depth.
'The PreserveVariables instruction is used to store the initial
'distance in non-volatile memory. If power is lost at the site, the
'initial distance value will be restored.'
'A control flag is used to initiate the SR50AT measurement cycle. This
'allows for manual control in the field to check distances without
'waiting for the correct time interval to occur. It is also used by
'the datalogger to initiate an automated measurement cycle.
'
'Every measurement cycle is composed of 11 individual measurements
'that are spatially sorted to eliminate any low or high values.
'One measurement is made with each scan. This program has a 10
'second scan rate so it will take 100 seconds to do all 11 scans or
'1 minute and 40 seconds.
'Declare Variables and Units
Public
BattV :
Units
BattV = Volts
'CR1000 battery voltage
Public
PnlTmp_C :
Units
PnlTmp_C = °C
'CR1000 panel temperature
'Single measured values.
Public
SR50AT_M(3)
Alias
SR50AT_M(1) = MDT :
Units
MDT = meters
'Distance from the SR50A.
Alias
SR50AT_M(2) = MQ :
Units
MQ = unitless
'Quality number.
Alias
SR50AT_M(3) = MAir :
Units
MAir = °C
'Quality number.
'Array to hold 11 SR50AT measurements composed of a distance and
'quality number, and air temperature.
Public
SR50AT(11,3)