EasyManuals Logo

Campbell CR1000 User Manual

Campbell CR1000
678 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #137 background imageLoading...
Page #137 background image
Section 7. Installation
are called local variables. Names of local variable can be identical to names of
global variables
(p. 517) and to names of local variables declared in other
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. 521).
When exchanging the contents of a global and local variables, declare each
passing / receiving pair with identical data types and string lengths.
7.8.4.6 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. 137).
CRBasic Example 7. 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.8.4.7 Declaring Constants
CRBasic example Using the Const Declaration (p. 137) shows use of the constant
declaration. A constant can be declared at the beginning of a program to assign an
alphanumeric name to be used in place of a value so the program can refer to the
name rather than the value itself. Using a constant in place of a value can make
the program easier to read and modify, and more secure against unintended
changes. If declared using ConstTable / EndConstTable, constants can be
changed while the program is running by using the CR1000KD Keyboard Display
menu (Configure, Settings | Constant Table) or the C command in a terminal
emulator (see Troubleshooting Terminal Emulator
(p. 501) ).
Note Using all uppercase for constant names may make them easier to recognize.
137

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Campbell CR1000 and is the answer not in the manual?

Campbell CR1000 Specifications

General IconGeneral
Power Requirements9.6 to 16 VDC
Data Logger Operating SystemCRBasic
Memory4 MB
Analog Inputs16 single-ended or 8 differential
Analog Input Resolution13 bits
Analog Input Range+/-2.5V
Digital I/O8
Pulse Counters2
Communication PortsRS-232
Operating Temperature-25°C to +50°C
Pulse Channels4

Related product manuals