beautypg.com

Table 8. formats for entering numbers in crbasic – Campbell Scientific CR800 and CR850 Measurement and Control Systems User Manual

Page 114

background image

Section 7. Installation

114 

 

 

 


CRBasic Example 6.

Proper Program Structure 

'Declarations

'Define Constants

Const

RevDiff = 1

Const

Del = 0 'default

Const

Integ = 250

Const

Mult = 1

Const

Offset = 0

Declare constants

'Define public variables

Public

RefTemp

Public

TC(6)

'Define Units

Units

RefTemp = degC

Units

TC = DegC

Declare public variables,
dimension array, and declare
units.

Declarations

'Define data tables

DataTable

(Temp,1,2000)

DataInterval

(0,10,min,10)

Average

(1,RefTemp,FP2,0)

Average

(6,TC(),FP2,0)

EndTable

Define data table

'Begin Program

BeginProg

'Set scan interval

Scan

(1,Sec,3,0)

'Measurements

PanelTemp

(RefTemp,250)

TCDiff

(TC()...Offset)

Measure

'Processing (None in this

'example)

Scan loop

'Call data table

CallTable

Temp

Call data table

'Controls (None in this

'example)

'Loop to next scan

NextScan

'End Program

EndProg