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 />

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

mv50cR mv500c mv7_5 mv7_5c<br />

mvX10500 mv50R NSEC PROG<br />

SCAN mvX1500 Select STRING<br />

SUB sec TABLE TRUE<br />

TypeB SUBSCAN TypeJ TypeK<br />

TypeN TypeE TypeS TypeT<br />

UINT2 TypeR usec v10<br />

v2 Until v2c v50<br />

v60 v20 EX1 vX15<br />

VX2 VX1 vX105 EX2<br />

EX3 VX3 VX4 While<br />

7.7.3.4.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. Arrays<br />

are powerful tools for complex programming, but they place near identical names<br />

on multiple variables. Aliasing allows the power of the array to be used with the<br />

clarity of unique names.<br />

The original name can be used interchangeably with the alias name as a Public or<br />

Dim variable in the body of the program. However, once the value is stored into<br />

a final storage table, the field name that is system created for the table (derived<br />

from the alias) must be used when accessing final storage data.<br />

Variables in one, two, and three dimensional arrays can be assigned units. Units<br />

are not used elsewhere in programming, but add meaning to resultant data table<br />

headers. If different units are to be used with each element of an array, first<br />

assign aliases to the array elements and then assign units to each alias. For<br />

example:<br />

Alias var_array(1) = solar_radiation<br />

Alias var_array(2) = quanta<br />

Units solar_radiation = Wm-2<br />

Units variable2 = moles_m-2_s-1<br />

One use of Alias and Units declarations is to reference a declared string constant<br />

as an aid to foreign language support. CRBasic example Foreign Language<br />

Support (p. 125) shows the use of Alias and Units declarations in building words<br />

comprised of non-English characters (see table ASCII / ANSI Equivalents (p. 201) ).<br />

124

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

Saved successfully!

Ooh no, something went wrong!