Home > Store

LabVIEW for Data Acquisition

Register your product to gain access to bonus material or receive a coupon.

LabVIEW for Data Acquisition

Book

  • Sorry, this book is no longer in print.
Not for Sale

About

Features

  • Real-world programming techniques unique to each data acquisition application.
    • Demonstrates how LabVIEW can be customized to perform as an effective tool under a wide range of practical situations.

  • Graphics and illustrations.
    • Facilitates comprehension of these topics.

Description

  • Copyright 2001
  • Edition: 1st
  • Book
  • ISBN-10: 0-13-015362-1
  • ISBN-13: 978-0-13-015362-3

The practical, succinct LabVIEW data acquisition tutorial for every professional.

No matter how much LabVIEW experience you have, this compact tutorial gives you core skills for producing virtually any data acquisition (DAQ) application-input and output. Designed for every engineer and scientist, LabVIEW for Data Acquisition begins with quick-start primers on both LabVIEW and DAQ, and builds your skills with extensive code examples and visual explanations drawn from Bruce Mihura's extensive experience teaching LabVIEW to professionals.

  • Includes extensive coverage of DAQ-specific programming techniques
  • Real-world techniques for maximizing accuracy and efficiency
  • The 10 most common LabVIEW DAQ development problems-with specific solutions
  • Addresses simulation, debugging, real-time issues, and network/distributed systems
  • Preventing unauthorized changes to your LabVIEW code
  • An overview of transducers for a wide variety of signals
  • Non-NI alternatives for hardware and software

LabVIEW for Data Acquisition includes an extensive collection of real-world LabVIEW applications, lists of LabVIEW tips and tricks, coverage of non-NI software and hardware alternatives, and much more. Whatever data acquisition application you need to create, this is the book to start and finish with.

RELATED WEBSITE

The accompanying website includes an evaluation version of LabVIEW and key LabVIEW code covered in the book.

Downloads

CD Contents

Untitled Document

Download key LabVIEW code covered in the book.


Download your free trial version of the latest version of LabVIEW.

Sample Content

Table of Contents



Preface.


1. Learning LabVIEW for the First Time.

Introduction. VI Basics. LabVIEW Help. The Controls Palette (Front Panel Only). The Functions Palette (Block Diagram Only). Simple DAQ. Decisions, Decisions. The Sequence Structure. Arrays, Loops, Graphs, and Charts. SubVIs. Debugging Techniques. Clusters. File I/O. Deviations from Dataflow: Local and Global Variables. Property Nodes. Printing. Finding Objects in LabVIEW. Learning More.

2. Signals and DAQ.

Ohm's Law. Categories of Signals. Signal Conditioning. Keeping Time with DMA and FIFO. NI's DAQ Products.

3. Basic DAQ Programming Using LabVIEW.

Assign Device Numbers to DAQ Devices. LabVIEW DAQ Functions: An Overview. Using the Basic LabVIEW DAQ Functions to Display Data. LabVIEW File I/O with DAQ.

4. Simulation Techniques.

Soft Simulation. Hard Simulation.

5. DAQ Debugging Techniques.

LabVIEW's Debugging Tools. Tracking Down Bad Data. Solving Crashes. Last Resort.

6. Real-World DAQ Programming Techniques.

Programming Structure for DAQ. Analog Waveform Analysis. File I/O for DAQ. Averaging. Speed of Execution. Display Techniques. Alarms. Power Losses.

7. Transducers.

Temperature Transducers. Force and Pressure Transducers. Flow Rate Transducers. Position Transducers. Other Transducers.

8. Non-NI Hardware Alternatives.

Non-NI DAQ Hardware Companies. Homemade DAQ Hardware.

9. Real-Time Issues.

Timing in Operating Systems. Hardware Techniques for Real-Time DAQ. Software Techniques for Real-Time DAQ.

10. DAQ at a Distance-Networked and Distributed Systems.

General Networking Issues. Intranet DAQ. Locally Distributed DAQ Systems.

11. Alternate Software for DAQ.

LabWindows/CVI. Microsoft Visual Basic with DAQ (ComponentWorks). Microsoft Visual C++ with DAQ (ComponentWorks++). Other Programming Languages with DAQ.

12. Finalizing Your LabVIEW Software.

Finalizing Your LabVIEW Software on Your Development Computer. Moving Your LabVIEW Software to Other Computers.

