Table Of ContentData Acquisition
Techniques Using
Personal Computers
Howard Austerlitz
CYBEX
A Division of Lumex, Inc.
Ronkonkoma, New York
Academic Press, Inc.
Harcourt Brace Jovanovich, Publishers
San Diego New York Boston
London Sydney Tokyo Toronto
Front cover photograph courtesy of International Business Machines Corporation.
This book is printed on acid-free paper. @
Copyright © 1991 by A C A D E M I C PRESS, INC.
All Rights Reserved.
No part of this publication may be reproduced or transmitted in any form or by any
means, electronic or mechanical, including photocopy, recording, or any information
storage and retrieval system, without permission in writing from the publisher.
IBM PC, PC/XT, PC/AT, PS/2, PC DOS and Micro Channel are trademarks of IBM Corporation.
MS DOS, Microsoft Windows and Microsoft C are trademarks of Microsoft Corporation.
OS/2 is a trademark of Microsoft and IBM Corporation. Unix is a trademark of AT&T
Information Systems. Apple Macintosh is a trademark of Apple Computer, Inc. Nu Bus is
a trademark of Texas Instruments. Intel is a trademark of Intel Corporation. Motorola is a
trademark of Motorola Corporation. Lotus 1-2-3 and Symphony are trademarks of Lotus
Corporation. ASYST is a trademark of Keithley Asyst. LABTECH NOTEBOOK is a
trademark of Laboratory Technologies Corporation.
Academic Press, Inc.
San Diego, California 92101
United Kingdom Edition published by
Academic Press Limited
24-28 Oval Road, London NW1 7DX
Library of Congress Cataloging-in-Publication Data
Austerlitz, Howard.
Data acquisition techniques using personal computers / Howard
Austerlitz.
p. cm.
Includes bibliographical references and index.
ISBN 0-12-068370-9
1. Microcomputers. 2. Automatic data collection systems.
3. Computer interfaces. I. Title.
TK7888.3.A872 1991
04.6' 16-dc20 91-2754
CIP
PRINTED IN THE UNITED STATES OF AMERICA
91 92 93 94 9 8 7 6 5 4 3 2 1
To my wife Kiel,
whose guidance and understanding
made it all possible
Preface
In recent years personal computers (PCs) have become common fixtures
in most laboratories due to their low cost and wide range of hardware and
software support . They have replaced minicomputers as de facto plat-
forms for data acquisit ion sys tems. Data Acquisition Techniques Using
Personal Computers is intended to be a tutorial and reference for engi-
neers , scientists , s tudents , and technicians interested in using personal
computers for data acquisition and analysis.
It is assumed that the reader knows the basic workings of personal
computers and electronic hardware , although these aspects will be re-
viewed briefly in this work. Sources listed in the bibliography are good
introductions to many of these topics .
Only the family of IBM PCs and compatible systems (PC/XT/AT
computers) will be covered in any great detail here , since they represent
the largest hardware and software support base for scientific and engi-
neering applicat ions. Howeve r , I B M ' s PS/2 systems (based on Micro
Channel) and Apple ' s Macintosh II computers (based on NuBus) will be
covered briefly.
This book stresses " r e a l " applications and includes specific exam-
ples as well as a survey of commercial ly available hardware and software
products . It is intended to provide all the information you need to set up a
data acquisit ion system based on a personal computer . In addition, it will
serve as a useful reference on personal computer technology.
The area of software is as important as hardware , if not more so.
Software topics , such as programming languages, interfacing to a PC ' s
software environment , and data analysis techniques , are covered in de-
tail, along with a survey of commercial data acquisition application pro-
grams.
Throughout this work, the term personal computer will refer to a
generic machine . It can be an Apple Macintosh or an IBM PS/2 system.
The abbreviated term PC will imply an IBM P C / X T / A T system or com-
patible, based on an Intel 80x86 family microprocessor and running
MS-DOS (or IBM DOS) software.
xi
xi Preface
I wish to acknowledge the many people who helped me with this
undertaking. My thanks to Academic Press for getting the project started
and seeing it through to its conclusion. I am grateful for the assistance I
received from manufacturers in the data acquisition field, including Ved
Vasconcelos from Keithley Metrabyte , Kate Kressman from Keithley
Asyst , Shari Worthington from Labora tory Technologies, and Iris Polaski
from Burr-Brown/Intel l igent Instrumentat ion. I also wish to thank every-
one at C Y B E X who helped me, especially Jim Smith. Finally, I want to
acknowledge Orndorff, the lap-top editor who kept me company during
all those late nights at my PC.
Howard Austerli tz
C H A P T E R
m
Introduction to
Data Acquisition
Data acquisit ion, in the general sense , is the process of collecting informa-
tion from the real world. For most engineers and scientists these data are
mostly numerical and usually collected, stored, and analyzed using a
computer . The use of a compute r automates the data acquisition process ,
enabling the collection of more data in less time with fewer errors . This
book deals solely with automated data acquisition using personal com-
puters .
An illustrative example of the utility of automated data acquisition is
measuring the tempera ture of a heated object versus time. Human observ-
ers are limited in how fast they can record readings (say, every second, at
best) and how much data can be recorded before errors due to fatigue
occur (perhaps after 5 minutes or 300 readings). An automated data acqui-
sition system can easily record readings for very small time intervals (i .e. ,
much less than a millisecond), continuing for arbitrarily long time periods
(limited mainly by the amount of storage media available). In fact, it is
easy to acquire too much data , which can complicate the subsequent
analysis. Once the data are stored in a computer , they can be displayed
graphically, analyzed, or otherwise manipulated.
Most real-world data are not in a form that can be directly recorded
by a computer . These quantit ies typically include tempera ture , pressure ,
dis tance, velocity, mass , and energy output (such as optical, acoust ic ,
and electrical energy) . Very often these quantit ies are measured versus
time or posit ion. A physical quanti ty must first be converted to an electri-
cal quanti ty (voltage, current , or resistance) using a sensor or transducer.
This enables the data to be condit ioned by electronic instrumentat ion,
1
2 CHAPTER 1 Introduction to Data Acquisition
which operates on analog signals or waveforms (a signal or waveform is
an electrical parameter , most often a voltage, that varies with time). This
analog signal is continuous and monotonie, that is, its values can vary
over a specified range (for example , somewhere between - 5 . 0 volts and
+ 3.2 volts). The values can change an arbitrarily small amount within an
arbitrarily small time interval.
To be recorded (and understood) by a computer , data must be in
digital form. Digital waveforms have discrete values (only certain values
are allowed) and have a specified (usually constant) time interval between
values. This gives them a " s t e p p e d " (noncontinuous) appearance , as
shown by the digitized sawtooth in Figure 1-1. When this time interval
becomes small enough, the digital waveform becomes a good approxima-
tion of the analog waveform. If the transfer function of the t ransducer and
the analog instrumentat ion is known, the digital waveform can be an
accurate representat ion of the time-varying quantity to be measured.
The process of convert ing an analog signal to a digital one is called
analog-to-digital convers ion, and the device that does this is an analog-to-
digital conver ter (ADC). The resulting digital signal is usually an array of
digital values of known range (scale factor) separated by a fixed time
interval (or sampling interval). If the values are sampled at irregular time
intervals, the acquired data will contain both value and time information.
The reverse process of convert ing digital data to an analog signal is
called digital-to-analog convers ion, and the device that does this is called
a digital-to-analog conver ter (DAC). Some common applications for
DACs include control sys tems, waveform generators , and speech synthe-
sizers.
A general purpose laboratory data acquisition system typically con-
sists of A D C s , D A C s , and simple digital inputs and outputs . Figure 1-2 is
(a) Analog Waveform (b) Digitized Waveform
Figure 1-1 Comparison of analog and digitized waveforms: (a) sawtooth analog
waveform and (b) a coarse digitized representation.
Introduction to Data Acquisition 3
Mass
Keyboard Display Storage
I τ I
COMPUTER
I
Digital Digital
Inputs ADC DAC Outputs
zu
^ Multiplexer | | ^ u r r j ^ e x e r
Analog Inputs Analog Outputs
TTTT ΊΤΤΤΤ
Inputs from Sensors Outputs to Controls
Figure 1-2 Simplified block diagram of a data acquisition system.
a simplified block diagram of such a system. Note that additional channels
are often added to an A D C or D A C via a multiplexer (or mux), used to
select which one of the several analog input signals to convert at any
given t ime. This is an economical approach when all the analog signals do
not need to be simultaneously monitored.
Economics is a major rationale behind using personal computers for
data acquisit ion sys tems. The typical data acquisition system of 10-15
years ago, based on a minicomputer , cost about 20 times as much as
today ' s sys tems , based on personal computers , at around the same per-
formance levels. This is largely due to the continuing decrease of elec-
tronic component costs along with increased functionality (more .logic
elements in the same package) . Since personal computers have become
commonplace in most labs, the cost of implementing a data acquisition
system is often jus t the price of an add-in board and support software,
which is usually a modera te expense .
There are , of course , applications where a data acquisition system
based on a personal compute r is not appropriate and a more expensive,
dedicated system should be used. The important system parameters for
making such a decision include sampling speed, accuracy, resolution,
4 CHAPTER 1 Introduction to Data Acquisition
amount of data , multitasking capabilities, and the required data process-
ing and display.
Personal computer-based systems have certain limitations in these
areas , especially regarding sampling speed and handling large amounts of
data. However , newer , high-performance personal computers keep
"pushing the edge of the e n v e l o p e " ; they can out-perform dedicated data
acquisition sys tems. The evolution of the PCs based on the Intel 8 0 x 8 6
microprocessor (or CPU) family, the IBM P C / X T / A T , PS/2 , and compat-
ible sys tems, is demonst ra ted in Table 1-1, showing bus width and the
amount of available memory space.
In recent years , Apple ' s Macintosh computer line has gained popu-
larity as a platform for data acquisition, now that a nonproprietary inter-
face, N u B u s , is used. These machines , based on the Motorola 68000
family of microprocessors , have certain advantages , including a graphi-
cal, consistent operating environment (using icons) and a linear memory
addressing space. (The segmented addressing space of the Intel 8 0 x 8 6
family will be discussed in Chapter 5.)
Software is as important to data acquisition systems as hardware
capabilities. Inefficient software can waste the usefulness of the most able
data acquisition hardware system. Conversely, well-written software can
squeeze the maximum performance out of mediocre hardware . Software
selection is at least as important as hardware selection and often more
complex.
Data acquisition software controls not only the collection of data but
also its analysis and eventual display. Ease of data analysis and presenta-
tion are the major reasons behind using computers for data acquisition in
the first place. With the appropriate software, computers can process the
TABLE 1-1
INTEL 80x86 CPU Family Bus Width Characteristics
CPU DATA BUS SIZE ADDRESS BUS SIZE MEMORY SPACE
(bits) (bits) (Mbytes)
8086 16 20 1
8088 8 20 1
80286 16 24 16
80386 32 32 4096
80486 32 32 4096
Introduction to Data Acquisition 5
acquired data and produce outputs in the form of tables or plots . Without
these capabili t ies, the equipment is not much more than a sophisticated
(and expensive) data recorder .
An additional area of software use is that of control . Computer
outputs may control some aspects of the system that is being measured,
as in au tomated industrial process controls . The software must be able to
measure system paramete rs , make decisions based on those measure-
ments , and vary the compute r outputs accordingly. For example , in a
tempera ture regulation system, the input would be a temperature sensor
and the output would control a heater . In control applications, software
reliability and response time are paramount . Slow or erroneous software
responses could cause physical damage.
A plethora of commercial ly available PC-based software packages
can collect, analyze , and display data graphically, using little or no pro-
gramming (see Chapte r 11). This software allows the user to concentra te
on the application instead of worrying about the mechanics of getting data
from point A to point Β or how to plot a set of Cartesian coordinates .
Many commercial software packages contain all three capabilities of data
acquisit ion, analysis , and display (the so-called integrated packages) ,
while others are optimized for only one or two of these areas .
The important point is that you do not have to be a computer expert
or even a programmer to implement an entire personal computer-based
data acquisit ion sys tem. Best of all, you do not have to be rich, either.
The next chapter examines the world of analog signals and their
t ransducers , the "front e n d " of any data acquisition system.