C.4 Synchronized TEMP 120 and VOLT 108
measurements
The following program measures a full-bridge sensor on a VOLT 108 at 100 Hz, and 20 type-T
thermocouples on a TEMP 120 module at 1 Hz. The measurements are synchronized by putting
the faster measurements in a
SubScan
.
CRBasic Example 7: Synchronized TEMP 120 and VOLT 108 measurements
'GRANITE 9 Datalogger
'This program uses a TEMP 120 module to measure 20 type-T thermocouples at
'1 Hz and a VOLT 108 module to measure a full-bridge sensor at 100 Hz. A
'SubScan instruction is used to synchronize the full-bridge
'measurements with the thermocouple measurements.
'Declare Variables and Units
Public
TC(20) :
Units
TC = DegC
Public
strain_raw :
Units
strain_raw = mVpV
'Define Data Tables
DataTable
(OneSec, TRUE, -1)
DataInterval
(0, 1, SEC, 10)
Average
(20, TC(), FP2, FALSE)
Maximum
(1, strain_raw, FP2, FALSE, TRUE)
EndTable
'Main Program
BeginProg
Scan
(1, SEC, 3, 0)
'Measure 20 Type-T thermocouples on TEMP 120 with CPI address 1
CDM_TCComp
(TEMP120, CP 1, TC(), 20, 1, TYPET, 1, 0)
SubScan
(10, MSEC, 100)
'Measure full-bridge sensor on VOLT 108 with CPI address 2
CDM_BrFull
(VOLT108, CP 2, strain_raw, 1, mV200, 1, X1, 1, _
5000, TRUE, TRUE, 1000, 1000, 1.0, 0.0)
NextSubScan
'Call data table to process and store data
CallTable
(OneSec)
NextScan
EndProg
VOLT 100 series
48