Campbell Scientific SR50-L CSC Ultrasonic Distance Sensor User Manual
Page 35
![background image](/manuals/416106/35/background.png)
Appendix A. Modifying the Non-Volatile Memory
A-3
4: If (X<=>F) (P89)
1: 3
X Loc [ Raw_Dist ]
2: 3
>=
3: -1000
F
4: 30
Then
Do
5: Z=X (P31)
1: 3
X Loc [ Raw_Dist ]
2: 8
Z Loc [ DEPTH ]
6: Z=X (P31)
1: 4
X Loc [ Raw_Qual ]
2: 9
Z Loc [ QUALITY ]
7: Z=F x 10^n (P30)
1: 0.0
F
2: 00
n, Exponent of 10
3: 5
Z Loc [ FAILCOUNT ]
8: Else (P94)
; If the measurement was not valid, increment the failure counter.
9: Z=Z+1 (P32)
1: 5
Z Loc [ FAILCOUNT ]
; If the failure counter is equal to or larger than a pre-determined number (in this case ; 3),
; allow the -99999 to appear in the data to indicate that there is a problem with the
; measurement. The pre-determined number will depend on the scan rate, and
; should
; indicate the maximum expected -99999 readings prior to a valid measurement being
; returned. The number should be 3 for scan rate greater than three seconds, and
; larger for faster execution rates.
10: If (X<=>F) (P89)
1: 5
X Loc [ FAILCOUNT ]
2:
3
>=
3:
3
F
4:
30
Then
Do
11: Z=X (P31)
1: 3
X Loc [ Raw_Dist ]
2: 8
Z Loc [ DEPTH ]
12: Z=X (P31)
1: 4
X Loc [ Raw_Qual ]
2: 9
Z Loc [ QUALITY ]
13: Z=F x 10^n (P30)
1: 0.0
F
2: 00
n, Exponent of 10
3: 5
Z Loc [ FAILCOUNT ]