Tải bản đầy đủ

LabVIEW for everyone

LabVIEW for Everyone: Graphical Programming Made Easy and Fun, Third Edition
By Jeffrey Travis, Jim Kring
Publisher: Prentice Hall
Pub Date: July 27, 2006
Print ISBN-10: 0-13-185672-3
Print ISBN-13: 978-0-13-185672-1
Pages: 1032

Table of Contents | Index

The #1 Step-by-Step Guide to LabVIEWNow Completely Updated for LabVIEW 8!

Master LabVIEW 8 with the industry's friendliest, most intuitive tutorial: LabVIEW for Everyone,
Third Edition. Top LabVIEW experts Jeffrey Travis and Jim Kring teach LabVIEW the easy way:
through carefully explained, step-by-step examples that give you reusable code for your own

This brand-new Third Edition has been fully revamped and expanded to reflect new features and
techniques introduced in LabVIEW 8. You'll find two new chapters, plus dozens of new topics,

including Project Explorer, AutoTool, XML, event-driven programming, error handling, regular
expressions, polymorphic VIs, timed structures, advanced reporting, and much more. Certified
LabVIEW Developer (CLD) candidates will find callouts linking to key objectives on NI's newest
exam, making this book a more valuable study tool than ever.
Not just what to do: why to do it!
Use LabVIEW to build your own virtual workbench
Master LabVIEW's foundations: wiring, creating, editing, and debugging VIs; using controls
and indicators; working with data structures; and much more
Learn the "art" and best practices of effective LabVIEW development
NEW: Streamline development with LabVIEW Express VIs
NEW: Acquire data with NI-DAQmx and the LabVIEW DAQmx VIs
NEW: Discover design patterns for error handling, control structures, state machines, queued
messaging, and more
NEW: Create sophisticated user interfaces with tree and tab controls, drag and drop,

subpanels, and more
Whatever your application, whatever your role, whether you've used LabVIEW or not, LabVIEW
for Everyone, Third Edition is the fastest, easiest way to get the results you're after!

LabVIEW for Everyone: Graphical Programming Made Easy and Fun, Third Edition
By Jeffrey Travis, Jim Kring
Publisher: Prentice Hall
Pub Date: July 27, 2006
Print ISBN-10: 0-13-185672-3
Print ISBN-13: 978-0-13-185672-1
Pages: 1032

Table of Contents | Index

About the Authors
Chapter 1. What in the World Is LabVIEW?
Key Terms
What Exactly Is LabVIEW, and What Can It Do for Me?
Demonstration Examples
Wrap It Up!
Additional Activities
Chapter 2. Virtual Instrumentation: Hooking Your Computer Up to the Real World
Key Terms
Using LabVIEW in the Real World
The Evolution of LabVIEW
What Is Data Acquisition?
What Is GPIB?
Communication Using the Serial Port
Real-World Applications: Why We Analyze
A Little Bit About PXI and VXI
LabVIEW Add-on Toolkits
LabVIEW Real-Time, FPGA, PDA, and Embedded
Wrap It Up!
Chapter 3. The LabVIEW Environment
Key Terms
Front Panels
Block Diagrams
LabVIEW Projects
SubVIs, the Icon, and the Connector

Activity 3-1: Getting Started
Alignment Grid
Pull-Down Menus
Floating Palettes
The Toolbar
Pop-Up Menus
Express VIs
Displaying SubVIs as Expandable Nodes
A Word About SubVIs
Activity 3-2: Front Panel and Block Diagram Basics
Wrap It Up!
Chapter 4. LabVIEW Foundations
Key Terms
Creating VIs: It's Your Turn Now!
Activity 4-1: Editing Practice
Basic Controls and Indicators and the Fun Stuff They Do
Wiring Up
Running Your VI
Useful Tips
Wrap It Up!
Additional Activities
Chapter 5. Yet More Foundations
Key Terms
Loading and Saving VIs
Debugging Techniques
Activity 5-1: Debugging Challenge
Creating SubVIs
Documenting Your Work
A Little About Printing
Activity 5-2: Creating SubVIsPractice Makes Perfect
Wrap It Up!
Additional Activities
Chapter 6. Controlling Program Execution with Structures
Key Terms
Two Loops
Shift Registers
The Case Structure
The Sequence StructureFlat or Stacked
The Timed Structures
The Formula Node

