Crbasic programming – Campbell Scientific CS110 Electric Field Meter User Manual
Page 29

CS110 Electric Field Meter
A network or array of electric field meters improves lightning warning
because of a wider area of coverage along with measurement redundancy.
The PackBus
TM
communication protocol capability of the CR1000
datalogger embedded in the CS110 provides for extensive networking
capability.
7. CRBasic Programming
The CR1000 uses a programming language that has similarities to structured
BASIC, hence the name CRBasic. Within CRBasic there are special
instructions for making various measurements and for defining tables of output
data. Measured results are assigned variable names. Mathematical operations
are written out much as they would be algebraically. Conditional statements
based on measured results provide users with extensive capability for
measurement and control applications. See Section 8 for details on individual
instructions. Appendix F contains some example CRBasic programs for the
CS110. A simple example CRBasic program illustrating some of the general
concepts follows:
'Comments can be inserted in CRBasic utilizing a single quote (').
'Simple CS110 program that measures panel (case) temperature, internal case
'relative humidity, battery voltage and electric field.(CS110_Simple.cr1).
'Updated last by Jody Swenson on 7/12/04.
const Mult = 85
'Define constant to be used in the program.
Public panel_temp
'Define variables to be used in the program.
Public internal_RH
Public battery_volt
Public E_field
Public leakage_cur
Public status
DataTable(Tab1,1,500)
'User defined table called Tab1 of size 500 records.
DataInterval(0,60,sec,10)
'Output data to the table processed every 60 seconds.
Average
(1,panel_temp,ieee4,0)
'Average panel temperature over interval.
Average
(1,internal_RH,ieee4,0)
'Average internal case RH.
Average
(1,battery_volt,ieee4,0)
'Use 4 byte ieee4 format for wide dynamic range.
Average(1,E_field,ieee4,0)
StdDev
(1,E_field,ieee4,0)
Average (1,leakage_cur,ieee4,0)
Maximum
(1,status,ieee4,0,False)
EndTable
BeginProg
Scan(1,sec,0,0)
'Scan loop occurring every second.
PanelTemp
(panel_temp,250)
'Measure temperature on CS110 panel board.
VoltDiff
(internal_RH,1,mV2500,5,True
,0,250,0.1,0)
Battery
(battery_volt)
'Measure CS110 battery voltage.
CS110(E_field,leakage_cur,status,_60Hz,Mult,0) 'CS110 electric field measurement.
CallTable
Tab1
'Call data table Tab1 every scan.
NextScan
EndProg
21