Interrupt Programming - HP 82479A Owner's Manual

Data acquisition pac
Table of Contents

Advertisement

Getting Started
2.10.4 Interrupt Programming
The HP 3421A may be configured to cause an interrupt (SRQ) which signals the HP-71 that an event has
occurred. The following example illustrates the use of the keywords in the Data Acquisition Pac for an
interrupt programming problem.
For further details, refer to section 3, "Keywords," and to chapter 6 in
the HP 3421A Data Acquisition/Control Unit Operating, Programming, and Configuration Manual.
In this example, the HP 3421A monitors a switch connected to a frozen food locker in a restaurant.
When the door opens or closes, it momentarily closes a switch connected to a § volt power supply and the
input channel 0 of a digital I/O card in slot 2. A T type thermocouple inside the locker is connected to
channel 3 of a multiplexer card in slot 0. The restaurant manager wants a printout of the time of each
switch closure and the temperature inside the locker when the switch closes. The program waits § seconds
after each closure to avoid switch bounce problems as the door closes. The HP-71 is connected to the
HP 3421A and a ThinkJet Printer. The program will run until the [Q] key is pressed.
LREEES F
P D
Imitial ize HRPS421
Ter IMIT=421 ® OFTION [DE
"tzs
"Ss TIME®
f+
SE FEIMT
"Frogram
sta
= OF IHTRE GOTO
1686
G68 EHABLE
IHTE
SEOSETSREE 2
gE MONITOR HIGH 28
et up branch
Ermable
interrupts
Ermatile SEE
in HRz24:21
Momitor channel
28
CEC RUTOTON OH
Erable auto ID0OY MEET AQEE
mE
IF EEY#="0" THEH
148 ELSE =8
Ernd program on
[0]
key
HE
laa
U V
Interrupt
service rot ine
11a OFF
IHTE
1a
FREIMT
TIMEf:s"™
"sTOOURLEC"T"
DCYOLTS Sa BFEFTEMF CZ) 2
128 WRIT 5 & COTO 26
b P
Return to malin program
14a
|
158 FEIMT
"Frogram emcl=:
"i TIMES®
led OFF
IHTE @® EHD
The keywords ITHIT=Z4:21, OFTION
DEGREES, SETZREE MONITOR, AUTOIDY, TCOUFLE,
QENOLTS, and HEF TEMF are discussed in section 3, "Keywords." Line 120 of the program prints the
time and temperature using the TI ME# and TCOUFLLE functions. Note that the DCW. T= function is
used to obtain the thermocouple voltage, and the FFF TEMF function is used to obtain the reference
temperature for the TLE function, which then returns the calculated temperature.
2-12

Advertisement

Table of Contents
loading

Table of Contents