beautypg.com

Maximum (reps, source, datatype, disablevar, time), Median – Campbell Scientific CR9000X Measurement and Control System User Manual

Page 209

background image

Section 6. Data Table Declarations and Output Processing Instructions

Maximum (Reps, Source, DataType, DisableVar, Time)

This instruction stores the Maximum value that occurs in the specified Source
variable over the output interval. Time of maximum value(s) is Optional
output
information, which is selected by entering the appropriate code in the
time parameter. NANs are ignored by this output processing instruction.

Parameter

Enter

MAXIMUM PARAMETERS

Reps

Constant

The number of maximum values to determine. When repetitions are greater than 1, the source must be
an array..

Source

Variable

The name of the Variable that is the input for the instruction.

DataType

A code to select the data storage format. Read More: See Section 4.2.4.4 Data Types

Constant

Alpha Code

Numeric Code

Data Format

IEEE4

24

IEEE 4 byte floating point

FP2

7

Campbell Scientific 2 byte floating point

UINT2

21

2 Byte unsigned integer

Long

20

4 Byte Integer value

DisableVar

Constant,
Variable, or

A non-zero value will disable intermediate processing. Normally 0 is entered so all inputs are processed.
For example, when the disable variable is

≠0 the current input is not checked for a new maximum. The

maximum that is eventually stored is the maximum that occurred while the disable variable was 0.

Expression

Value Result

0

Process current input

≠ 0

Do not process current input

Time

Option to store time of Maximum. When time is output, the maximums for all reps are output first
followed by the respective times at which they occurred.

Constant

Value Result

0

Do not store time

1

Store time

Time of max is stored in the NSec format.

Median

The Median instruction stores the median value over time of a variable to an
output table.

Syntax

Median(

Reps, Source, MaxN, DataType, DisableVar

)

Remarks
Median
is an output instruction that is included within a data table declaration.
Each time the DataTable is called and the DisableVar is False, the current
Source value is stored to an array in internal memory. This array is
dimensioned with MaxN number of elements. Therefore, no more than MaxN
values are retained in memory. If MaxN + 1 number of stored values is reached
before the DataTable output is triggered, then the oldest stored value in the
array will be discarded.

When the DataTable's output condition is True, the instruction outputs the
Median of the values in memory to the DataTable, and then memory for the
instruction is cleared. If the number of values for which the median is
calculated is an even number, the two median values will be averaged
.

NANs and +INFs are considered to be the most minimum values in the
determination of the Median.

6-25