04.01.2015 Views

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Section 7. Installation<br />

'Define public variables<br />

Public RefTemp<br />

Public TC(6)<br />

'Define Units<br />

Units RefTemp = degC<br />

Units TC = DegC<br />

Declare public variables,<br />

dimension array, and declare<br />

units.<br />

Declarations<br />

'Define data tables<br />

DataTable(Temp,1,2000)<br />

DataInterval(0,10,min,10)<br />

Average(1,RefTemp,FP2,0)<br />

Average(6,TC(),FP2,0)<br />

EndTable<br />

Define data table<br />

'Begin Program<br />

BeginProg<br />

'Set scan interval<br />

Scan(1,Sec,3,0)<br />

'Measurements<br />

PanelTemp(RefTemp,250)<br />

TCDiff(TC()...Offset)<br />

Measure<br />

'Processing (None in this<br />

'example)<br />

Scan loop<br />

'Call data table<br />

CallTable Temp<br />

'Controls (None in this<br />

'example)<br />

Call data table<br />

'Loop to next scan<br />

NextScan<br />

'End Program<br />

EndProg<br />

7.7.3.3 Command Line<br />

CRBasic programs are made up of a series of statements. Each statement<br />

normally occupies one line of text in the program file. Statements are made up of<br />

instructions, variables, constants, expressions, or a combination of these.<br />

"Instructions" are CRBasic commands. Normally, only one instruction is<br />

included in a statement. However, some instructions, such as If and Then, are<br />

allowed to be included in the same statement.<br />

Lists of instructions and expression operators can be found in the CRBasic<br />

Programming Instructions (p. 473) section. A full treatment of each instruction and<br />

114

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!