Appendix A: Fundamentals: Bits, Bytes, Files, and Data.


Appendix B: Top Ten DAQ Problems and Their Solutions.


Appendix C: Saving LabVIEW's Vis.


Appendix D: Example Applications.


Appendix E: LabVIEW/DAQ Tips and Tricks.


Index.


About the Author.


About the Website.

Preface

Preface

I've been interested in gadgets and computers since grade school, particularly gadgets connected to computers. My first real gadget-to-computer project, at age 16, was an alarm for my car made from an Atari computer with 16 Kbytes of RAM and a photoresistor. I caught no car thieves, but I did catch a cat trying to steal a nap on my car! Six years later, I was more than a little happy to get my first job out of college at NI (National Instruments), where I worked for years as a LabVIEW developer, actually getting paid to connect gadgets to computers! I quickly learned that data acquisition is the professional term for connecting certain types of gadgets to computers, like the photoresistor in my first car alarm.

If you already have an NI data acquisition board with analog input connected to a computer with LabVIEW 6i, and you are dying to watch it work, skip right ahead to start on Chapter 3, up to and including Section 3.1.5, then come back here.

LabVIEW and Data Acquisition

This book is written for people who intend to use National Instruments' LabVIEW (Laboratory Virtual Instrument Engineering Workstation) for data acquisition. LabVIEW has become very popular as the programming language of choice in the context of industrial, scientific, academic, and laboratory environments. LabVIEW is a graphical programming language in which you build the programs with pictures, not words. Data acquisition involves connecting computers to a wide variety of gadgets via electronic signals; the computers then control these gadgets or read data from these gadgets. The term DAQ will be used throughout the book instead of data acquisition.

In general, any place that "scientific measurements" must be taken is an appropriate place for LabVIEW. Following are a few examples of LabVIEW applications:

  • Measuring pressure, temperature, and vibration in an airplane during the course of its flight
  • Monitoring the pH of a chemical solution during processing
  • Analyzing sound waves in an acoustics laboratory
  • Monitoring and recording flow rates of liquids or gasses

To use LabVIEW for any of these four example applications, you need the following four components:

  1. LabVIEW
  2. A computer on which LabVIEW can run
  3. A data acquisition device (changes an electrical signal into something the computer can read)
  4. A transducer (changes a wide variety of real-world phenomena, like pressure, temperature, pH, sound, etc., into an electrical signal for the data acquisition device)

National Instruments currently makes LabVIEW and a wide variety of data acquisition devices. If you are going to use LabVIEW, I recommend buying your data acquisition device from National Instruments, as it generally simplifies its integration with LabVIEW.

Because LabVIEW is a graphical programming language, it is often quicker to develop than using a text-based language, and its programs are often much more robust.

LabVIEW not only runs on all Microsoft operating systems starting with the word Windows, but it runs on Apple Macintosh O/S, Sun Microsystem's Solaris, and certain Hewlett-Packard workstations as well.

Organization

If you have never written a program before in any computer language, you will likely find this book difficult to follow—if this is the case, consider start-ing with the book LabVIEW for Everyone, described in Chapter 1, Section 1.1. Nobody learns how to program for the first time, in any language, without spending much time—usually more time than they expect. Be encouraged to know that LabVIEW, like Microsoft Visual Basic, is one of the least painful languages to learn.

Data acquisition is fundamental to many LabVIEW applications. For this reason, this book is written not quite as a "for dummies" book, but more from the "LabVIEW newcomer" point of view. Many people using LabVIEW for the first time want to do data acquisition—so if you are completely new to LabVIEW, Chapter 1 is designed to teach you just enough LabVIEW to perform some meaningful data acquisition.

Chapter 1: Learning LabVIEW for the First Time. This chapter is designed to teach a LabVIEW newcomer just enough to perform useful data acquisition with LabVIEW. It is meant to be the quickest LabVIEW tutorial ever, but as a result, it's a bit like taking a drink from a fire hose. This chapter is not explicitly DAQ-specific, but it subtly focuses on DAQ-related issues.

Chapter 2: Signals and DAQ. Learn or review the fundamentals of data acquisition that you will find relevant with LabVIEW--or with any pro-gramming language.

Chapter 3: Basic DAQ Programming Using LabVIEW. Combine Lab-VIEW with data acquisition at a very fundamental level. Use real hard-ware and real wires, and manipulate real signals in this chapter.

