![background image](http://html1.mh-extra.com/html/campbell/kh20/kh20_product-manual_3878401017.webp)
B-1
Appendix B. Example Program
The following example program measures the KH20 at 10Hz, and stores the
average values into a data table called ‘stats’, as well as the raw data into a data
table called ‘ts_data’.
The KH20 does not monitor absolute water vapor concentration.
CRBasic Example B-1. CR3000 Program to Measure Water Vapor Fluctuations
'CR3000 Series Data Logger
'This data logger program measures KH20 Krypton Hygrometer.
'The station operator must enter the constant and the calibration value for the KH20.
'Search for the text string "unique" to find the locations of these constants
'and enter the appropriate values found from the calibration sheet of the KH20.
'*** Unit Definitions ***
'Units Description
'ln_mV ln(mV) (natural log of the KH20 millivolts)
'mV millivolts
'rho_w g/m^3
'*** Wiring ***
'ANALOG INPUT
'1H KH20 (white)
'1L KH20 signal- (black)
'gnd KH20 shield (clear)
'EXTERNAL POWER SUPPLY
'POS KH20 power+ (red)
' data logger POWER IN 12 (red)
'NEG KH20 power- (black)
' KH20 power shield (clear)
' data logger POWER IN G (black)
PipeLineMode
'*** Constants ***
'Measurement Rate '10 Hz
Const SCAN_INTERVAL = 100
'100 mSec
'Output period
Const
OUTPUT_INTERVAL = 30
'Online flux data output interval in minutes.
Const
x = 1
'Unique path length of the KH20 [cm].
Const
kw = -0.150
'Unique water vapor absorption coefficient [m^3 / (g cm)].
Const
xkw = x*kw
'Path length times water vapor absorption coefficient [m^3 / g].
'*** Variables ***
Public
panel_temp
Public
batt_volt
Public
kh(2)
Public
rho_w
Alias
kh(1) = kh_mV
Alias
kh (2) = ln_kh
Units
panel_temp = deg_C
Units
batt_volt = volts
Units
kh_mV = mV
NOTE