The Expression Node
The While Loop + Case Structure Combination
Wrap It Up!
Additional Activities
Chapter 7. LabVIEW's Composite Data: Arrays and Clusters
Key Terms
What Are Arrays?
Creating Array Controls and Indicators
Using Auto-Indexing
Two-Dimensional Arrays
Activity 7-1: Building Arrays with Auto-Indexing
Functions for Manipulating Arrays
Activity 7-2: Array Acrobatics
Activity 7-3: Polymorphism
Compound Arithmetic
All About Clusters
Interchangeable Arrays and Clusters
Error Clusters and Error-Handling Functions
Wrap It Up!
Additional Activities
Chapter 8. LabVIEW's Exciting Visual Displays: Charts and Graphs
Key Terms
Waveform Charts
Activity 8-1: Temperature Monitor
Activity 8-2: Graphing a Sine on a Waveform Graph
XY Graphs
Chart and Graph Components
Activity 8-3: Using an XY Graph to Plot a Circle
Activity 8-4: Temperature Analysis
Intensity Charts and GraphsColor as a Third Dimension
Time Stamps, Waveforms, and Dynamic Data
Mixed Signal Graphs
Exporting Images of Charts and Graphs
Wrap It Up!
Additional Activities
Chapter 9. Exploring Strings and File I/O
Key Terms
More About Strings
Using String Functions
Activity 9-1: String Construction
Parsing Functions

Activity 9-2: More String Parsing
File Input/Output
Wrap It Up!
Additional Activities
Chapter 10. Signal Measurement and Generation: Data Acquisition
Key Terms
DAQ and Other Data Acquisition Acronyms
How to Connect Your Computer to the Real World
Signals 101
Selecting and Configuring DAQ Measurement Hardware
Wrap It Up!
Solutions to Activities
Chapter 11. Data Acquisition in LabVIEW
Key Terms
Understanding Analog and Digital I/O
NI-DAQmx Tasks
Advanced Data Acquisition
Wrap It Up!
Chapter 12. Instrument Control in LabVIEW
Key Terms
Instrumentation Acronyms
Connecting Your Computer to Instruments
SCPI, the Language of Instruments
VISA: Your Passport to Instrument Communication
Instrument Control in LabVIEW
Wrap It Up!
Chapter 13. Advanced LabVIEW Structures and Functions
Key Terms
Local, Global, and Shared Variables
Property Nodes
Invoke Nodes
Event-Driven Programming: The Event Structure
Type Definitions
The State Machine and Queued Message Handler
Messaging and Synchronization
Structures for Disabling Code
Halting VI and Application Execution
Cool GUI Stuff: Look What I Can Do!
Wrap It Up!
Chapter 14. Advanced LabVIEW Data Concepts
Key Terms

A Word About Polymorphic VIs
Advanced File I/O: Text Files, Binary Files, and Configuration Files
Configuration (INI) Files
Calling Code from Other Languages
Fitting Square Pegs into Round Holes: Advanced Conversions and Typecasting
You Can Be Anything: Variants
Wrap It Up!
Additional Activities
Chapter 15. Advanced LabVIEW Features
Key Terms
Exploring Your Options: The LabVIEW Options Dialog
Configuring Your VI
The VI Server
Radices and Units
Automatically Creating a SubVI from a Section of the Block Diagram
A Few More Utilities in LabVIEW
Wrap It Up!
Chapter 16. Connectivity in LabVIEW
Key Terms
Your VIs on the Web: The LabVIEW Web Server
Emailing Data from LabVIEW
Remote Panels
Self-Describing Data: XML
Sharing Data over the Network: Shared Variables
Talking to Other Programs and Objects
Talking to Other Computers: Network VIs
Report Generation
Wrap It Up!
Chapter 17. The Art of LabVIEW Programming
Key Terms
Why Worry About the Graphical Interface Appearance?
Arranging, Decorating, Resizing, Grouping, and Locking
Vive l'art: Importing Pictures
Custom Controls and Indicators
Adding Online Help
Pointers and Recommendations for a "Wow!" Graphical Interface
How Do You Do That in LabVIEW?
Memory, Performance, and All That
Programming with Style
Wrap It Up!
Concluding Remarks
Appendix A. CD Contents

