![background image](http://html1.mh-extra.com/html/campbell/sr50at/sr50at_instruction-manual_488987049.webp)
Appendix B. Example Programs
B-15
'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.4 Heater Program Examples
The following programs are written for a SR50ATH-L configured for SDI-12.
Detailed information about the heater is provided in Appendix
(p. F-1)
TABLE B-7. Wiring for CR1000 and CR6 Heater Example Programs
SR50AT-L Configured for SDI-12 Wiring
Wire Colo
u
r
Sensor Wire Description
CR1000 Wire Channels
CR6 Wire Channels
Red
Power source
12V
12V
Green
SDI-12 I/O
C1
C1
White
Not used
G
G
Black
Ground
G
G
Shield
Shield/Earth ground
G
G
SR50ATH Heater Power Cable
Wire Colo
u
r
Heater Wire Description
CR1000 Wire Channels
CR6 Wire Channels
Black
Power source
SW-12
SW12-1
White
Power ground
G
G
Shield
Shield/Earth ground
⏚
⏚
CRBasic Example B-6. CR1000 Heater Program Example
'CR1000
'Program: SR50ATH_SDI12_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
'distance in non-volatile memory. If power is lost at the site, the
'initial distance value will be restored.'