beautypg.com

4 output processing instructions, Average (reps, source, datatype, disablevar), Average parameters – Campbell Scientific CR9000X Measurement and Control System User Manual

Page 197: Covariance parameters

background image

Section 6. Data Table Declarations and Output Processing Instructions

6.4 Output Processing Instructions

Average (Reps, Source, DataType, DisableVar)

This instruction stores the average value over the output interval for the source
variable or each element of the array specified.

Parameter

Enter

AVERAGE PARAMETERS

Reps

Constant

The number of averages to calculate. When Reps is greater than one, the source must be an array.

Source

Var.

The name of the Variable that is to be averaged.

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, Var.,
or Expression

A non-zero value will disable intermediate processing. Normally 0 is entered so all inputs are processed.
Example:When the disable variable is

≠0 the current input is not included in the average. The average

that is stored is the average of the inputs that occurred while the disable variable was 0.

Value Result

0

Process current input

≠ 0

Do not process current input

Covariance (NumVals, Source, DataType, DisableVar, NumCov)

Calculates the covariance of values in an array over time. The Covariance of

X

and

Y

is calculated as:

(

)

2

1

1

1

)

,

(

n

Y

X

n

Y

X

Y

X

Cov

n

i

i

n

i

i

n

i

i

i

=

=

=

=

where is the number of values processed over the output interval and

and

Y

are the individual values of

n

i

X

i

X

and

Y

.

Parameter

Enter

COVARIANCE PARAMETERS

NumVals Const

The number of elements in the array to include in the covariance calculations

Source
Variable Array

The array that contains the values from which to calculate the covariances. If the covariance
calculations are to start at some element of the array later than the first, include the element number
in the source (e.g., X(3)).

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

A non-zero value will disable intermediate processing: input is not included in the Covariance.

Constant,

Value Result

Variable, or

0

Process current input

Expression

≠ 0

Do not process current input

NumCov
Constant

The number of covariances to calculate. The maximum number of covariances is Z/2*(Z+1). Where
Z= NumVals. If X(1) is the first specified element of the source array, the covariances are
calculated and output in the following sequence: X_Cov(1)…X_Cov(Z/2*(Z+1)) = Cov[X(1),X(1)],
Cov[X(1),X(2)],…Cov[X(1),X(Z)],…Cov[X(2),X(2)], Cov[X(2),X(Z)],…Cov[X(Z),X(Z)].

6-13