![background image](http://html1.mh-extra.com/html/campbell/lws/lws_product-manual_3880750016.webp)
B-1
Appendix B. Example Programs
For these programs, the dry threshold is 274 and the wet threshold is 284. To
determine minutes dry, minutes wet or contaminated, and minutes wet, the
value 0.8333333 is used. This value was calculated based on a 5 s scan interval
(scan interval/60 s). Refer to Section
, for more information.
B.1 Example CR1000X Program
The wiring for the example is shown in TABLE
TABLE B-1. CR1000X Example Program Wiring
Color
Function
CR1000X
Brown or White
Excitation
VX1
Orange or Red
Analog Out
SE1
Clear
Analog Ground
⏚
CRBasic Example B-1. CR1000X Program for Measuring the LWS
'CR1000X
'Declare Variables and Units
Public
BattV
Public
PTemp_C
Public
LWmV
Public
LWMDry
Public
LWMCon
Public
LWMWet
Units
BattV=Volts
Units
PTemp_C=Deg C
Units
LWmV=mV
Units
LWMDry=Minutes
Units
LWMCon=Minutes
Units
LWMWet=Minutes
'Define Data Tables
DataTable
(Hourly,True,-1)
DataInterval
(0,60,Min,10)
Sample
(1,BattV,FP2)
Sample
(1,PTemp_C,FP2)
Sample
(1,LWmV,FP2)
Totalize
(1,LWMDry,FP2,False)
Totalize
(1,LWMCon,FP2,False)
Totalize
(1,LWMWet,FP2,False)
EndTable
DataTable
(Daily,True,-1)
DataInterval
(0,1440,Min,10)
Minimum
(1,BattV,FP2,False,False)
EndTable
'Main Program
BeginProg
'Main Scan