Appendix B. Example Programs
B-3
'3 repetitions, writing to SEVolt(7), SEVolt(8) and SEVolt(9)
'3 repetitions, measuring 5H, 5L, 6H on mux
VoltSe
(SEVolt(7),3,mv2500,1,True,0,60,1,0)
'Turn AM16/32B Multiplexer Off
PortSet
(C2,0)
'Call Data Tables and Store Data
CallTable
Hourly
CallTable
Daily
NextScan
EndProg
The following example is a CR1000X program. With minor adjustments, this
program can be used with the CR6 series, CR800 series, CR1000, or CR3000.
The AM16/32B must be in 4x16 mode.
CRBasic Example B-2. Single-Ended Voltage Measurements
'Declare Variables and Units
Public
BattV
Public
Ptemp_C
Public
LCount
Public
SEVolt(48)
Units
BattV=Volts
Units
Ptemp_C=Deg C
Units
SEVolt=mV
'Define Data Tables
DataTable
(Hourly,True,-1)
DataInterval
(0,60,Min,10)
Sample
(48,SEVolt(),FP2)
EndTable
DataTable
(Daily,True,-1)
DataInterval
(0,1440,Min,10)
Average
(48,SEVolt(),FP2,False)
Minimum
(1,BattV,FP2,False,False)
EndTable
'Main Program'
BeginProg
'Main Scan
Scan
(30,Sec,1,0)
'Default CR1000X Datalogger Battery Voltage measurement 'BattV'
Battery
(BattV)
'Default CR1000X Datalogger Wiring Panel Temperature measurement 'PTemp_C'
PanelTemp
(Ptemp_C,_60Hz)
'Turn AM16/32B Multiplexer On
PortSet
(C2,1)
Delay
(0,150,mSec)
LCount=1
SubScan
(0,uSec,16)
'Switch to next AM16/32B Multiplexer channel
PulsePort
(C1,10000)
'Generic Single Ended Voltage measurements 'SEVolt() on AM16/32B Multiplexer
VoltSe
(SEVolt(LCount),3,mv5000,1,True,0,_60Hz,1,0)
LCount=3
NextSubScan
'Turn AM16/32B Multiplexer Off
PortSet
(C2,0)
'Call Data Tables and Store Data
CallTable
Hourly
CallTable
Daily
NextScan
EndProg