Hp-Ib Interrupts And Polling - HP 7470A Interfacing And Programming Manual

Graphic plotter
Hide thumbs Also See for HP 7470A:
Table of Contents

Advertisement

)
)
)
)
)
)
)
)
)
)
)
:>
)
)
\
o
o
o
( )
( )
( )
i )
o
o
( )
( )
I )
will check the proper bit of the status byte. Insert as line 110 or line
1010 a suitable BASIC read statement to read the status byte into a
variable called Status.
100 PRINT "OS;"
110
I STORE STRTUS BYTE IN Status
120 Status-INTCStatus/2) (SHIFTS BITS RIGHT ONE POSITION
130 Status-INTCStatus/2) ISHIFTS BITS RIGHT RGRIN
140 Status-Status MOD 2
ITHIS RESULT IS 0 IF LSB NOT 1
150 IF Status-0 THEN 100
160 PRINT "OD;"
ISEND OD SINCE POINT RVRILRBLE
1000 PRINT " O S ; "
1010
! STORE STRTUS BYTE I N
S t a t u s
1020 S t a t u s - I N T C S t a t u s / " ! )
I S H I F T S B I T S RIGHT 2 POSITIONS
1030 I F
S t a t u s - I N T ( S t a t u s / 2 ) * 2
THEN 1000
M s b
NOT 1
1040 PRINT " O D ; "
On some HP computers with an I/O ROM, the following three lines are
equivalent to lines 100 to 150 of the first program segment shown.
2 0 0 0 PRINT
" O S ; "
2 0 1 0
I T H I S I S THE STRTEMENT
2 0 5 0 I F
B I T ( S t a t u s , 2 ) - 0
THEN 2 0 0 0
TO RERD THE STRTUS
In many applications, a large number of points need to be digitized.
When the computer is used to monitor bit position 2, the points may or
may not be processed immediately. In most applications, memory would
be allocated for the total number of points to be digitized. A loop would
be established to process the total number of points, calling the sub­
routine each time to check that a point had been entered. A complete
BASIC program for an HP-85 with an HP-IB interface follows. This
program prints out the 500 points after they all have been entered.
F
X ( C ) , Y ( C ) , P ( C )
2
5 0 0
10 PRINTER IS 705,80
20 OPTION BRSE 1
30 INTEGER X(500),Y(500),P(500)
40 FOR C-1 TO 500
50 PRINT "DP;"
60 DISP "ENTER POINT ";C
70 GOSUB 160
80 PRINT "OD;"
90 ENTER 705 ;
100 NEXT C
110 PRINTER IS
120 FOR C-1 TO
130 PRINT XCC);Y(C);P(C)
140 NEXT C
150 STOP
160 ! Check SUBROUTINE
170 PRINT "OS;"
180 ENTER 705 ; S
190 S-INT(S/'4)
200 IF S-INT(S/2)*2 THEN 170
210 RETURN
220 END
HP-IB Interrupts and Polling
A third method can be used by advanced programmers thoroughly
familiar with the HP-IB interface, polling techniques, a n d interrupts. It
should only be used when the computer can perform useful tasks while
waiting for the digitized point to be entered. This method involves
setting a value of 4 in the S-mask of the IM command, e.g., IM 2 2 3 , 4 , 0 ;
to cause the plotter to generate an RQS (service request) when a
digitized point is available. With an interrupt routine enabled for
service requests, the computer can send a DP command to initiate
digitizing, and then proceed with some other task until the digitized
point is entered. When the point is available, the computer is interrupted
by the RQS, and program execution branches to the routine to process
the digitized data. This routine could simply send an OD command and
read the digitized point, or it could perform bit checking of the plotter
status byte if multiple S-mask values have been specified to generate
the RQS. The status byte can be obtained by serial polling or simply by
sending an OS command. Because interrupts and polling are highly
machine-dependent and beyond the scope of this manual, no examples
are given.
I
V )
C )
(
)
(
>6 DIGITIZING
v
)
DIGITIZING 6-7
„__,*■■»

Advertisement

Table of Contents
loading

Table of Contents