
Section 7. Installation
197
subroutines and functions. This feature allows creation of a CRBasic library of
reusable subroutines and functions that will not cause variable name conflicts. If
a program with local
Dim
variables attempts to use them globally, the compile
error
undeclared variable
will occur.
To make a local variable displayable, in cases where making it public creates a
naming conflict, sample the local variable to a data table and display the data
element table in a
numeric monitor
(p. 592).
When exchanging the contents of a global and local variables, declare each
passing / receiving pair with identical data types and string lengths.
7.6.3.7 Initializing Variables
By default, variables are set equal to zero at the time the datalogger program
compiles. Variables can be initialized to non-zero values in the declaration.
Examples of syntax are shown in CRBasic example
Initializing Variables
(p. 197).
Initializing Variables
'This program example demonstrates how variables can be declared as specific data types.
'Variables not declared as a specific data type default to data type Float. Also
'demonstrated is the loading of values into variables that are being declared.
Public
aaa
As Long
= 1
'Declaring a single variable As Long and loading the value of 1.
Public
bbb(2)
As String
*20 = {"String_1", "String_2"}
'Declaring an array As String and
'loading strings in each element.
Public
ccc
As Boolean
= True
'Declaring a variable As Boolean and loading the value of True.
'Initialize variable ddd elements 1,1 1,2 1,3 & 2,1.
'Elements (2,2) and (2,3) default to zero.
Dim
ddd(2,3)= {1.1, 1.2, 1.3, 2.1}
'Initialize variable eee
Dim
eee = 1.5
BeginProg
EndProg
7.6.3.8 Declaring Constants
Declare a constant name at the beginning of a program to use the alphanumeric
name in place of a numeric or string value. In the body of the program, use the
name rather than the value itself to make the program more secure against
unintended changes, and easier to read and modify. CRBasic example
Using the
Const Declaration
(p. 198)
shows how to declare and use constants.
If declared using
ConstTable
/
EndConstTable
instructions, constants can be
changed on the CR1000KD Keyboard/Display while the program is running
(
Configure
,
Settings
|
Constant Table
). Changes can also be made with the
C
command in a terminal emulator (see
Troubleshooting – Using Terminal Mode
(p.
.
Содержание CR6 Series
Страница 2: ......
Страница 4: ......
Страница 6: ......
Страница 32: ......
Страница 36: ......
Страница 38: ......
Страница 76: ...Section 5 Overview 76 FIGURE 20 Half Bridge Wiring Example Wind Vane Potentiometer ...
Страница 80: ...Section 5 Overview 80 FIGURE 23 Pulse Input Wiring Example Anemometer ...
Страница 136: ......
Страница 251: ...Section 7 Installation 251 FIGURE 46 Running Average Frequency Response FIGURE 47 Running Average Signal Attenuation ...
Страница 454: ...Section 8 Operation 454 FIGURE 104 Narrow Sweep High Noise ...
Страница 459: ...Section 8 Operation 459 FIGURE 106 Vibrating Wire Sensor Calibration Report ...
Страница 535: ...Section 8 Operation 535 8 11 2 Data Display FIGURE 121 CR1000KD Displaying Data ...
Страница 537: ...Section 8 Operation 537 FIGURE 123 CR1000KD Real Time Custom ...
Страница 538: ...Section 8 Operation 538 8 11 2 3 Final Storage Data FIGURE 124 CR1000KD Final Storage Data ...
Страница 539: ...Section 8 Operation 539 8 11 3 Run Stop Program FIGURE 125 CR1000KD Run Stop Program ...
Страница 541: ...Section 8 Operation 541 FIGURE 127 CR1000KD File Edit ...
Страница 542: ...Section 8 Operation 542 8 11 5 PCCard Memory Card Management FIGURE 128 CR1000KD PCCard Memory Card Management ...
Страница 546: ......
Страница 549: ...Section 9 Maintenance Details 549 FIGURE 133 Separate Back Shell from Module FIGURE 134 Disconnect Battery Connector ...
Страница 552: ......
Страница 610: ...Section 11 Glossary 610 FIGURE 137 Relationships of Accuracy Precision and Resolution ...
Страница 612: ......
Страница 648: ......
Страница 650: ......
Страница 688: ......
Страница 689: ......