Section 7. Installation
135
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 CR800 Series
Page 2: ......
Page 4: ......
Page 6: ......
Page 32: ......
Page 34: ......
Page 54: ......
Page 92: ......
Page 310: ......
Page 446: ...Section 8 Operation 446 8 11 2 Data Display FIGURE 100 CR1000KD Displaying Data ...
Page 448: ...Section 8 Operation 448 FIGURE 102 CR1000KD Real Time Custom ...
Page 449: ...Section 8 Operation 449 8 11 2 3 Final Storage Data FIGURE 103 CR1000KD Final Storage Data ...
Page 450: ...Section 8 Operation 450 8 11 3 Run Stop Program FIGURE 104 CR1000KD Run Stop Program ...
Page 452: ...Section 8 Operation 452 FIGURE 106 CR1000KD File Edit ...
Page 456: ......
Page 462: ......
Page 523: ...Section 11 Glossary 523 FIGURE 116 Relationships of Accuracy Precision and Resolution ...
Page 524: ......
Page 526: ......
Page 556: ......
Page 558: ......
Page 560: ......
Page 597: ......