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
Содержание CR3000 Micrologger
Страница 2: ......
Страница 3: ......
Страница 4: ......
Страница 6: ......
Страница 30: ......
Страница 34: ......
Страница 36: ......
Страница 96: ......
Страница 200: ...Section 7 Installation 200 FIGURE 42 Running Average Frequency Response FIGURE 43 Running Average Signal Attenuation ...
Страница 485: ...Section 8 Operation 485 8 11 2 Data Display FIGURE 110 Keyboard and Display Displaying Data ...
Страница 487: ...Section 8 Operation 487 FIGURE 112 CR1000KD Real Time Custom ...
Страница 488: ...Section 8 Operation 488 8 11 2 3 Final Storage Data FIGURE 113 Keyboard and Display Final Storage Data ...
Страница 489: ...Section 8 Operation 489 8 11 3 Run Stop Program FIGURE 114 Keyboard and Display Run Stop Program ...
Страница 491: ...Section 8 Operation 491 FIGURE 116 Keyboard and Display File Edit ...
Страница 495: ...Section 8 Operation 495 Low power standby whenever possible Low power bus sets bus and modules to low power ...
Страница 496: ......
Страница 502: ......
Страница 564: ...Section 11 Glossary 564 FIGURE 126 Relationships of Accuracy Precision and Resolution ...
Страница 566: ......
Страница 594: ......
Страница 598: ......
Страница 600: ......
Страница 602: ......
Страница 624: ......
Страница 642: ......
Страница 643: ......