07.01.2015 Views

CR200/CR200X Series Dataloggers - Campbell Scientific

CR200/CR200X Series Dataloggers - Campbell Scientific

CR200/CR200X Series Dataloggers - Campbell Scientific

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Section 9. Programming<br />

TABLE. Predefined Constants and Reserved Words (p. 77) lists predefined<br />

constants.<br />

Table 7. Predefined Constants and Reserved Words<br />

Case Day DO FOR<br />

FALSE Hr If Msec<br />

min mv2500 mv5000 PROG<br />

SCAN Select SUB Sec<br />

TABLE TRUE Usec Until<br />

EX1 EX2 While<br />

9.6.3 Alias and Unit Declarations<br />

A variable can be assigned a second name, or alias, by which it can be called<br />

throughout the program. Aliasing is particularly useful when using arrays.<br />

Arrays are powerful features in complex programs, but place the same<br />

appellation on a number of variables. The use of an alias allows the power of the<br />

array to be used with the clarity of unique names.<br />

Each variable can be assigned units to clarify the meaning. Units are not used<br />

elsewhere in programming, but rather add meaning to resultant data table<br />

headers.<br />

CRBASIC EXAMPLE 7.<br />

Public TempC(2)<br />

Alias and Unit Declaration<br />

Alias TempC(1)=AirTempC<br />

Alias TempC(2)=SoilTempC<br />

Units TempC()=Deg_C<br />

BeginProg<br />

Scan (1,Sec)<br />

Therm109 (TempC(),2,1,Ex1,1.0,0)<br />

NextScan<br />

EndProg<br />

9.7 Declarations II - Declared Sequences<br />

9.7.1 Data Tables<br />

Data are stored in tables as directed by the CRBASIC program. A data table is<br />

created by a series of CRBASIC instructions entered after variable declarations<br />

but before the BeginProg instruction. These instructions include:<br />

77

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

Saved successfully!

Ooh no, something went wrong!