Minspa(dest, swath, source) – Campbell Scientific CR9000X Measurement and Control System User Manual
Page 311

Section 8. Processing and Math Instructions
MinSpa(Dest, Swath, Source)
The MinSpa function finds the minimum value from a specified swath of elements
of an array.
Syntax
MinSpa(
Dest, Swath, Source
)
Remarks
Finds the minimum value in the specified swath of elements of an array and stores
this min value into the Dest array. The location of the minimum value is stored in
the next sequential element in the Source array, The Source is specified as a
particular element in an array (e.g., Temp(3)) to start the search through the number
of elements specified by Swath.
NANs are not included in the processing of the
Spatial Minimum.
Parameter
Enter
MINSPA PARAMETERS
Dest
Array
The array element in which to store the minimum value. An array name with empty brackets (e.g.
Dest()), specifies to load the minimum value in the first element of the Dest array. The next element in
the Dest() array will be loaded with the location in the source array, starting with the element defined in
the Source argument as the first location, of the minimum.
Swath
Constant
The number of values of the source array in which to search for the minimum.
Source
Array
The element of the source array in which to start looking for the min. If the TC(6) were entered for the
source, and 3 for the Swath, then TC(6), TC(7), and TC(8) elements would be tested for the minimum.
MOD
The MOD function is used to perform a modulo divide of two numbers.
Syntax
result = operand1
MOD
operand2
Remarks
The Modulus, or remainder, operator divides operand1 by operand2 and returns
only the remainder as result. For example, in the expression A = 19 MOD 6.7, A
(which is result) equals 5.6. The operands can be any numeric expression.
MOD Operator Example
The example uses the MOD operator to determine if a 4-digit year is a leap year.
Dim TestYr, LeapStatus
'Declare variables
.
TestYr = 1995
If TestYr
MOD
4 = 0 And TestYr
MOD
100 = 0 Then
If TestYr
MOD
400 = 0 Then
'Divisible by 400?
LeapStatus = True
Else
LeapStatus = False
End If
ElseIf TestYr
MOD
4 = 0 Then
LeapStatus = True
Else
LeapStatus = False
End If
8-25