![Campbell SR50AT Скачать руководство пользователя страница 39](http://html1.mh-extra.com/html/campbell/sr50at/sr50at_instruction-manual_488987039.webp)
Appendix B. Example Programs
B-5
'MDT', 'MQ', & MAir
SDI12Recorder
(SR50AT_M(),C1,"0","M3!",1,0)
'Load the array to be sorted.
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.2 RS-232 Example Programs
Detailed information using RS-232 and RS-485 is provided in Appendix
(p. D-1)
.
TABLE B-2. Wiring for CR1000 and CR6 RS-232 Example Programs
Wire Color
Sensor Wire Description
CR1000 Wire Channels
CR6 Wire Channels
Red
Power source
12V
12V
White
SR50AT RX
C1
C1
Green
SR50AT Tx
C2
C2
Black
Ground
G
G
Shield
Shield/Earth ground
⏚
⏚
B.2.1 CR1000 RS-232 Program
CRBasic Example B-3. CR1000 RS-232 Program
'CR1000 Series Datalogger
'Program: SR50AT_RS232_FILTER.CR1
'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