Appendix B. Example Programs
B-2
B.2 Measuring Thermocouples
The following program measures 16 thermocouples on a CDM-A116. Because
the CDM-A116 can measure 4 thermocouples per terminal strip, this program
includes code to use the appropriate reference temperature measurement.
CRBasic Example B-2. Measuring Thermocouples
'This program example demonstrates measuring 16 thermocouples on a CDM-A116
'Declare Variables and Units
Dim
CDMTCRef(16)
Public
BattV
Public
PTemp_C
Public
CDMBattV
Public
CDMPTempC(4)
Public
Temp_C(16)
Units
BattV=Volts
Units
PTemp_C=Deg C
Units
CDMBattV=Volts
Units
Temp_C=Deg C
Units
CDMPTempC=Deg C
'Define Data Tables
DataTable
(Hourly,True,-1)
DataInterval
(0,60,Min,10)
Average
(16,Temp_C(),FP2,False)
Average
(4,CDMPTempC(),FP2,False)
EndTable
DataTable
(Daily,True,-1)
DataInterval
(0,1440,Min,10)
Minimum
(1,BattV,FP2,False,False)
Minimum
(1,CDMBattV,FP2,False,False)
EndTable
'Main Program
BeginProg
'Main Scan
Scan
(5,Sec,3,0)
'Measure CR6 Datalogger Battery Voltage
Battery
(BattV)
'Measure CR6 Datalogger Wiring Panel Temperature
PanelTemp
(PTemp_C,60)
'Measure CDM-A116 Battery Voltage
CDM_Battery
(CDM_A116,1,CDMBattV)
'Measure CDM-A116 Wiring Panel Temperatures
CDM_PanelTemp
(CDM_A116,1,CDMPTempC(),4,1,60)
'Populate CDMTCRef() array with copies of CDMPTempC() reference temperature
'measurements from CDM-A116 for use in thermocouple measurements
Move
(CDMTCRef(1),4,CDMPTempC(1),1)
Move
(CDMTCRef(5),4,CDMPTempC(2),1)
Move
(CDMTCRef(9),4,CDMPTempC(3),1)
Move
(CDMTCRef(13),4,CDMPTempC(4),1)
'Measure Type T (copper-constantan) Thermocouple on CDM-A116
'Syntax CDMTCRef(1)() increments reference temperature array with each repetition
CDM_TCDiff
(CDM_A116,1,Temp_C(),16,mv200C,1,TypeT,CDMTCRef(1)(),True,0,60,1,0)
'Call Data Tables and Store Data
CallTable
Hourly
CallTable
Daily
NextScan
EndProg
Содержание CDM-A100 Series
Страница 2: ......
Страница 3: ......
Страница 7: ......
Страница 11: ...Table of Contents iv ...
Страница 45: ...CDM A100 Series 34 ...
Страница 47: ......
Страница 53: ...Appendix B Example Programs B 6 ...
Страница 57: ...Appendix C Calculating Network Restrictions C 4 ...
Страница 60: ......