SECTION 8. PROCESSING AND PROGRAM CONTROL EXAMPLES
8-2
In the above example, all samples for the
average are stored in input locations. This is
necessary when an average must be output
with each new sample. In most cases,
averages are desired less frequently than
sampling. For example, it may be necessary to
sample some parameter every 5 seconds and
output every hour an average of the previous
three hours' readings. If all samples were
saved, this would require 2160 input locations.
The same value can be obtained by computing
an hourly average and averaging the hourly
averages for the past three hours. To do this
requires that hourly averages be stored in input
locations.
Instruction 80 is used to send the 1 hour
average to Input Storage and again to send the
3 hour average to Final Storage.
PROGRAM
*
Table 1 Program
01:
5.0
Execution Interval (seconds)
01:
Volt (Diff) (P2)
1:
1
Reps
2:
25
±2500 mV 60 Hz
Rejection Range
3:
1
DIFF Channel
4:
5
Loc [ XX_mg_M3 ]
5:
10
Mult
6:
0
Offset
02:
If time is (P92)
1:
0
Minutes (Seconds --) into a
2:
60
Interval (same units as
above)
3:
10
Set Output Flag High
03:
Set Active Storage Area (P80)
1:
3
Input Storage Area
2:
3
Array ID or Loc [ avg_i ]
04:
Average (P71)
1:
1
Reps
2:
5
Loc [ XX_mg_M3 ]
05:
Spatial Average (P51)
1:
3
Swath
2:
1
First Loc [ avg_i_2 ]
3:
4
Avg Loc [ 3_Hr_avg ]
06:
Set Active Storage Area (P80)
1:
1
Final Storage Area 1
2:
25
Array ID or Loc [ _________ ]
07:
Real Time (P77)
1: 0110
Day,Hour/Minute
08:
Sample (P70)
1:
1
Reps
2:
4
Loc [ 3_Hr_avg ]
09:
If Flag/Port (P91)
1:
10
Do if Output Flag is High
(Flag 0)
2:
30
Then Do
10:
Block Move (P54)
1:
2
No. of Values
2:
2
First Source Loc
[ avg_i_1 ]
3:
1
Source Step
4:
1
First Destination Loc
[ avg_i_2 ]
5:
1
Destination Step
11:
End (P95)
INPUT LOCATIONS
1 avg_i_2
2 avg_i_1
3 avg_i
4 3_Hr_avg
5 XX_mg_M3
8.2 RAINFALL INTENSITY
In this example, the total rain for the last 15
minutes is output only if any rain has occurred.
The program makes use of the capability to
direct the output of Output Processing
Instructions to Input Storage.
Every 15 minutes, the total rain is sent to Input
Storage. If the total is not equal to 0, output is
redirected to Final Storage Area 1, the time is
output and the total is sampled.
PROGRAM
*
Table 1 Program
01:
60.0
Execution Interval (seconds)
01:
Pulse (P3)
1:
1
Reps
2:
1
Pulse Input Channel
3:
2
Switch Closure
4:
1
Loc [ Precip_mm ]
5:
.254
Mult
6:
0
Offset
Содержание CR510
Страница 1: ...CR510 DATALOGGER OPERATOR S MANUAL REVISION 2 03 COPYRIGHT c 1986 2003 CAMPBELL SCIENTIFIC INC ...
Страница 2: ...This is a blank page ...
Страница 4: ...This is a blank page ...
Страница 10: ...This is a blank page ...
Страница 44: ...SECTION 1 FUNCTIONAL MODES 1 14 This is a blank page ...
Страница 56: ...SECTION 3 INSTRUCTION SET BASICS 3 8 ...
Страница 104: ...SECTION 8 PROCESSING AND PROGRAM CONTROL EXAMPLES 8 8 This is a blank page ...
Страница 128: ...SECTION 10 PROCESSING INSTRUCTIONS 10 8 This is a blank page ...
Страница 144: ...SECTION 12 PROGRAM CONTROL INSTRUCTIONS 12 10 This is a blank page ...
Страница 172: ...SECTION 14 INSTALLATION AND MAINTENANCE 14 10 This is a blank page ...
Страница 176: ...APPENDIX A GLOSSARY A 4 This is a blank page ...
Страница 184: ...This is a blank page ...
Страница 188: ...APPENDIX D DATALOGGER INITIATED COMMUNICATIONS D 4 This is a blank page ...
Страница 196: ...APPENDIX F MODBUS ON THE CR10 X AND CR510 F 4 This is a blank page ...
Страница 197: ...APPENDIX G TD OPERATING SYSTEM ADDENDUM FOR CR510 CR10X AND CR23X MANUALS ...
Страница 198: ...This is a blank page ...
Страница 200: ...This is a blank page ...
Страница 206: ...TABLE DATA ADDENDUM AD 6 This is a blank page ...
Страница 222: ...TD ADDENDUM SECTION 1 FUNCTIONAL MODES AD 1 8 This is a blank page ...
Страница 238: ...TD ADDENDUM SECTION 8 PROCESSING AND PROGRAM CONTROL EXAMPLES AD 8 10 This is a blank page ...
Страница 240: ...This is a blank page ...