beautypg.com

3 alias and unit declarations – Campbell Scientific CR1000 Measurement and Control System User Manual

Page 124

background image

Section 7. Installation

124 

 

 

Table 11. Predefined Constants and Reserved Words

mv50cR mv500c mv7_5 mv7_5c

mvX10500 mv50R NSEC PROG

SCAN mvX1500 Select STRING

SUB sec

TABLE

TRUE

TypeB SUBSCAN TypeJ TypeK

TypeN TypeE TypeS TypeT

UINT2 TypeR usec v10

v2 Until v2c v50

v60 v20 EX1

vX15

VX2 VX1 vX105

EX2

EX3 VX3

VX4

While

 

7.7.3.4.3 Alias and Unit Declarations

A variable can be assigned a second name, or alias, by which it can be called
throughout the program. Aliasing is particularly useful when using arrays. Arrays
are powerful tools for complex programming, but they place near identical names
on multiple variables. Aliasing allows the power of the array to be used with the
clarity of unique names.

The original name can be used interchangeably with the alias name as a Public or
Dim variable in the body of the program. However, once the value is stored into
a final storage table, the field name that is system created for the table (derived
from the alias) must be used when accessing final storage data.

Variables in one, two, and three dimensional arrays can be assigned units. Units
are not used elsewhere in programming, but add meaning to resultant data table
headers. If different units are to be used with each element of an array, first
assign aliases to the array elements and then assign units to each alias. For
example:

Alias var_array(1) = solar_radiation
Alias var_array(2) = quanta

Units solar_radiation = Wm-2
Units variable2 = moles_m-2_s-1

One use of Alias and Units declarations is to reference a declared string constant
as an aid to foreign language support. CRBasic example Foreign Language
Support

(p. 125)

shows the use of Alias and Units declarations in building words

comprised of non-English characters (see table ASCII / ANSI Equivalents

(p. 201)

).