Digitizing With The 7470; Manual Method; Monitoring The Status Byte - HP 7470A Interfacing And Programming Manual

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

Advertisement

)
The timing of output depends on the plotter's interface (HP-IB, HP-IL,
)
or RS-232-C). Refer to A Brief Word about Plotter Output in Chapter 7
\
for more information.
The pen position and status are output to the computer as integers in
ASCII in the form:
X,Y,P [TERM]
where
X is the X-coordinate of the digitized point in plotter units,
Y is the Y-coordinate of the digitized point in plotter units,
P is the pen status when the point was entered (0 = pen
up, 1 = pen down), and
[TERM] is the output terminator for your system (refer to Chap­
ter 7).
The ranges of the X- and Y-coordinates are the mechanical limits of the
plotter as determined by the setting of the paper switch.
Upon receipt of the OD command by the plotter, bit position 2 of the
output status byte is cleared.
digitizing with the 7470
When using the plotter as a digitizer, it is important to ascertain that a
point has been entered before an attempt is made to retrieve that point
using the OD command. There are three methods for doing this.
'A
anual Method
The first method, which might be called the manual method, is easiest
to understand. It is not efficient in applications where many points will
be entered, or in an RS-232-C environment where the mainframe is not
adjacent to the plotter or where human intervention in program execu­
tion is not possible. The steps in this method are as follows:
1. In a program, send a DP command to the plotter. Follow the DP
command immediately with a statement that will cause the program
to display or print a message prompting you to enter a point. Follow
the prompt with a statement that will cause the program to pause
until instructed to continue. The BASIC statement PAUSE will
accomplish this.
2. Move the digitizing sight (pen) to the point to be entered, using front-
panel buttons. Final positioning should be done with the sight (pen)
down.
3. Press ENTER on the plotter's front panel. Now resume running of the
program. This is done on HP desktop computers by pressing the key
marked CONTINUE or CONT.
4 DIGITIZING
4. The program step following the pause will now be executed. The
next steps of the program, in order, should be an OD command to
the plotter, a read statement by the computer to read the X- a n d
Y-coordinates and the pen status, a statement to remove the prompt
(requesting you to enter a point) from the screen, and then steps to
process the digitized data in the appropriate manner.
Using this method, there is no need to monitor the status byte because
the program does not proceed to the OD command until the user enters
a point and causes the program to resume.
A simpler procedure, using OA or OC instead of OD, can also be used.
It omits the DP in step 1 and pressing
ENTER
in step 3. Using the
shorter procedure with OC makes it possible to obtain coordinate
values in user units. Refer to Chapter 7.
A short program to digitize a single point and display the coordinates
and pen status is given below. The program is in BASIC for an HP-85
with an HP-IB interface. An I/O ROM is required in order to execute
the ENTER statement to obtain the digitized point.
10 PRINTER I S
7 0 5 , 8 0
20 PRINT " D P ; "
30 DISP "ENTER R POINT"
40 PAUSE
50 PRINT "OD;"
60 ENTER 705 ; X,Y,P
70 DISP X;Y;P
80 END
Monitoring the Status Byte
The second method can be used with any interface and is the only
method of checking based on software that can be done in an RS-232-C
environment. This method monitors bit position 2, the third least signifi­
cant bit, of the plotter's status byte which is set when a digitized point
is available. Refer to The Output Status Instruction, OS, Chapter 7 for
more information.
Monitoring bit position 2 can be done in a variety of ways depending
on the commands available on the computer being used. If there are
instructions to check bits directly, the third least significant bit (lsb)
should be checked for the occurrence of a 1. If no bit operations are
available, the status byte can be operated on arithmetically to check for
the availability of a digitized point. Executing successive divisions of a
number by two and checking for an odd or even integer answer is a
common way of monitoring bits without converting the number to
binary form. Either of the following sequences of BASIC instructions
DIGITIZING
6-5

Advertisement

Table of Contents
loading

Table of Contents