Memorytest (dest), Maxspa (dest, swath, source) – Campbell Scientific CR5000 Measurement and Control Module User Manual

Page 188

Advertising
background image

Section 8. Processing and Math Instructions

8-16

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)

MemoryTest

(Dest)

Stores the results of the most recent memory test in a variable.

Syntax
MemoryTest (
Dest)

Remarks
The CR5000 tests CPU RAM and Task Sequencer memory when it compiles
and runs a program. MemoryTest stores the results of this compile test in a
variable

Parameter
& Data Type

Enter

Dest

The variable in which to store the results of the memory test

Variable

Result

Meaning

0

No problems found

1

Error in CPU RAM

2

Error in Task Memory

3

Error in both CPU RAM and Task Memory

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.

Advertising