Appendix B. Add-on Toolkits for LabVIEW
Application Deployment and Module Targeting
Software Engineering and Optimization Tools
Data Management and Visualization
Real-Time and FPGA Deployment
Embedded System Deployment
Signal Processing and Analysis
Automated Test
Image Acquisition and Machine Vision
Control Design and Simulation
Industrial Control
Appendix C. Open Source Tools for LabVIEW: OpenG
Free Open Source Software
OpenG.org: Home of the LabVIEW Open Source Community
Appendix D. LabVIEW Object-Oriented Programming
Introduction to Object-Oriented Programming
LabVIEW Object-Oriented Programming
Built-in LabVIEW Object-Oriented Programming Features
Appendix E. Resources for LabVIEW
LabVIEW Documentation and Online Help
Appendix F. LabVIEW Certification Exams
Certified LabVIEW Associate Developer (CLAD) Exam
Certified LabVIEW Developer (CLD) Exam
Certified LabVIEW Architect (CLA) Exam


Many of the designations used by manufacturers and sellers to distinguish their products are claimed
as trademarks. Where those designations appear in this book, and the publisher was aware of a
trademark claim, the designations have been printed with initial capital letters or in all capitals.
The authors and publisher have taken care in the preparation of this book, but make no expressed or
implied warranty of any kind and assume no responsibility for errors or omissions. No liability is
assumed for incidental or consequential damages in connection with or arising out of the use of the
information or programs contained herein.
The publisher offers excellent discounts on this book when ordered in quantity for bulk purchases or
special sales, which may include electronic versions and/or custom covers and content particular to
your business, training goals, marketing focus, and branding interests. For more information, please

U.S. Corporate and Government Sales
(800) 382-3419
For sales outside the United States, please contact:

Visit us on the Web: www.prenhallprofessional.com
Library of Congress Cataloging-in-Publication Data

Travis, Jeffrey.
LabVIEW for everyone : graphical programming made easy and fun / Jeffrey Travis, James Kring. 3rd ed.
p. cm.
ISBN 0-13-185672-3 (pbk. : alk. paper) 1. Scientific apparatus and instrumentsComputer simulation.
2. LabVIEW. I. Kring, James. II. Title.
Q183.A1T73 2006


Copyright © 2007 Pearson Education, Inc.
All rights reserved. Printed in the United States of America. This publication is protected by copyright,
and permission must be obtained from the publisher prior to any prohibited reproduction, storage in a

retrieval system, or transmission in any form or by any means, electronic, mechanical, photocopying,
recording, or likewise. For information regarding permissions, write to:

Pearson Education, Inc.
Rights and Contracts Department
One Lake Street
Upper Saddle River, NJ 07458
Fax: (201) 236-3290
Text printed in the United States on recycled paper at R. R. Donnelley in Crawfordsville, Indiana.
First printing, August 2006

Jeffrey would like to dedicate this book to his wife Stephanie, and his three children Maeve, Aidan,
and Rachel, for their love and support.
Jim would like to dedicate this book to his wife Beth, his parents Jim and Diane, Rupert Perera, and
Larry Nordell for the immeasurable investments each of them has made in his life.

