Appendix B. Example Programs
B-10
Wire tie back all unused SC110 wires so they don’t short against
any metal.
TABLE B-5. SR50A (Configured for MD485) Wiring to MD485
(9-pin connector plugged into MD485 RS-232 port)
Wire Color
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: SR50A_RS485_Port_C1-C2.CR1
'This program contains a number of features not found in Short Cut.
'
'The initial distance value from the SR50A head to the ground is
'measured by setting the flag SR50A_MID to TRUE. Set this flag after
'installing the SR50A 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 SR50A 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
'Default serial address of SR50A is 33. Polling command consists of
'a lower case 'p' followed by the address and a carriage return.
Const
POLL_A = "p33" &
CHR
(13)
'Declare Variables and Units
Public
BattV :
Units
BattV = Volts
'CR1000 battery voltage
Public
PnlTmp_C :
Units
PnlTmp_C = °C
'CR1000 panel temperature
Public
AirTempC :
Units
AirTempC = °C
'Air temperature
'Controls SR50A measurement. This flag can be manually controlled to
'run tests in the field or is automatically set 2 minutes before the
'hourly data storage interval. This is done so 11 measurements can
'be made and sorted before the values are stored.
Public
SR50ACtrl
As Boolean
NOTE
Содержание SR50A
Страница 2: ......
Страница 6: ......
Страница 30: ...SR50A Series Sonic Ranging Sensors 20...
Страница 32: ......
Страница 53: ...Appendix B Example Programs B 21 CallTable Daily CallTable Hour NextScan EndProg...
Страница 54: ...Appendix B Example Programs B 22...
Страница 56: ......
Страница 78: ...Appendix E Tera Term QuickStart E 10...
Страница 83: ......