![Campbell SR50AT Instruction Manual Download Page 43](http://html1.mh-extra.com/html/campbell/sr50at/sr50at_instruction-manual_488987043.webp)
Appendix B. Example Programs
B-9
TABLE B-4. SC110 Wiring for
CR1000 RS-232 Example Program
Wire Colo
u
r SC110 Wire Description
CR1000 Wire Channels
Brown
RX
C1
White
TX
C2
Yellow
Ground
G
Shield
Shield/Earth ground
⏚
Wire tie back all unused SC110 wires so they don’t short against
any metal.
TABLE B-5. SR50AT (Configured for MD485) Wiring to MD485
(9-pin connector plugged into MD485 RS-232 port)
Wire Colo
u
r
Wire Description
MD485 Wire Channel
(except where indicated)
Red
Power source
CR1000
12V
Green
A
Any ‘
A
’ terminal
White
B
Any ‘
B
’ terminal
Black
Ground
⏚
Shield
Shield/Earth ground
CR1000
G
CRBasic Example B-4. CR1000 Programming Example Using an MD485 and SC110 9-pin
Male Connector
'CR1000 Series Datalogger
'Program: SR50AT_RS485_MD485_PORT_C1-C2.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.'
'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 Constants
NOTE