Specifications

SR50A Sonic Ranging Sensor
;Store the Signal quality value
8: Sample (P70)^23223
1: 1 Reps
2: 4 Loc [ Sig_Qual ]
;Store the Temperature reading from the SR50AT
9: Sample (P70)^1224
1: 1 Reps
2: 5 Loc [ SR50AT_T ]
*Table 2 Program
02: 0.0000 Execution Interval (seconds)
*Table 3 Subroutines
End Program
10.3 Programming Example 3
SR50A SDI-12 “M1!” CR1000 Datalogger
'CR1000 Series Datalogger
'In this example, the SR50A is mounted 2.5 meters above the ground.
'The CR1000 sends an 'SDI12 command to the SR50A,
'which outputs a raw distance value and a signal quality.
'Declare Public Variables:
Public SR50(2)
Alias SR50(1)=Raw_Dist
Alias SR50(2)=SignalQuality
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
'Main Program:
BeginProg
Scan (60,Sec,0,0)
'Measure the SR50A:
'Use SDI12 command "M1!" to receive Distance
'and Signal quality from the SR50AT
SDI12Recorder (SR50(),1,0,"M1!",1,0)
29