TD ADDENDUM—SECTION 8. PROCESSING AND PROGRAM CONTROL EXAMPLES
AD-8-5
8.4 INTERRUPT SUBROUTINE USED
TO COUNT SWITCH CLOSURES
(RAIN GAGE)
Subroutines given the label of 97 or 98 will be
executed when control ports 7 or 8,
respectively, go high (5 V, see Instruction 85,
Section 12). In this example, Subroutine 98 and
control port 8 are substituted for a pulse
counting channel to count switch closures on a
tipping bucket rain gage.
The subroutine adds 0.254 (mm, bucket
calibrated for 0.01 inch tip) to an input location
and uses Instruction 22 to delay 0.2 seconds.
The delay is to insure that any switch bouncing
(when closing, the contacts actually bounce off
each other, making and breaking the circuit
several times) has died out before the
subroutine is completed. (The pulse count
inputs do this automatically.) Without the delay,
the subroutine could be completed and called
again by a bounce, causing false counts. The
interrupt has no effect while the subroutine is
still being executed.
Subroutine 98 is in effect keeping a running
total in Input Storage. On the output interval,
this total is sampled to Final Storage and
zeroed by the program in Program Table 1.
To provide comparison, this example has the 2
pulse inputs also reading rain gages. (In a real
situation, it is more likely that the pulse counters
would be used for 2 wind speeds.) In Program
Table 1, the 2 normal pulse inputs are read and
the hourly totals output to Final Storage with
Instruction 72.
The rain gage is connected as diagrammed
below. When the switch closes, 5 volts is
applied to port 8 which causes the subroutine to
be executed.
FIGURE 8.4-1. Connections for Rain Gage
Input location Assignments:
10:Rain_1
(from Pulse count)
11:Rain_2
(from Pulse count)
12:Rain_3
(from subroutine 98 while
Output Flag is low)
*
1
Table 1 Programs
01:
10
Sec. Execution Interval
01:
P3
Pulse
01:
2
Reps
02:
1
Pulse Input Chan
03:
2
Switch closure
04:
10
Loc [:Rain_1 ]
05:
.254
Mult
06:
0
Offset
02:
P84
Data Table
01:
0
Seconds into interval
02: 3600
Seconds interval
03:
0
Records (0=auto; -=redirect)
03:
P72
Totalize
01:
2
Reps
02:
10
Loc Rain_1
04:
P70
Sample
01:
1
Reps
02:
12
Loc Rain_3
05:
P92
If time is
01:
0
seconds into a
02: 3600
second interval
03:
30
Then Do
06:
P30
Z=F
01:
0
F
02:
0
Exponent of 10
03:
12
Z Loc [:Rain_3 ]
07:
P95
End
08:
P
End Table 1
*
3
Table 3 Subroutines
01:
P85
Beginning of Subroutine
01:
98
Subroutine Number
02:
P
34 Z=X+F
01:
12
X Loc Rain_3
02:
.254
F
03:
12
Z Loc [:Rain_3 ]
03:
P22
Excitation with Delay
01:
1
EX Chan
02:
0
Delay w/EX (units=.01sec)
03:
20
Delay after EX (units=.01sec)
04:
0
mV Excitation
04:
P95
End
05:
P
End Table 3
Содержание CR23X
Страница 8: ...CR23X TABLE OF CONTENTS vi This is a blank page ...
Страница 12: ...CR23X MICROLOGGER OVERVIEW OV 2 1 2 3 A 4 5 6 B 7 8 9 C 0 D FIGURE OV1 1 CR23X Micrologger ...
Страница 34: ...CR23X MICROLOGGER OVERVIEW OV 24 This is a blank page ...
Страница 50: ...SECTION 1 FUNCTIONAL MODES 1 16 This is a blank page ...
Страница 72: ...SECTION 4 EXTERNAL STORAGE PERIPHERALS 4 8 This is a blank page ...
Страница 88: ...SECTION 6 9 PIN SERIAL INPUT OUTPUT 6 10 This is a blank page ...
Страница 103: ...SECTION 7 MEASUREMENT PROGRAMMING EXAMPLES 7 15 CR23X AVW1 FIGURE 7 15 2 Well Monitoring Example ...
Страница 110: ...SECTION 7 MEASUREMENT PROGRAMMING EXAMPLES 7 22 This is a blank page ...
Страница 134: ...SECTION 8 PROCESSING AND PROGRAM CONTROL EXAMPLES 8 24 This is a blank page ...
Страница 164: ...SECTION 9 INPUT OUTPUT INSTRUCTIONS 9 30 This is a blankpage ...
Страница 188: ...SECTION 11 OUTPUT PROCESSING INSTRUCTIONS 11 8 This is a blankp age ...
Страница 221: ...SECTION 13 CR23X MEASUREMENTS 13 21 FIGURE 13 5 1 Circuits Used with Instructions 4 9 ...
Страница 229: ...14 3 1 2 3 A 4 5 6 B 7 8 9 C 0 D FIGURE 14 3 1 CR23X Battery Pack and Panel ...
Страница 239: ...SECTION 14 INSTALLATION AND MAINTENANCE 14 13 S A N Y O FIGURE 14 11 6 Removal of band clamp and battery ...
Страница 240: ...SECTION 14 INSTALLATION AND MAINTENANCE 14 14 This is a blank page ...
Страница 244: ...APPENDIX A GLOSSARY A 4 This is a blank page ...
Страница 268: ...APPENDIX B CONTROL PORT SERIAL I O INSTRUCTION 15 B 24 This is a blank page ...
Страница 276: ...APPENDIX C BINARY TELECOMMUNICATIONS C 8 This is a blank page ...
Страница 278: ...This is a blank page ...
Страница 282: ...APPENDIX F DYNAGAGE SAP FLOW P67 F 4 This is a blank page ...
Страница 299: ...APPENDIX I TD OPERATING SYSTEM ADDENDUM FOR CR510 CR10X AND CR23X MANUALS ...
Страница 300: ...This is a blank page ...
Страница 302: ...This is a blank page ...
Страница 308: ...TABLE DATA ADDENDUM AD 6 This is a blank page ...
Страница 324: ...TD ADDENDUM SECTION 1 FUNCTIONAL MODES AD 1 8 This is a blank page ...
Страница 340: ...TD ADDENDUM SECTION 8 PROCESSING AND PROGRAM CONTROL EXAMPLES AD 8 10 This is a blank page ...
Страница 342: ...This is a blank page ...
Страница 373: ...This is a blank page ...