![Campbell SR50AT Скачать руководство пользователя страница 42](http://html1.mh-extra.com/html/campbell/sr50at/sr50at_instruction-manual_488987042.webp)
Appendix B. Example Programs
B-8
'Calculate the temperature corrected distance.
SR50AT(n,1) = ParseValsT(2)
SR50AT(n,2) = ParseValsT(3)
SR50AT(n,3) = ParseValsT(4)
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
'Add up any errors across the day.
Call
Diag
EndIf
EndIf
'Call Data Tables and Store Data
CallTable
Hour
CallTable
Daily
'Clear diagnostic counters after Daily_Status table is stored.
If
Daily.Output(1,1)
Then
ROM_Cntr = 0
SR50AT_WtchDg_Cntr = 0
EndIf
NextScan
EndProg
B.3 RS-485 Example Programs
Detailed information using RS-232 and RS-485 is provided in Appendix
(p. D-1)
.
B.3.1 CR1000 Programming Example Using an MD485 and
SC110 9-pin Male Connector
For this example, an MD485 is used to convert the SR50AT RS-485 signals to
RS-232. A SC110 9-pin male connector cable is used to free up the RS-232
port on the datalogger.
MD485 is powered using a
#
14291 Field Power Cable.
TABLE B-3. 14291 Field Power Cable Connections
Field Power Cable Markings
CR1000 Datalogger or Directly
to 12 Vdc Power Supply
Wire Marked (+)
12V
Wire Marked (–)
G