About the Authors
Jeffrey Travis has extensive experience with software development, Web applications, Internet
technologies, virtual instrumentation, and LabVIEW. He has provided LabVIEW and enterprise
software consulting to both small and Fortune 100 companies looking for customized solutions in the
areas of Web applications, LabVIEW programs, and remote instrumentation systems. He has been a
guest speaker at symposiums and conferences on instrumentation and Internet technologies, and
has published award-winning articles in technical journals. Jeffrey Travis is also the author of Internet
Applications in LabVIEW (Prentice Hall, 2000) and the "LabVIEW Internet Applications" course.
Jeffrey is also an award-winning filmmaker and screenplay writer. His most recent work includes cowriting and directing the film FLATLAND based on Edwin A. Abbott's classical sci-fi novel.
Jeffrey currently lives in Austin, TX, with his wife and three children.
Jim Kring is an avid LabVIEW software engineer. He is also the CEO and founder of JKI, a LabVIEW
and systems integration consulting firm that provides professional services and develops commercial
software tools for professional LabVIEW developers. He believes that graphical software development
will soon become a software industry standard and is avidly pushing the technology in that direction.
Jim is a leader of the OpenG.org open source LabVIEW community, and is an active LabVIEW
community member in all regards. He is changing the world, one VI at a time.
Jim has a BS in environmental engineering science from U.C. Berkeley, College of Engineering. He
chose that major because it offered the widest variety of stimulating technical courses. He chose
LabVIEW as his profession because it offers the widest variety of stimulating technical projects. He is
a Certified LabVIEW Architect, has been a Certified LabVIEW Instructor, and has served as an
instructor for LabVIEW and electronics courses at the collegiate level.
He was the lead architect of software development and systems integration for a commercial product
that won the R&D 100 award, and he has received several awards for various technical publications.
Jim lives in San Francisco, CA, with his wife.

LabVIEW is a graphical programming language that has been widely adopted throughout industry,
academia, and research labs as the standard for data acquisition and instrument control software.
LabVIEW is a powerful and flexible instrumentation and analysis software system that is
multiplatformyou can run LabVIEW on Windows, Mac OS X, and Linux. You can also run LabVIEW on
PDAs (PalmOS, PocketPC, or Windows CE devices), on real-time platforms, and even embed LabVIEW
programs into FPGA chips and 32-bit microprocessors. Creating your own LabVIEW program, or
virtual instrument (VI), is simple. LabVIEW's intuitive user interface makes writing and using
programs exciting and fun!
LabVIEW departs from the sequential nature of traditional programming languages and features an
easy-to-use graphical programming environment, including all of the tools necessary for data
acquisition (DAQ), data analysis, and presentation of results. With its graphical programming
language, sometimes called "G," you program using a graphical block diagram that compiles into
machine code. Ideal for a countless number of science and engineering applications, LabVIEW helps
you solve many types of problems in only a fraction of the time and hassle it would take to write
"conventional" code.

Beyond the Lab
LabVIEW has found its way into such a broad spectrum of virtual instrumentation applications that it
is hard to know where to begin. As its name implies, it began in the laboratory and still remains very
popular in many kinds of laboratoriesfrom major research and development laboratories around the
world (such as Lawrence Livermore, Argonne, Batelle, Sandia, Jet Propulsion Laboratory, White
Sands, and Oak Ridge in the United States, and CERN in Europe), to R&D laboratories in many
industries, and to teaching laboratories in universities all over the world, especially in the disciplines
of electrical and mechanical engineering and physics.
The spread of LabVIEW beyond the laboratory has gone in many directionsup (aboard the space
shuttle), down (aboard U.S. Navy submarines), and around the world (from oil wells in the North Sea
to factories in New Zealand). And with the latest Internet capabilities, LabVIEW applications are being
deployed not only physically in many places, but virtually across networked applications. More and
more people are creating web-based control or monitoring of their LabVIEW applications to allow
remote access and instant information about what's happening in their lab. Virtual instrumentation
systems are known for their low cost, both in hardware and development time, and their great

The Expanding World of Virtual Instrumentation
Perhaps the best way to describe the expansion (or perhaps explosion) of LabVIEW applications is to
generalize it. There are niches in many industries where measurements of some kind are
requiredmost often of temperature, whether it be in an oven, a refrigerator, a greenhouse, a clean

