
8-1
SECTION 8. PROCESSING AND PROGRAM CONTROL EXAMPLES
The following examples are intended to illustrate the use of Processing and Program Control
Instructions, flags, and the capability to direct the results of Output Processing Instructions to Input
Storage.
The specific examples may not be as important as some of the techniques employed, for example:
Directing Output Processing to Input Storage is used in the Running Average and Rainfall Intensity
examples (8.1 and 8.2).
Flags tests are used in the Running Average, Interrupt Subroutine, and Converting Wind Direction
examples (8.1, 8.4, and 8.6)
These examples are not complete programs to be taken verbatim. They need to be altered to fit specific
needs.
8.1 COMPUTATION OF RUNNING
AVERAGE
It is sometimes necessary to compute a running
average (i.e., the average includes a fixed
number of samples and is continuously updated
as new samples are taken). Because the
output interval is shorter than the averaging
period, Instruction 71 cannot be used; the
algorithm for computing this average must be
programmed by the user. The following
example demonstrates a program for
computing a running average.
In this example, each time a new measurement
is made (in this case a thermocouple
temperature) an average is computed for the 10
most recent samples. This is done by saving all
10 temperatures in contiguous input locations
and using the Spatial Average Instruction (51)
to compute the average. The temperatures are
stored in locations 11 through 20. Each time
the table is executed, the new measurement is
stored in location 20 and the average is stored
in location 2. The Block Move Instruction (54) is
then used to move the temperatures from
locations 12 through 20 down by one location;
the oldest measurement (in location 11) is lost
when the temperature from location 12 is
written over it.
Input Location Labels:
1:Panl Temp
15:Temp i-5
2:10smpl av
16:Temp i-4
11:Temp i-9
17:Temp i-3
12:Temp i-8
18:Temp i-2
13:Temp i-7
19:Temp i-1
14:Temp i-6
20:Temp i
Where i is current reading,
i-1 is previous reading, etc.
*
1
Table 1 Programs
01:
1
Sec. Execution Interval
01:
P17
Panel Temperature
01:
1
IN Card
02:
1
Loc [:Panl Temp]
02:
P14
Thermocouple Temp (DIFF)
01:
1
Rep
02:
1
1500 uV slow Range
03:
1
IN Card
04:
1
IN Chan
05:
1
Type T (Copper-Constantan)
06:
1
Ref Temp Loc Panl Temp
07:
20
Loc [:Temp i ]
08:
1
Mult
09:
0.0000
Offset
03:
P51
Spatial Average
01:
10
Swath
02:
11
First Loc Temp i-9
03:
2
Avg Loc [:10smpl av]
Содержание CR7
Страница 2: ...This is a blank page ...
Страница 4: ...This is a blank page ...
Страница 28: ...CR7 MEASUREMENT AND CONTROL SYSTEM OVERVIEW OV 18 This is a blank page ...
Страница 38: ...SECTION 1 FUNCTIONAL MODES 1 10 This is a blank page ...
Страница 42: ...SECTION 2 INTERNAL DATA STORAGE 2 4 This is a blank page ...
Страница 52: ...SECTION 3 INSTRUCTION SET BASICS 3 10 This is a blank page ...
Страница 57: ...SECTION 4 EXTERNAL STORAGE PERIPHERALS 4 5 FIGURE 4 4 1 Example of CR7 Printable ASCII Output Format ...
Страница 58: ...SECTION 4 EXTERNAL STORAGE PERIPHERALS 4 6 This is a blank page ...
Страница 68: ...SECTION 6 9 PIN SERIAL INPUT OUTPUT 6 6 This is a blank page ...
Страница 140: ...SECTION 13 CR7 MEASUREMENTS 13 16 FIGURE 13 5 1 Circuits Used with Instructions 4 9 ...
Страница 162: ...APPENDIX A GLOSSARY A 4 This is a blank page ...
Страница 164: ...B 2 This is a blank page ...
Страница 170: ...APPENDIX C BINARY TELECOMMUNICATIONS C 6 This is a blank page ...
Страница 173: ...APPENDIX D CALIBRATION PROCEDURES D 3 FIGURE D 2 1 Calibration Points for the Analog Interface Card ...
Страница 174: ...APPENDIX D CALIBRATION PROCEDURES D 4 FIGURE D 2 2 CR7X CPU Card ...
Страница 186: ...CR7 INDEX I 8 This is a blank page ...