Appendix B. Example Programs; Configuring Granite Measurement Module With Cpiaddmodule() - Campbell TEMP 120 Product Manual

20-channel thermocouple module
Table of Contents

Advertisement

Appendix B. Example programs

These programs were written for a GRANITE 6 data logger, except where noted. With slight
modifications, they can be used with other Campbell Scientific data loggers.
NOTE:
For the GRANITE 10 and GRANITE 9 data loggers, the CPIBusAddress parameter must
include the CPI bus when using bus B. Bus A is the default. For example, CPI_BusB + 2
specifies CPI bus B and CPI address 2.
B.1 Configuring GRANITE Measurement
Module with
The following program sets CPI addresses and device names on TEMP 120s with serial numbers
1234, 1235, and 1236 and makes 15 Type-T thermocouple measurements on each module.
'GRANITE 6 Datalogger
'This program sets CPI addresses and device names of three TEMP 120s and
'measures 15 input channels on each device.
'Declare Variables and Units
Public
TC_Set1(15) :
Public
TC_Set2(15) :
Public
TC_Set3(15) :
'Main Program
BeginProg
'Set CPI Addresses
CPIAddModule(TEMP120, 1234, "A", 4)
CPIAddModule(TEMP120, 1235, "12345", 5)
CPIAddModule(TEMP120, 1236,
'Main Scan
Scan(5, SEC, 3, 0)
'15 TCs on each TEMP 120 w/ CPI addresses 4, 5, and 6
CDM_TCComp(TEMP120, 4, TC_Set1(), 15, 1,TypeT, TRUE, 0)
CDM_TCComp(TEMP120, 5, TC_Set2(), 15, 1,TypeT, TRUE, 0)
CDM_TCComp(TEMP120, 6, TC_Set3(), 15, 1,TypeT, TRUE, 0)
NextScan
EndProg
CPIAddModule()
CRBasic Example 2: Using CPIAddModule()
Units
TC_Set1 = DegC
Units
TC_Set2 = DegC
Units
TC_Set3 = DegC
"TEMP 120 in Pump
House", 6)
TEMP 120
28

Advertisement

Table of Contents
loading

Table of Contents