Campbell-scientific CR9000X Measurement and Control System Uživatelský manuál Strana 173

  • Stažení
  • Přidat do mých příruček
  • Tisk
  • Strana
    / 442
  • Tabulka s obsahem
  • KNIHY
  • Hodnocené. / 5. Na základě hodnocení zákazníků
Zobrazit stránku 172
Section 5. Program Declarations
CONST
Declares symbolic constants for use in place of values.
Syntax
Const constantname = expression [, 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 inadvertently
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.
Const Declaration Example
The example uses Const to define the symbolic constant PI.
Const PI = 3.141592654 'Define constant.
CONSTTABLE/ENDCONSTTABLE
Used to declare one or more constants that can be changed using the
CR1000KD keyboard display. The program is then recompiled with the new
values.
Syntax
ConstTable
Const A = value
Const B = value
EndConstTable
Remarks
The ConstTable declaration should appear in the declarations section of the
program, prior to the start of the main program. The intent of this declaration is
to define one or more constants in the program that will be listed in a special
table in the datalogger, and which can be edited using the CR1000KD
Keyboard display, and the program recompiled to use the new values.
Recompiling the program in this manner will reset the data tables stored in the
datalogger’s CPU and may make the Data Tables stored on a card unusable (if
the Data Table Header is changed), so all data should be collected before
editing a value in the constant table.
5-3
Zobrazit stránku 172
1 2 ... 168 169 170 171 172 173 174 175 176 177 178 ... 441 442

Komentáře k této Příručce

Žádné komentáře