Chapter 4: Simulation Techniques. Most of your developing can be done without real hardware, right in the comfort of your home or office.

Chapter 5: DAQ Debugging Techniques. This chapter tells you how to track down bugs (with a focus on data acquisition programming), should you ever make a programming mistake.

Chapter 6: Real-World DAQ Programming Techniques. This chapter is a version of Chapter 3. In order to focus on data acquisition issues without being hindered by limitations of your specific device, all hardware is simulated in this chapter. The most common real-world scenarios are covered in detail in this chapter, and these scenarios often require the advanced techniques covered herein.

Chapter 7: Transducers. Exactly what device do you need to convert your temperature (or pressure, humidity, etc.) into a signal compatible with you data acquisition device? This chapter points you in the right direction.

Chapter 8: Non-NI Hardware Alternatives. Do you already have a data acquisition device that you want to use with LabVIEW? Or do you just want to save some money on your data acquisition device and have time to spare? Read this chapter.

Chapter 9: Real-Time Issues. Suppose you must collect data at a rate of exactly 10 Hz, or 10 times per second--it is unacceptable to wait 0.11 seconds between data samples. Such issues are not at all obvious, but they are covered in this chapter.

Chapter 10: DAQ at a Distance—Networked and Distributed Systems. Suppose your computer must be placed hundreds of feet from the data you're collecting. Or, suppose you have many data sites, widely separated from one another and your computer. This chapter is for you.

Chapter 11: Alternate Software for DAQ. Suppose you want to per-form data acquisition, but you want to use some software other than LabVIEW. For example, maybe you're already very familiar with another programming environment—see this chapter.

Chapter 12: Finalizing Your LabVIEW Software. Your LabVIEW soft-ware now works perfectly, and you don't want anybody changing it, not one bit! Here's how to accomplish that.

Appendix A: Fundamentals: Bits, Bytes, Files, and Data. If you have little programming experience or less, this appendix covers programming fundamentals that are needed in any programming language. LabVIEW is no exception! It is not enough to know how to draw pretty pictures; you must understand what's going on underneath.

Appendix B: Top Ten DAQ Problems and Their Solutions. You'll find answers to some common problems in this appendix.

Appendix C: Saving LabVIEW's VIs. It is not obvious that you can sometimes cause permanent damage to LabVIEW itself, not just to your application, if you make a common blunder described herein.

Appendix D: Example Applications. Here is a collection of real-world LabVIEW applications I've personally done, presented so that you can be aware of the abilities of which LabVIEW is capable.

Appendix E: LabVIEW/DAQ Tips and Tricks. Review this list at some point while learning LabVIEW—these are time-saving tips and tricks.

Requirements

This book assumes you have version 6i of LabVIEW; you will gain the most from this book if you work through its examples with version 6i. Its most relevant and powerful features will be illustrated in this book. Ideally, you also have one of NI's multifunction DAQ devices. To work perfectly with this book, your DAQ device should have at least two analog inputs, two digital I/O ports, a counter/timer, and an analog output. However, if your DAQ device doesn't have all of these features, then let's hope you won't need them, so you can just skip the parts of the book that use them.

If you're a programmer, but have never programmed in anything but text-based languages, get ready for a surprise. Figure P-1 shows a "simple" example program that ships with LabVIEW 6i, where the user interface is not shown—just the guts of the program.

DAQ, in the context of this book, means monitoring or controlling physical phenomena with a computer via electrical signals. These electrical signals are defined by their voltage or current levels, and are usually attached to some sort of scientific or industrial equipment by means of transducers that can convert physical values like pressure, temperature, position, flow rate, and so on to electricity (or vice versa). Most types of computers can interface to these transducers by means of DAQ devices. Companies like Agilent and Tektronix make a variety of high-quality, often specialized scientific instruments that perform very accurate and precise measurements, often in a laboratory environment. These instruments are generally connected to the computer via a special interface cable (GPIB, RS-232, etc.), but they can run without the computer connection, unlike the DAQ devices discussed in this book. These instruments will not be covered in this book to any great extent, even though they fit the definition as DAQ. They really are DAQ, in my opinion, but instead, we'll mostly use this book to describe DAQ as NI does—as generic analog and digital signals, because these signals are flexible enough to be used with an extremely wide variety of transducers. The usual example of the DAQ equipment discussed in this book is a device connected to a com-puter, which is also connected to a terminal block outside of the computer, reading or writing electrical signals connected to whatever you're interested in. Figure P-2 is a generic diagram of a typical DAQ system.

