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 #134 background imageLoading...
Page #134 background image
Section 7. Installation
7.8.4.3.2 Dimensioning Numeric Variables
Some applications require multi-dimension arrays. Array dimensions are
analogous to spatial dimensions (distance, area, and volume). A single-dimension
array, declared as,
Public VariableName(x)
with (x) being the index, denotes x number of variables as a series.
A two-dimensional array, declared as,
Public VariableName(x,y)
with (x,y) being the indices, denotes (x y) number of variables in a square x-by-y
matrix.
Three-dimensional arrays, declared as
Public VariableName (x,y,z)
with (x,y,z) being the indices, have (x • y • z) number of variables in a cubic x-by-
y-by-z matrix. Dimensions greater than three are not permitted by CRBasic.
When using variables in place of integers as dimension indices (see CRBasic
example Using variable array dimension indices
(p. 134)), declaring the indices As
Long variables is recommended. Doing so allows for more efficient use of
CR1000 resources.
CRBasic Example 4. Using Variable Array Dimension Indices
'This program example demonstrates the use of dimension indices in arrays. The variable
'VariableName is declared with three dimensions with 4 in each index. This indicates the
'array has means it has 64 elements. Element 24 is loaded with the value 2.718.
'
Dim aaa As Long
Dim bbb As Long
Dim ccc As Long
Public VariableName(4,4,4) As Float
BeginProg
Scan(1,sec,0,0)
aaa = 3
bbb = 2
ccc = 4
VariableName(aaa,bbb,ccc) = 2.718
NextScan
EndProg
7.8.4.3.3 Dimensioning String Variables
Strings can be declared to a maximum of two dimensions. The third "dimension"
is used for accessing characters within a string. See String Operations
(p. 282).
String length can also be declared. See the table Data Types in Variable Memory.
(p. 131, p. 130)
A one-dimension string array called StringVar, with five elements in the array
and each element with a length of 36 characters, is declared as
Public StringVar(5) As String * 36
134

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