Campbell CR5000 Operator's Manual page 189

Measurement and control system
Table of Contents

Advertisement

MaxSpa Function Example
This example uses MaxSpa to find the maximum value of the five elements
Temp(6) through Temp(10) and store the result in the variable MaxTemp.
MaxSpa(MaxTemp, 5, Temp(6))
MinSpa (Dest, Swath, Source)
Finds the minimum value in an array.
Syntax
MinSpa(Dest, Swath, Source)
Remarks
Find the minimum value in the given array and place the result in the variable
named in Dest. The Source must be a particular element in an array (e.g.,
Temp(1)); it is the first element in the array to check for the minimum. The
Swath is the number of elements to compare for the minimum.
Parameter
Enter
& Data Type
Dest
The variable in which to store the results of the instruction.
Variable
Swath
The number of values of the source array in which to search of the
Constant
minimum.
Source
The name of the variable array that is the input for the instruction.
Array
MinSpa Function Example
This example uses MinSpa to find the minimum value of the five elements
Temp(6) through Temp(10) and store the result in the variable MinTemp.
MinSpa(MinTemp, 5, Temp(6))
Mod
Divides two numbers and returns only the remainder.
Syntax
result = operand1 Mod operand2
Remarks
The modulus, or remainder, operator divides operand1 by operand2 (rounding
floating-point numbers to integers) and returns only the remainder as result.
For example, in the expression A = 19 Mod 6.7, A (which is result) equals 5.
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.
Section 8. Processing and Math Instructions
8-17

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the CR5000 and is the answer not in the manual?

Table of Contents