room, or a vat of soup. Beyond temperature, users measure pressure, force, displacement, strain,
pH, and so on, ad infinitum. Personal computers are used virtually everywhere. LabVIEW is the
catalyst that links the PC with measuring things, not only because it makes it easy, but also because
it brings along the ability to analyze what you have measured and display it and communicate it
halfway around the world if you so choose.
After measuring and analyzing something, the next logical step often is to change (control)
something based upon the results. For example, measure temperature and then turn on either a
furnace or a chiller. Again, LabVIEW makes this easy to do; monitoring and control have become
LabVIEW strengths. Sometimes it is direct monitoring and control, or it may be through
communicating with a programmable logic controller (PLC) in what is commonly called supervisory
control and data acquisition (SCADA).

The Results
A few of LabVIEW's many uses include the following:
Simulating heart activity
Controlling an ice cream-making process
Detecting hydrogen gas leaks on the space shuttle
Monitoring feeding patterns of baby ostriches
Modeling power systems to analyze power quality
Measuring physical effects of exercise in lab rats
Controlling motion of servo and stepper motors
Testing circuit boards in computers and other electronic devices
Simulating motion in a virtual reality system
Allowing remote navigation and feedback over the web of a helium-filled blimp
Automatically generating cover sheets for your TPS reports

Objectives of This Book
LabVIEW for Everyone will help you get LabVIEW up and running quickly and easily, and will start you
down the road to becoming an expert LabVIEW developer. The book offers additional examples and
activities to demonstrate techniques, identifies other sources of information about LabVIEW, and
features descriptions of cool LabVIEW applications. You are invited to open, inspect, use, and modify
any of the programs on the accompanying CD-ROM. You can also get updates to the examples,
activities, book errata, and other related resources and information at
http://labviewforeveryone.com. The CD-ROM also includes the 30-day evaluation version of LabVIEW
8.0 for Windows, which allows you to do just about everything the commercial version does during

the evaluation period. You can also always get the latest evaluation version of LabVIEW at
This book expects you to have basic knowledge of your computer's operating system. If you don't
have much computer experience, you may want to spend a little time with your operating system
manual and familiarize yourself with your computer. For example, you should know how to access
menus, open and save files, make backup disks, and use a mouse. It also helps if you have some
basic programming experience with other languages (C, Java, FORTRAN, etc.), but it is not necessary
to know another programming language to use LabVIEW.
After reading this book and working through the exercises, you should be able to do the following,
and much more, with the greatest of ease:
Write LabVIEW programs, called virtual instruments, or VIs.
Employ various debugging techniques.
Manipulate both built-in LabVIEW functions and VIs.
Create and save your own VIs so that you can use them as subVls, or subroutines.
Design custom graphical user interfaces (GUIs).
Save your data in a file and display it on a graph or chart.
Build applications that use General Purpose Interface Bus (GPIB) or serial instruments.
Create applications that use plug-in DAQ boards.
Use built-in analysis functions to process your data.
Optimize the speed and performance of your LabVIEW programs.
Employ advanced techniques such as state machines and event structures.
Control your VIs and publish your data over the Internet or on the Web, using LabVIEW's
features like its built-in Web server and remote panels.
Use LabVIEW to create your instrumentation applications.
LabVIEW for Everyone helps you get started quickly with LabVIEW to develop your instrumentation
and analysis applications. The book is divided into two main sections: Fundamentals and Advanced
The Fundamentals section contains nine chapters and teaches you the fundamentals of programming
in LabVIEW. The Advanced Topics section contains eight chapters that further develop your skills and
introduce helpful techniques and optimizing strategies. We suggest that you work through the
beginning section to master the basics; then, if you're short on time, skip around to what you really
want to learn in the advanced section.
In both sections, chapters have a special structure to facilitate learning, as follows:

Overview, goals, and key terms describe the main ideas covered in that chapter.
The main sections are a discussion of the featured topics.
Activities reinforce the information presented in the discussion.
Wrap It Up! summarizes important concepts and skills taught in the chapter.
Additional activities in many chapters give you more practice with the new material.

