2 cr10(x) example – Campbell Scientific DB1 Double Bubbler Liquid Level Sensor User Manual
Page 11
![background image](/manuals/64924/11/background.png)
DB1 Liquid Level Measurement Sensor
Case 3
PortSet(3,1)
'Open valve to atmosphere
EndSelect
Delay(0,150,MSEC)
Sum = 0
For j = 1 To 25
'Take 25 pressure readings for each tube and atmosphere
BrFull(mV, 1, mV25,4, VX1, 1, 2500, true, true, 0, _60Hz, 1, 0)
Sum
=
Sum
+
mV
Next j
Valve(i)=
Sum/25 'Average the 25 readings from upper and lower tube and atmosphere
PortSet(1,0)
'Close valve to lower tube
PortSet(2,0)
'Close Valve to upper tube
PortSet(3,0)
'Close Valve to atmosphere
Next i
Delta_mV = Valve(2) - Valve(1)
Mult
=
Delta_H/Delta_mV
Offset = (Valve(3) * Mult)
WtrLvl = Valve(2)* Mult – Offset 'units of WtrLvl are same units as Delta_H (a constant)
CallTable
Table1
NextScan
EndProg
5.2 CR10(X) Example
Input Location Usage:
LOCATION LABEL
#1:
Liquid Level
#4:
Multiplier
#5: Offset
#6: mv/V
#7: Sum
#8:
Avg. Level
#9: mV/V#1
#10:
mV/V#2
#11:
mV/V#3
#12:
Delta V
#13:
Delta h
* Table 1 Programs
01: 60
Sec. Execution Interval
1: Do (P86)
1: 2
Call Subroutine 2
2: Do (P86)
1: 42
Set high Port 2
7