Appendix C. Example programs
These programs were written for a GRANITE 9 data logger. With slight modifications, they can be
used with other Campbell Scientific data loggers.
C.1 Configuring GRANITE Measurement
Module with CPIAddModule()
The following program sets CPI addresses and device names on VOLT 108s with serial numbers
1234, 1235, and 1236 and makes a single-ended measurement on each module SE 1 channel.
With slight modifications, this program can be used with other Campbell Scientific data loggers.
CRBasic Example 4: Using CPIAddModule()
'GRANITE 9 Datalogger
'This program sets CPI addresses and device names on VOLT108s.
'It makes a single-ended measurement on each unit’s SE 1 channel.
'Declare Variables and Units
Public
SEVolt1
Public
SEVolt2
Public
SEVolt3
'Main Program
BeginProg
'Set CPI Addresses
CPIAddModule
(VOLT108,1234,
"A"
,CP 4)
CPIAddModule
(VOLT108,1235,
"12345"
,CP 5)
CPIAddModule
(VOLT108,1236,
"VOLT108 in Pump House"
,CP 6)
'Main Scan
Scan
(5,Sec,3,0)
'Single-ended voltage measurements on VOLT108s w/ CPI addresses 4, 5 and 6
CDM_VoltSe
(VOLT108,4,SEVolt1,1,mV5000,1,True,500,60,1,0)
CDM_VoltSe
(VOLT108,5,SEVolt2,1,mV5000,1,True,500,60,1,0)
CDM_VoltSe
(VOLT108,6,SEVolt3,1,mV5000,1,True,500,60,1,0)
NextScan
EndProg
VOLT 100 series
45