'CR3000 Series Datalogger
' IRT mobile unit #1
' three Apogee IRTs from Jamie Voogt
Public SBTemp1C, SBTemp1K, Targ1mV, m1, b1, TargTemp1K, TargTemp1C
Public SBTemp2C, SBTemp2K, Targ2mV, m2, b2, TargTemp2K, TargTemp2C
Public SBTemp3C, SBTemp3K, Targ3mV, m3, b3, TargTemp3K, TargTemp3C
'Declare constants (replace the listed values with coefficients received with sensor)
Const mC12 = 83768.5
Const mC11 = 16594100
Const mC10 = 2359420000
Const bC12 = 123435.0
Const bC11 = -3146590
Const bC10 = -12967800
Const mC22 = 74659.9
Const mC21 = 16246400
Const mC20 = 2321800000
Const bC22 = 54991.1
Const bC21 = -1616300
Const bC20 = -8456490
Const mC32 = 55627.6
Const mC31 = 16514000
Const mC30 = 2248820000
Const bC32 = 57482.9
Const bC31 = -2199740.0
Const bC30 = -20819100
'Define data table (table is outputting data every 60 seconds)
DataTable (IRT,1,-1)
DataInterval (0,15,Min,10)
Average (1,TargTemp1C,FP2,False)
StdDev (1,TargTemp1C,FP2,0)
Average (1,TargTemp2C,FP2,False)
StdDev (1,TargTemp2C,FP2,0)
Average (1,TargTemp3C,FP2,False)
StdDev (1,TargTemp3C,FP2,0)
Average (1,SBTemp1C,FP2,False)
Average (1,SBTemp2C,FP2,False)
Average (1,SBTemp3C,FP2,False)
EndTable
'Main program (program is making a measurement every 5 seconds)
BeginProg
Scan (1,Sec,0,0)
'Instruction to measure sensor body temperature (green wire to SE1, white wire to EX1, blue wire to ground)
Therm109 (SBTemp1C,1,1,Vx1,0,_50Hz,1.0,0)
'Instruction to measure mV output of thermopile detector (red wire to 2H, black wire to 2L, clear wire to ground)
VoltDiff (Targ1mV,1,autorange,2,True ,0,_50Hz,1.0,0)
'Calculation of m (slope) and b (intercept) coefficients for target temperature calculation
m1 = mC12 * SBTemp1C^2 + mC11 * SBTemp1C + mC10
b1 = bC12 * SBTemp1C^2 + bC11 * SBTemp1C + bC10
'Calculation of target temperature
SBTemp1K = SBTemp1C + 273.15
TargTemp1K = ((SBTemp1K^4) + m1 * Targ1mV + b1)^0.25
TargTemp1C = TargTemp1K - 273.15
'Instruction to measure sensor body temperature (green wire to SE1, white wire to EX1, blue wire to ground)
Therm109 (SBTemp2C,1,5,Vx2,0,_50Hz,1.0,0)
'Instruction to measure mV output of thermopile detector (red wire to 4H, black wire to 4L, clear wire to ground)
VoltDiff (Targ2mV,1,autorange,4,True ,0,_50Hz,1.0,0)
'Calculation of m (slope) and b (intercept) coefficients for target temperature calculation
m2 = mC22 * SBTemp2C^2 + mC21 * SBTemp2C + mC20
b2 = bC22 * SBTemp2C^2 + bC21 * SBTemp2C + bC20
'Calculation of target temperature
SBTemp2K = SBTemp2C + 273.15
TargTemp2K = ((SBTemp2K^4) + m2 * Targ2mV + b2)^0.25
TargTemp2C = TargTemp2K - 273.15
'Instruction to measure sensor body temperature (green wire to SE1, white wire to EX1, blue wire to ground)
Therm109 (SBTemp3C,1,9,Vx3,0,_50Hz,1.0,0)
'Instruction to measure mV output of thermopile detector (red wire to 6H, black wire to 6L, clear wire to ground)
VoltDiff (Targ3mV,1,autorange,6,True ,0,_50Hz,1.0,0)
'Calculation of m (slope) and b (intercept) coefficients for target temperature calculation
m3 = mC32 * SBTemp3C^2 + mC31 * SBTemp3C + mC30
b3 = bC32 * SBTemp3C^2 + bC31 * SBTemp3C + bC30
'Calculation of target temperature
SBTemp3K = SBTemp3C + 273.15
TargTemp3K = ((SBTemp3K^4) + m3 * Targ3mV + b3)^0.25
TargTemp3C = TargTemp3K - 273.15
'Call output tables
CallTable IRT
NextScan
EndProg