Section 7. Installation
148
size of the mantissa, which is
±
16,777,216. If the attempt is made to express a
floating-point constant outside of this range, precision may be lost.
Constants in a constant table can also be changed using the SetSetting()
instruction and the constant table using the CR1000KD.
Note Using all uppercase for constant names may make them easier to
recognize.
Using the Const Declaration
'This program example demonstrates the use of the Const declaration.
'Declare variables
Public
PTempC
Public PTempF
'Declare constants
Const
CtoF_Mult = 1.8
Const
CtoF_Offset = 32
BeginProg
Scan
(1,Sec,0,0)
PanelTemp
(PTempC,250)
PTempF = PTempC * Cto CtoF_Offset
NextScan
EndProg
7.6.3.8.1 Predefined Constants
Many words are reserved for use by CRBasic. These words cannot be used as
variable or table names in a program. Predefined constants include instruction
names and valid alphanumeric names for instruction parameters. On account the
list of predefined constants is long and frequently increases as the operating
system is developed, the best course is to compile programs frequently during
CRBasic program development. The compiler will catch the use of any reserved
words. Following are listed predefined constants that are assigned a value:
•
LoggerType = 3000 (as in CR3000)
These may be useful in programming.
7.6.3.9 Declaring Aliases and Units
A variable can be assigned a second name, or alias, in the CRBasic 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 declared variable name can be used interchangeably with the declared alias in
the body of the CRBasic program. However, when a value is stored to final-
memory, the value will have the alias name attached to it. So, if the CRBasic
Summary of Contents for CR3000 Micrologger
Page 2: ......
Page 3: ......
Page 4: ......
Page 6: ......
Page 30: ......
Page 34: ......
Page 36: ......
Page 96: ......
Page 485: ...Section 8 Operation 485 8 11 2 Data Display FIGURE 110 Keyboard and Display Displaying Data ...
Page 487: ...Section 8 Operation 487 FIGURE 112 CR1000KD Real Time Custom ...
Page 491: ...Section 8 Operation 491 FIGURE 116 Keyboard and Display File Edit ...
Page 496: ......
Page 502: ......
Page 564: ...Section 11 Glossary 564 FIGURE 126 Relationships of Accuracy Precision and Resolution ...
Page 566: ......
Page 594: ......
Page 598: ......
Page 600: ......
Page 602: ......
Page 624: ......
Page 642: ......
Page 643: ......