
CS805 Heated-Needle Anemometer
15
Example 3. Program with CR Basic
(continually powered; with average; with FWTC)
'CR5000
'This program is written to measure the CS805
'needle anemometer. It works with the CE805,
' and a Type E themocouple as a temperature
' reference. The CS805 will be continually powered.
'These are the constants for the program.
' First,'the pressure adjustment constants, and secondly,
' the slope and offset constants for the calibration.
const P_calib=646 'In mmHg @ Logan, Utah
const P_use=760 'In nnHg @ sea level
const B=255.1 'The slope constant
const A=-2.39 'The offset constant
'Make the public variable what needs to be measured
'such as the Temperature of the logger, Temp. of the
'air, Temp. of the needle, and the temperature
'difference of the two needles, and wind speed.
Public Tpanel(1), T_air(1), T_ndl(1), delta_T(1), wind(1)
units Tpanel(1)= C
units T_ai(1)r= C
units T_ndl(1)=C
units delta_T(1)= C
units wind(1)= cm/s
DataTable(wind, true, -1)
DataInterval (0,1,Min,0) '! min average
Average(1, wind(1), ieee4, false) 'average wind speed
StdDev(1,wind(1), ieee4, false) 'std. dev on the wind speed
EndTable
BeginProg
'As we begin the program, trigger the CS805 to stay on
'after it scans it will stay High the rest of the program
Scan(1,mSec,1, 1)
Portset(1,1) 'Trigger with port 1 High
NextScan
'Now begin the loop for measurement
Scan (2 ,Sec,3,0) '2 second execution interval
PanelTemp (Tpanel,250) 'measure the panel temp for TC ref
'measure the TC of the wind tunnel
TCDiff(T_air(1),1,mV20, 1, TypeE, Tpanel, True, 0,250, 1.0, 0)
'measure the CS805
TCDiff(T_ndl(1), 1, mV20, 6,TypeT, T_air, true, 0,250, 1, 0)
'Now begin processing the measurement
'Subtract T_air from T_ndl, to adjust for the datalogger
'adding on the referece temperature.
delta_T=T_ndl-T_air
'Process the calibration for wind speed
wind= ( A+ (B/delta_T) ) * sqr(P_calib/P_use)