Chapter 1, "What in the World is LabVIEW?," describes LabVIEW and introduces you to some of
LabVIEW's features and uses.
In Chapter 2, "Virtual Instrumentation: Hooking Your Computer Up to the Real World," you will get an
overview of virtual instrumentation: how data acquisition, GPIB, serial port communication, and data
analysis are performed with LabVIEW.
In Chapter 3, "The LabVIEW Environment," you will get acquainted with the LabVIEW environment,
including the LabVIEW Project Explorer, the essential parts of a virtual instrument (or VI), the Help
window, menus, tools, palettes, and subVIs.
In Chapters 4 and 5, "LabVIEW Foundations" and "Yet More Foundations," you will become familiar
with the basics of programming in LabVIEWusing controls and indicators (such as numerics,
Booleans, and strings); wiring, creating, editing, debugging, and saving VIs; creating subVIs; and
documenting your work. You will also begin to understand why LabVIEW is considered a dataflow
programming language.
Chapter 6, "Controlling Program Execution with Structures," describes the basic programming
structures in LabVIEW: While Loops, For Loops, shift registers, Case Structures, Sequence
Structures, and Formula Nodes. It also teaches you how to introduce timing into your programs. You
will be introduced to easy-to-use frameworks that combine the While Loop and Case Structure to
build scalable applications.
In Chapter 7, "LabVIEW's Composite Data: Arrays and Clusters," you will learn how to use two
important data structuresarrays and clustersin your programs. You will also explore LabVIEW's builtin functions for manipulating arrays and clusters. It also teaches you about the error cluster and how
to perform proper error handling in LabVIEW.
Chapter 8, "LabVIEW's Exciting Visual Displays: Charts and Graphs," details the variety of charts and
graphs available in LabVIEW and teaches you how to use them for animated and informative data
presentation. It also introduces the waveform, time stamp, and dynamic datatypes.
Chapter 9, "Exploring Strings and File I/O," discusses string data types, string functions, and tables.
You will learn how to parse strings like a pro, using the regular expression syntax. It also talks a little
about how to save data in and read data from a file, using LabVIEW's simple File I/O VIs.

Advanced Topics

Chapter 10, "Signal Measurement and Generation: Data Acquisition," teaches you some of the theory
behind signals, data acquisition, and analog and digital I/O. You will learn some hardware
considerations, and you will find a valuable guide to many common acronyms used in
instrumentation. Chapter 10 also discusses software setup for data acquisition using the
Measurement & Automation Explorer (MAX) utility and configuring NI-DAQmx devices.
Chapter 11, "Data Acquisition in LabVIEW," then takes the basics of data acquisition you learned in
Chapter 10 and teaches you how to apply them in LabVIEW using the DAQmx VIs. You'll learn about
the easy-to-use and powerful DAQmx tasks in LabVIEW, as well as work through some activities to
read and write analog data, digital data. The chapter ends with some more advanced forms of data
acquisition applications, such as streaming data to a file or doing a triggered acquisition.
Chapter 12, "Instrument Control in LabVIEW," discusses how to use external instruments with
LabVIEW. You'll learn about GPIB, serial, Ethernet, and other kinds of instrument interfaces, and how
to use the powerful VISA framework with LabVIEW to easily communicate with them.
Chapter 13, "Advanced LabVIEW Structures and Functions," covers some invaluable features like
local and global variables, property nodes, invoke nodes, and the powerful Event Structure for eventdriven programming. You will learn about the State Machine and Queued Message Handler application
frameworks, as well as the Messaging and Synchronization functions: Queues, Notifiers, Semaphores,
Rendezvous, and Occurrences. It also introduces you to some more of LabVIEW's cool GUI widgets
like trees, subpanels, graphics and sound, and so on.
Chapter 14, "Advanced LabVIEW Data Concepts," discusses some more file I/O, showing you how to
work with binary files and configuration files, as well as advanced text file functions. You'll see how
LabVIEW can both read and generate external code modules such as DLLs and Shared Libraries.
Chapter 15, "Advanced LabVIEW Features," shows you how to configure VI behavior and appearance
using VI Setup options. You'll learn about the powerful VI Server and how you can dynamically
control LabVIEW, VIs, and controls by reference. It also introduces LabVIEW's very useful tools such
as the Find function and VI Hierarchy window.
Chapter 16, "Connectivity in LabVIEW," covers connectivity features in LabVIEW such as printing to
the web, controlling VIs remotely over the web, sharing data with Shared Variables, networking, and
report generation.
In Chapter 17, "The Art of LabVIEW Programming," you will learn about good LabVIEW style and
some new tips, such as how to add a customized look to your applications by importing pictures and
using the Control Editor. Chapter 17 describes some good programming techniques that you can use
to make your programs run faster, use less memory, port more easily to other platforms, and behave
more efficiently overall.
In Appendix A, "CD Contents," you can find an outline and description of the files contained on the
accompanying CD-ROM, as well as high-level instructions for installing the LabVIEW evaluation
version and finding the examples and activities discussed in this book.
In Appendix B, "Add-on Toolkits for LabVIEW," you will learn about add-on toolkits available from
National Instruments and third-party companies to increase LabVIEW's functionality.
Appendix C, "Open Source Tools for LabVIEW: OpenG," introduces you to free (as in speech)
software and the OpenG.org community that collaboratively develops add-on toolkits for LabVIEW.
In Appendix D, "LabVIEW Object-Oriented Programming," you will be introduced to object-oriented

