Section 5. program declarations, Alias, Const – Campbell Scientific CR5000 Measurement and Control Module User Manual

Page 89

Advertising
background image

5-1

Section 5. Program Declarations

Alias

Used to assign a second name to a variable.

Syntax

Alias VariableA = VariableB

Remarks
Alias allows assigning a second name to a variable. Within the datalogger
program, either name can be used. Only the alias is available for Public variables.
The alias is also used as the root name for data table fieldnames.

With aliases the program can have the efficiency of arrays for measurement and
processing yet still have individually named measurements.

Alias Declaration Example

The example shows how to use the Alias declaration.

Dim TCTemp(4)
Alias TCTemp(1) = CoolantT
Alias TCTemp(2) = ManifoldT
Alias TCTemp(3) = ExhaustT
Alias TCTemp(4) = CatConvT

Const

Declares symbolic constants for use in place of numeric entries.

Syntax

Const

constantname = expression

Remarks
The Const statement has these parts:

Part

Description

constantname

Name of the constant.

expression

Expression assigned to the constant. It can consist of literals
(such as 1.0), other constants, or any of the arithmetic or
logical operators.

Tip

Constants can make your programs self-documenting and easier to
modify. Unlike variables, constants can't be changed while your
program is running.

Caution

Constants must be defined before referring to them.

Tip

Use all uppercase letters for constant names to make them easy to
recognize in your program listings.

Advertising