Section 7. Installation
145
Using a Variable Array in Calculations
'This program example demonstrates the use of a variable array to reduce code. In this
'example, two variable arrays are used to convert four temperature measurements from
'degree C to degrees F.
Public
TempC(4)
Public
TempF(4)
Dim
T
BeginProg
Scan
(1,Sec,0,0)
Therm107
(TempC(1),1,1,Vx1,0,250,1.0,0)
Therm107
(TempC(2),1,2,Vx1,0,250,1.0,0)
Therm107
(TempC(3),1,3,Vx1,0,250,1.0,0)
Therm107
(TempC(4),1,4,Vx1,0,250,1.0,0)
For
T = 1
To
4
TempF(T) = TempC(T) * 1.8 + 32
Next
T
NextScan
EndProg
7.6.3.5.1 Advanced Array Declaration
This section describes syntax that facilitates array filling, scaling, copying, etc.
The main applications are as follows:
a) initiating an array
b) scaling an array, for example converting all of the FREQ/HZ returned by a
group of AVW200's into digits, strain, level, etc.
c) creating boolean arrays based on comparisons with a scalar or another array
The main drivers at the time of starting down this path were
1) multiple years of feedback from customers asking me how to more tersely
initialize and scale arrays - often trying to compare CRBasic to Matlab or Python.
2) Easier ways to scale vibrating wire measurements and transpose their resulting
data arrays:
CRBasic provides an array notation that allows one to easily operate on a single
dimension of an array. Using this notation one can easily:
•
initialize an array dimension
•
copy a dimension to a new location
•
scale an array dimension
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: ......