programming techniques in LabVIEW, including a history of LabVIEW object-oriented programming
and some perspectives on things to come.
Appendix E, "Resources for LabVIEW," contains links to various LabVIEW resources such as user
groups, discussion forums, and various other online LabVIEW resources.
In Appendix F, "LabVIEW Certification Exams," you will learn about the LabVIEW developer
certification exams, how to prepare for them, what to expect, and the benefits of certification.
You will find a glossary and index at the end of the book.
The following table describes the conventions used in this book.

Bold text denotes VI names, function names, menus, menu items, and
palettes. In addition, bold text denotes VI input and output parameters. For
example, "Choose TCP Read from the TCP Functions palette."


Italic text denotes emphasis, a cross reference, or an introduction to a key
term or concept. For example, "A control reference is an object that points to a
LabVIEW control or indicator and can manage its properties."


Courier type denotes text or characters that you enter using the keyboard. It

also denotes files and paths. Sections of code, programming examples, syntax
examples, and messages and responses that the computer automatically prints
to the screen also appear in this font. For example, "In the text book, enter
c:\data\datafile.txt as the filename."
Note. This icon marks information to which you should pay special attention.

Watch Out! This icon flags a common pitfall or special information that you
should be aware of in order to keep out of trouble.

Hint. This icon calls your attention to useful tips and hints on how to do
something efficiently.

When you see this icon, it means the topic being discussed is a Certified
LabVIEW Developer (CLD) exam topic. If you want to prepare to become a
CLD, pay attention! See Appendix F for detailed information about the
certification program, what you can gain by becoming certified, how to study,
and what to expect while taking the exams.

In Chapter 6, you will be introduced to LabVIEW's Express technologies, which
provide configurable automatic programming for common tasks. This icon
indicates the section refers to an Express Technology topic.

A Note about Paths
Different platforms have different conventions for specifying path names. For example, Windows
paths take the form X:\LABVIEW\MINE.LLB\BINGO.VI. The same path on a MacOS classic system
would be denoted Hard Drive Name:LabVIEW:Mine.jib:Bingo.vi. On Linux or OS X machines, it
would be /usr/labview/mine.llb/bingo.vi. Rather than specifying a full path, this book will list the
default path from the LabVlEW directory or folder when telling you where to find an example VI. To
simplify notation, we will use the Windows standard to describe paths; if you use Mac OS or UNIX
machines, please substitute colons or forward slashes where necessary.

What's New in the Third Edition
LabVIEW For Everyone was the first book published aimed at the beginner LabVIEW user in 1997 for
LabVIEW 4.0; since then, Prentice Hall and other publishers have produced over a dozen LabVIEW
books on specific topics. The second edition of LabVIEW For Everyone was updated for LabVIEW 6.1
and introduced some new topics.
This third edition has been completely revised and updated for LabVIEW 8.0. Two new chapters were
added, and the number of pages has almost doubled! The changes from the second edition include
the following:
Inclusion of the new Express VIs and Express technology in LabVIEW
Inclusion of the Certified LabVIEW Developer callouts to identify key sections that provide
information that is tested on the CLD certification exam
Static VI reference
Call by Reference advanced options
Event structure and event-driven programming
Dynamic data
Type definitions
Configuration (INI) file VIs

