Specifications
SR50A Sonic Ranging Sensor
'Read the Snow depth from the SR50A "M4!" command returns depth with
'quality and temperature
SDI12Recorder (SR50AReturnValues,1,0,"M4!",1.0,0)
'Call Output Tables
'Example:
CallTable Test
NextScan
EndProg
10.5 Programming Example 5
SR50A RS-232 Mode CR1000
'CR1000 Series Datalogger
'In this example, the SR50A is mounted 2.5 meters above the ground.
'The SR50A is used in RS-232 mode (internal jumpers are set).
'The CR1000 sends a serial string to the SR50A, which is in "Measure on Poll Mode",
'and then receives a serial string in return which is parsed into different values.
'Wiring: Black: Power Ground
' clear: Power Ground
' Red: +12V,
' White: C1
' Green: C2
'Declare Variables
'Declare SR50AData as a dimensioned string of maximum 50 chrs
Dim SR50AData as STRING * 50
Public ParseVals(5) as FLOAT
Alias ParseVals(1)=SerialAddress
Alias ParseVals(2)=Raw_Distance
Alias ParseVals(3)=SignalQuality
Alias ParseVals(4)=Diagnostics
Alias ParseVals(5)=Chcksum
Public Temp_Corr_Distance
Public Air_Temp
Public Snow_Depth
'Declare the initial distance of the SR50A from the ground in meters:
Const Initial_Distance=2.5
'Define Data Tables
DataTable (Table1,True,-1)
DataInterval (0,60,Min,10)
Sample (1,Snow_Depth,FP2)
EndTable
32