For many DAQ systems, the Signal Conditioning unit shown in Figure P- 2 may not be present—that unit might just be a simple connector block with no signal-conditioning electronics. In this case, it would be screw terminals or some sort of similar electrical/mechanical connection.

Going into a bit more detail, Figure P-3 shows more of the possible components of a DAQ system.

Figure P-4 shows what a DAQ system might really look like, using NI's SCXI hardware and built by someone who knows how to wire much more neatly than I.

A DAQ device may be a board inside the computer, or it might be some sort of external box connected to one of the computer's ports, such as the serial port (RS-232), a parallel port, USB, or IEEE 1394 (FireWire).

National Instruments categorizes LabVIEW's functionality into three parts:

  1. Acquire
  2. Analyze
  3. Present

LabVIEW is designed to seamlessly integrate these basic components of data acquisition, and it does a great job, in my opinion. The acquisition part of LabVIEW makes it very easy to quickly collect data from NI's DAQ devices, as you have discovered if you've already done the first section of Chapter 3 through Section 3.1.5. The analysis libraries available with the full development system have an amazing list of functions involving FFTs, (Fast Fourier Tranforms) power spectrums, RMS (Root Mean Square) calculations, filters, curve-fitting, and many other mathematical functions. The presenta-tion part of LabVIEW is perfectly tuned to very quickly present a wide variety data in a meaningful fashion.

One of NI's catch phrases is "The Software Is The Instrument." Or at least it used to be—I haven't heard that one in a while. At any rate, the comparison is that a modern lab can operate with a computer controlling everything, rather than with numerous separate instruments like oscilloscopes and func-tion generators. This approach not only makes it inherently easier to analyze, manipulate, and control your data, since the data source is always connected to the computer by default, but it also makes it easier to upgrade or modify your instrument configuration.

This book is written as if you have a PC running a Windows operating system—not a Macintosh, UNIX platform, or other type of setup. However, if you do not have a PC, most of the information presented in this book will still be useful, provided your platform can run LabVIEW. You will need to mentally substitute the PC's <Ctrl> and <Alt> keys for whatever the corresponding keys are for your computer's LabVIEW interface, and also try to recognize the PC-specific issues that differ on your computer.

Help! I'm Stuck!

You have quite a few options when you get stuck in LabVIEW. Here they are, in the order you should normally try.

  1. Ask a live person who knows LabVIEW. Ideally, there is somebody you work with, or know, who can answer some of your LabVIEW questions.
  2. Use LabVIEW's Help. See Chapter 1, Section 1.3 for details on Lab-VIEW's internal help.
  3. Internet help. Knowing how often Internet links die, I'm a bit reluctant to put any such links in this book, so I'll only put in a couple that I suspect will be around for a long time.
    First, try NI's Web site, www.ni.com. You can hunt around for help on the site, looking for links named "support" or "technical support" to begin with. Currently, the most helpful public forums seem to be info-labview, a busy LabVIEW mailing list, and the newsgroup comp.lang.labview; you will need to find these yourself, though, lest I give you broken links.
    Try a link to other links at my own Web site, whose availability is at the mercy of my ISP, at www.LCtechnology.com/lvhelp.htm. I will keep this current with your best Internet LabVIEW help options, at least for as long as I'm alive.
  4. Call NI. Currently, the number is 1-800-IEEE-488.
  5. Hire a consultant. NI has the National Instruments Alliance Pro-gram, which is a group of certifiable, uh, certified consultants like me, who can likely solve your technical problems relating to NI products. These companies range from one-man operations (such as mine at www.LCtechnology.com/consult.htm) to very large companies with better Web sites and hundreds of people.
  6. Give up. Let's hope it won't come to this!

Contacting Me

I may be a moron for giving out my email address, but I'm at bruce@LCtechnology.com, and you may need to include the code word OYGE in the subject line should I need to implement a spam filter someday. Please follow these rules:
  1. If you get stuck or find an error in the book, first try www.LCtechnology.com/lvhelp.htm to see if I've addressed the tough part of the book or the error. If it's not there, please email me!
  2. If you're a LabVIEW pro, and you think I've left something out of this book, consider that this book is also designed for beginners before saying that I should have included such-and-such feature of LabVIEW. Must keep book short.
  3. Please email me only if you have suggestions for improving the book.

Updates

Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020