Calling DLLs from LabVIEW
Shared variables
Custom probes
Search and replace
Error handling design patterns, tips, and tricks
While Loop + case structure design patterns
State machine and queued message handler design patterns
Messaging and Synchronization using Queues, Notifiers, Semaphores, Rendezvous, and
Tree controls, tab controls, drag and drop, subpanels, scrollbars, and splitter bars
Regular expressions
Diagram disable and conditional disable structures
Using NI-DAQmx and the LabVIEW DAQmx VIs
LabVIEW project explorer
Alignment grid
Timed structures (timed loop and timed sequence structure)
Advanced report generation
Polymorphic VIs

LabVIEW Installation Instructions
If you own a licensed version of LabVIEW and need instructions on how to install it, please see the
release notes that came with your software.
Otherwise, you can install a 30-day evaluation version of LabVIEW. Although we've included an
evaluation version installer on this book's CD, we encourage you to check http://ni.com/labview for
the latest evaluation version of LabVIEW, available as a download. The evaluation version of LabVIEW
included on this CD, version 8.0 for Windows, will allow you to work through all the examples in this
book. Remember, the evaluation version stops working after 30 days. After that, you can activate
your installed LabVIEW to a licensed version by purchasing a license from National Instruments at

In addition, you will need to access the EVERYONE directory from the CD-ROM in the back of this book.
It contains the activities in this book and their solutions. You may want to copy the EVERYONE
directory onto your PC so you can save your activity work there as well. (You can also get updates to
the examples, activities, book errata, and other related resources and information at

Purchasing LabVIEW
If you would like information on how to purchase LabVIEW, contact National Instruments:

National Instruments
11500 N Mopac Expwy
Austin, TX 78759-3504
Telephone: 888-280-7645
Fax: 512-683-8411
Email: info@ni.com
Web: http://www.ni.com

The authors would like to acknowledge the contributions of the following individuals for their
assistance with making this third edition of LabVIEW for Everyone possible:
To Bernard Goodwin, our editor at Pearson, who encouraged us to write this updated third edition
and who held us to our deadlines.
To the fine folks at National Instruments who assisted with the book by providing resources, technical
reviews, artwork, and their time. In particular, we'd like to especially thank Craig Anderson, Jim
Cahow, Zaki Chasmawala, David Corney, Crystal Drumheller, David Gardner, Stephen Mercer, Darren
Natinger, Jeff Peters, and Brian Tyler.
To the LabVIEW gurus who reviewed our manuscript, and caught all our mistakes (we hope!) before
it went to print: Mike Ashe, John Compton-Smith, Ed Dickens, Jean-Pierre Drolet, Crystal Drumheller,
Kostya Shifershteyn, Paul Sullivan, and Ashish Uttarwar.
To Michael Aivaliotis for maintaining the LAVA (LabVIEW Advanced Virtual Architects) discussion
forums on the Web (forums.lavag.org) and the community of LAVA members who make this forum
so great. We regularly used this incredibly useful resource throughout the writing of this third edition
for discussing technical topics and polling the community of LabVIEW users on key topics.
Jim would like to especially acknowledge, first and foremost, his wife Beth, who not only put up with,
but also provided tremendous support in, his writing of this third edition. And also to his family,
friends, and co-workers for their support and understanding during the many long months he spent
in seclusion while working on the manuscript and for welcoming him back upon its completion.

1. What in the World Is LabVIEW?
Key Terms
What Exactly Is LabVIEW, and What Can It Do for Me?
Demonstration Examples
Wrap It Up!
Additional Activities

Welcome to the world of LabVIEW! This chapter gives you a basic explanation of LabVIEW, its
capabilities, and how it can make your life easier.

Develop an idea of what LabVIEW really is.
Learn what "graphical programming language" and "dataflow programming" mean.
Peruse the introductory examples that come installed with LabVIEW using the NI Example
Get a feel for the LabVIEW environment.

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay