![Campbell 237 Скачать руководство пользователя страница 17](http://html1.mh-extra.com/html/campbell/237/237_product-manual_3761195017.webp)
B-1
Appendix B. Example Programs
Each example program measures leaf wetness and outputs a sample resistance
and a time fraction the sensor is wet. In these examples, the output interval is
set to 60 minutes, so a time fraction wet of .33 is equivalent to 20 minutes
during that hour.
Wetness threshold is set at 150 kΩ.
CRBasic Example B-1. CR1000 Program Example
Public
Vs_Vx
Public
Rs_kOhms
DataTable
(Wetness,true,-1)
OpenInterval
DataInterval
(0,60,Min,10)
Sample
(1, Rs_kOhms, FP2)
Histogram
(Rs_kOhms, FP2, 0, 1, 001, 1 , 0, 150)
'Enter threshold in 8th parameter
EndTable
BeginProg
Scan
(60,Sec, 3, 0)
BRHalf
(Vs_Vx, 1, mV25, 1, VX1, 1, 2500, True, 0, 250, 1, 0)
Rs_kOhms = (1 / Vs_Vx) - 101
If
Rs_kOhms > 10000
Then
Rs_kOhms = 10000
EndIf
CallTable
Wetness
NextScan
EndProg
CRBasic Example B-2. CR200(X) Program Example
'CR200(X) Series Datalogger
Public
Vs_Vx
Public
Rs_kOhm
Public
ScanIntervalWet
Public
ScanIntervalSum
Public
TimeFractionWet
DataTable
(Wetness,1,-1)
DataInterval
(0,60,min)
'Interval must match IfTime interval (below)
Sample
(1,Rs_kohm)
Sample
(1,TimeFractionWet)
EndTable
BeginProg
Scan
(1,Min)
'Measure Wetness
ExDelSE
(Vs_Vx,1,1,1,mV2500,500,.0004,0)
'Zero measurement when measurement < 0
If
Vs_Vx < 0
Then
Vs_Vx = 0
Rs_kOhm = (1 / Vs_Vx) - 101
'Sum Scan Intervals
ScanIntervalSum = ScanInter 1
'Check if Leaf wetness is below 150 kOhms transition and count as time wet
If
Rs_kohm < 150
AND
Rs_kohm > 0
Then
ScanIntervalWet = ScanInter 1
EndIf