Appendix B. Example Programs
B-5
B.5 Examples for High Sediment Loads
B.5.1 Normally Open CR1000 Example
CRBasic Example B-5. Normally Open CR1000 Example
'CR1000 Series Datalogger
'OBS501 normally open
'In normally open mode the OBS501 can make measurement multiple times per minute but the wiper interval could be set to as
'low as a time or two a day. This mode is also beneficial where the power budget is critical since opening and closing the
'wiper consumes considerably more power than making the turbidity measurement.
'Declare Public Variables
Public
OBS501(4)
Public
TimeCounter
Public
obsDatOpen(4),obsDatClose(4)
'Declare Other Variables
Alias
OBS501(1) = turb_bs
Alias
OBS501(2) = turb_ss
Alias
OBS501(3) = tempC_OBS501
Alias
OBS501(4) = wet_dry
Alias
obsDatOpen(1) = Open_counts
'Full movement of slider is about 20,000 counts. If it jams this # will be smaller
Alias
obsDatOpen(2) = Open_Max_mA_cnts
'Number of times the shutter stops while opening because of max current
Alias
obsDatOpen(3) = Open_slip
'Open timeout count. If the threads are stripped the slide will not move and this count will increase
Alias
obsDatOpen(4) = Open_mA
'mA current of the motor
Alias
obsDatClose(1) = Close_counts
'Full movement of slider is about 20,000 counts. If it jams this # will be smaller
Alias
obsDatClose(2) = Close_Max_mA_cnts
'Number of times the shutter stops while opening because of max current
Alias
obsDatClose(3) = Close_slip
'Open timeout count. If the threads are stripped the slide will not move and this count will increase
Alias
obsDatClose(4) = Close_mA
'mA current of the motor
Units
turb_bs = fbu
Units
turb_ss = fnu
Units
tempC_OBS501 = degC
Units
wet_dry = YesNo
'Define Data Tables
DataTable
(Test,1,1000)
DataInterval
(0,5,Min,10)
Sample
(1,turb_bs,FP2)
Sample
(1,turb_ss,FP2)
EndTable
'Main Program
BeginProg
SDI12Recorder
(obsDatOpen(),1,0,"M3!",1,0) ‘Start with shutter open
Scan
(1,Min,0,0)
TimeCounter = TimeC 1
'Wipe at a slower interval than the scan interval
If TimeCounter >= 60 Then 'This value, 60, will wipe once every 60 scan intervals. 60 minutes in this case
SDI12Recorder
(obsDatClose(),1,0,"M7!",1,0)
SDI12Recorder
(obsDatOpen(),1,0,"M3!",1,0)
TimeCounter = 0
EndIf
'Read OBS501 each scan interval
SDI12Recorder
(OBS501(),1,0,"M4!",1,0)' Measure without moving the wiper
'Call Output Tables
CallTable
Test
NextScan
EndProg