File SDIG4.ZIP from The Programmer’s Corner in
Category Science and Education
SMALLDIG 4. Get points from graph using digitizing tablet. Also gives areas. Partial Ftn and ASM source included.
File Name File Size Zip Size Zip Type
KEYBRD.ASM 1563 667 deflated
KEYBRD.OBJ 123 120 deflated
SDIG4.EXE 44758 29795 deflated
SDIG4.FOR 7585 2842 deflated
SMALLDIG.DOC 6431 2579 deflated
TABLET.EXE 37070 22251 deflated
TABLET.FOR 2575 1118 deflated
TTONE.ASM 1843 918 deflated
TTONE.OBJ 194 184 deflated

## Contents of the SMALLDIG.DOC file

SMALLDIG 4
Read Points from a Graph with a Digitizing Tablet
by R. Thrun, August 1992

Frequently a scientist or engineer needs to use data from books or
reports. Often the data are shown in the form of a graph. To get the
data from the graph it is necessary to measure points on a curve and
apply scaling factors to the measurements. SMALLDIG is designed to
facilitate the process. SMALLDIG requires a small digitizing tablet
connected to COM1 on an IBM-compatible computer. The tablet may be a
Summagraphics MM 1201, its successor the Summasketch II, or any other
tablet that uses the same commands and provides information in the same
format. Many of the small tablets on the market are compatible with the
Summagraphics tablet.

The steps in using SMALLDIG and the tablet are as follows:
1. Tape the graph to the tablet.
2. Provide a filename for the output file.
3. Provide a title to be put on the first line of the file.
4. Put the cursor on an origin point, which does not have to
be (0,0), and click any one of the butttons on the cursor.
5. Give the coordinates of the origin.
6. Digitize another point on the same horizontal line as the
origin.
7. Tell how far apart the two points are, in graph units.
8. Digitize two points a know vertical distance apart.
If the points are the same, the horizontal and vertical
scales will be the same.
9. Tell how far apart the two vertically separated points are.
If the separation is zero, the horizontal and vertical
scales will be the same.
10. Put the cursor on a series of points and click one of the
buttons for each point.
11. Stop by digitizing a point in the STOP box, or by pressing
escape or control-C on the keyboard.

Steps 4, 5, 6, and 7 combine the operations of establishing the origin,
establishing the horizontal direction, and establishing the horizontal
scale. This is a convience and step-saver for most types of published
graphs. For some graphs it is better to separate these operations and
there are versions that do that.

At any time that the program is expecting input from the tablet, escape
or control-C typed in at the keyboard will stop the program. This
prevents the computer from getting locked up.

The program uses control boxes in the upper right corner ot the tablet.
One box will stop the program and close the output file. The other will
delete the last point in the list of points digitized. Deletions may be
repeated until there are no points left.

----------
You should make a | |
template like this | STOP |
and tape it to the | |
upper right corner | |
of the digitizing ----------
tablet. | DELETE |
The rectangles are | PREV. |
1.0 inches high | POINT |
and 0.7 inches wide. | |
----------

An improvement that could easily be added, if there were any request
for it, would be the ability to incorporate a line of text, typed in
from the keyboard, into the output file.

The output consists of a title and three columns of numbers: the
X-value, the Y-value, and the button number. The area under the curve
and the area enclosed by the curve are given at the end of the output.
The areas may be ignored. The area enclosed by the curve is gotten by
drawing a line from the last point to the first point. This is
necessary because the digitized perimeter will usually not close.

Summagraphics normally does not provide any information on how to
program for the tablet. The technical manual must be special ordered.
Some mouse emulator software and an AutoCAD driver come with the
tablet, but there is nothing to use the tablet for digitizing! SMALLDIG
was written to fill that void. This is not really the fourth version.
Actually, there were several versions that had various modifications by
various people and none of them had any documentation. SMALLDIG 4, as
presented here, is intended to be a clean version. Also, as the name
implies, there is a similar program for a larger Summagraphics tablet
with a different set of commands, but not many have a large tablet.

The complete Fortran source for SMALLDIG and assembly language
source for the keyboard and beep routines are given. I originally
attempted to open COM1 as a file in Fortran and then write to the file
and read from it. After much frustration and several calls to
Microsoft, I came to the conclusion that it was impossible to do
something as obvious as writing to and reading from a serial port. What
else would anyone want to do with a serial port? I had to use a
commercial subroutine library that included a communications package. I
can not include the unlinked communications package because of
copyright laws. The package was written by Alpha Computer Service. As
of 1986, their address was P.O. Box 2517, Cypress, Calif. 90630. I
have not seen any ads from them lately. The package was written for
Microsoft Fortran 3.30, which is what I originally used to write
SMALLDIG. It will not work with MS Fortran 3.31, but it does seem to
work with MS Fortran 5.0. The communications package, from 1985, only
supports COM1. I have a 1986 version for Lahey Fortran that supports
COM1 and COM2.

The input routine is written to take binary input from a tablet with
the factory default jumper settings. At one time I thought it would be
easier to read ASCII input. However, we also wanted to use the tablet
with a CAD program and the publisher of the program refused to support
anything other than the factory default settings. So why are the
jumpers on the board at all?

The TABLET program is also included. It simply gives the tablet
coordinates each time a button on the cursor is pressed. It was written
for debugging the input routines. It provides a handy way to see if the
tablet is working and for locating the boxes at the upper-right corner.

None of my code is copyrighted or restricted in any way. Only the
communications routines, which I can not include in .OBJ form, are