Campbell Scientific CR7 Measurement and Control System User Manual

Page 111

Advertising
background image

SECTION 10. PROCESSING INSTRUCTIONS

10-9

The Input Processing phase is where new input
values are received, the necessary squares or
cross products formed, and the appropriate
summations calculated as required by the
desired final output. The rate at which the
measurements can be made, the input values
ordered, and the input processing phase
completed without interruption determines the
maximum rate of execution (see Execution
Time).

The Averaging Period Processing occurs
whenever the number of input samples entered
in Parameter 7 is satisfied or whenever an
Output Interval occurs (i.e., whenever the
Output Flag is set). Results from these
calculations are stored sequentially in Input
Storage locations starting with the location
specified in Parameter 9. The calculations
performed are shown below, where N is the
number of input samples in the averaging
period:

1.

Means:

M(X) =

ΣX/N

2.

Variances:

V(X) =

ΣX2/N - (ΣX/N)2

3.

Standard Deviations:

SD(X) = V(X)1/2

4.

Covariances:

CV(X,Y) =

ΣXY/N - ΣX ΣY/N2

5.

Correlations:

CR(X) = CV(X,Y)/(SD(X)SD(Y))

NOTES: 1. The square root algorithm in
the CR7 returns a result of 0 for negative
arguments.

2. The divide algorithm returns the largest
floating point number possible (±1018
displayed as ±99999) for a divide by 0.

3. When computing the variance of a
constant signal, round off error produces a
small negative result. The CR7 returns a 0
for the square root of a negative number;
therefore, the standard deviation is set to 0.
If the signal is also used in a correlation
calculation, division by 0 returns an
overrange value for the correlation result.

If a fast execution interval is specified, it is
possible that the combined execution times of
the input and averaging period processing may
exceed the program table execution interval.
The occurrence of an execution interval
Overrun (see Section 2.1 of CR7 Operator's
Manual) is noted by decimal points on either
side of the G in LOG (*0 MODE). This results in
the omission of one input sample. The
calculations are not affected, however, since the
number of input samples is incremented only
when valid input processing occurs. Averaging
period processing occurs only when the number
of input samples specified in Parameter 7 is
accumulated.

Regardless of whether all of the input samples
for the averaging period (specified in Parameter
7) have occurred or not, averaging period
processing occurs whenever the Output Flag is
set. This accommodates situations where the
Output Interval may not be an integer multiple of
the averaging period. If for example a 30
minute Output Interval is set by Instruction 92
and an 8 minute averaging period is specified
by Parameter 7, then three 8 minute and one 6
minute calculations will occur. The proper
weighting of these values in producing the final
output is described below.

The Output Processing occurs only at the
Output Interval and involves averaging the
statistical results obtained at the averaging
periods. These final results are then stored
sequentially in Input Storage beginning with the
location specified in Parameter 9. The Sample
Instruction 70 must be used to transfer the data
to Final Storage. All but the last averaging
period in the Output Interval will contain the
same number of input scans as specified by
Parameter 7. To insure that results from the
averaging periods contribute to the final result
proportional to their averaging periods, the
output processing uses the following equation:

RF = (NR1 + NR2 + .... + N'RL)/NT

RF is the final result
R1 R2, etc., are the results from the averaging

period processing

RL is the result from the last averaging period

in the Output Interval

N

is the number of input samples in the
specified averaging period (Parameter 7)

N' is the number of input scans in the last

averaging period

Advertising