
CRBasic Example 2: 4-Wire half bridge CR1000X program
'CR1000X Series data logger
'This example program measures a single 110PV-L probe using the
'BRHalf4W instruction once a second and stores the
'average temperature in degrees C every 10 minutes.
'Declare variables for temperature measurement using Half Bridge configuration
Public
T110PV_mV
Public
T110PV_Res
Public
T110PV_Temp_C
Public
T110PV_Temp_F
'Declare constants to be used in Steinhart-Hart equation
Const
A=1.129241*10^-3
Const
B=2.341077*10^-4
Const
C=8.775468*10^-8
'Declare variable units
Units
T110PV_mV= millivolts
Units
T110PV_Res=Ohms
Units
T110PV_Temp_C=Deg C
Units
T110PV_Temp_F=Deg F
'Define a data table for 10 minute averages
DataTable
(AvgTemp,1,-1)
DataInterval
(0,10,Min,10)
Average
(1,T110PV_Temp_C,FP2,False)
EndTable
BeginProg
Scan
(1,Sec,3,0)
'Measure 110PV-L probe
BrHalf4W
(T110PV_mV,1,mV5000,mV5000,1,Vx1,1,2500,True,True,0,60,1.0,0)
'Convert mV to ohms
T110PV_Res=4990 *T110PV_mV
'Use the Steinhart-Hart equation to convert resistance to temperature
T110PV_Temp_C = (1/(A+B*
LN
(T110C*(
LN
(T110PV_Res))^3))-273.15
'Convert Celsius to Fahrenheit
T110PV_Temp_F = T110PV_Temp_C * 1.8 + 32
CallTable
AvgTemp
NextScan
EndProg
110PV Surface Temperature Probe
19