Campbell CR800 Specifications Page 220

  • Download
  • Add to my manuals
  • Print
  • Page
    / 324
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 219
Section 8. Processing and Math Instructions
The Number argument can be any valid numeric expression that has a value
greater than 0. You can calculate base-n logarithms for any number x by
dividing the logarithm base 10 of x by the logarithm base 10 of n as follows:
LOGN( x ) = LOG10( x ) / LOG10( n )
LOG10 Function Example
This example uses the LOG10 instruction to calculate the log base 2 of 1000.
Dim LOG2_1000 'Declare variables.
LOG2_1000 = LOG10(1000)/ LOG10(2)
MaxSpa (Dest, Swath, Source)
Finds the maximum value in an array.
Syntax
MaxSpa(Dest, Swath, Source)
Remarks
Find the maximum 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
Parameter
& Data Type
Enter
Dest
Variable
The variable in which to store the maximum.
Swath
Constant
The number of values of the source array in which to search for the
maximum.
Source
Array
The name of the variable array that is the input for the instruction.
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.
8-18
Page view 219
1 2 ... 215 216 217 218 219 220 221 222 223 224 225 ... 323 324

Comments to this Manuals

No comments