C.2 Measuring thermocouples
The following program measures 20 thermocouples on a TEMP 120. This example uses
CDM_TCComp()
to measure both the reference thermistor and thermocouples.
CRBasic Example 5: Measuring thermocouples
'GRANITE 9 Datalogger
'This program sets CPI Address and Device Name on a TEMP 120 with serial
'number 1234 and uses the TEMP 120 to measure 20 Type-T thermocouples.
'Declare Variables and Units
Public
TC(20) :
Units
TC = DegC
'Define Data Tables
DataTable
(Hourly, TRUE, -1)
DataInterval
(0, 60, MIN, 10)
Average
(20, TC(), FP2, FALSE)
EndTable
'Main Program
BeginProg
'Set CPI Address
CPIAddModule
(TEMP120, 1234,
"A"
, CP 4)
Scan
(5, SEC, 3, 0)
'Measure 20 Type-T thermocouples on TEMP 120 with CPI address 4
CDM_TCComp
(TEMP120, CP 4, TC(), 20, 1,TypeT, 1, 0)
'Call Data Tables and Store Data
CallTable
(Hourly)
NextScan
EndProg
VOLT 100 series
46