LabVIEW for Everyone: Graphical Programming Made Even Easier
Welcome to LabVIEWLabVIEW, or Laboratory Virtual Instrument Engineering Workbench, 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. Currently running on Macintoshes (and Mac clones), Sun SPARCstations, HP 9000/700 Series workstations, and personal computers (PCs) running Windows 3.1, Windows NT, or Windows 95, LabVIEW is a powerful and flexible instrumentation and analysis software system.Computers are much more flexible than standard instruments, and 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, 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 LabLabVIEW 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 laboratories-from 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 directions“up (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). It is still moving in all directions, headed for new horizons! Virtual instrumentation systems are known for their low cost, both in hardware and development time, and their great flexibility. Is it any wonder that they are so popular?The Expanding Universe of Virtual InstrumentationPerhaps 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 required—most 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 ResultsYou will find descriptions of LabVIEW applications interspersed throughout this book. They are written by users in a very brief style to give you the essence of the application and chosen from industry segments in which LabVIEW tends to be very popular—automated electronics testing, semiconductor manufacturing, medical instrumentation, automotive testing, and industrial automation (two applications featured). Of the multitude of successful LabVIEW applications, these are particularly interesting current examples of virtual instrumentation at its finest!A few of LabVIEW's many uses include: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.Supervisor control of the heating ventilation and air conditioning (HVAC) system in National InstrumentsÕ manufacturing facility.Objectives of this BookLabVIEW for Everyone will help you get LabVIEW up and running quickly and easily, and will start you down the road to becoming an expert G programmer. 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 (although in many cases you'll need the full version of LabVIEW, not the included sample software, to be able to do much with them).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.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 library VIs.Create and save your own VIs so that you can use them as subVIs, 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 globals, locals, and attribute nodes.Use LabVIEW to create your instrumentation applications.LabVIEW from National Instruments has extensive graphics and analysis capabilities that are used to control and monitor the operation of process control applications, such as this wind tunnel experiment.OrganizationLabVIEW 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 Topics. The Fundamentals section contains nine chapters and teaches you the fundamentals of G programming in LabVIEW. The Advanced Topics section contains six 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:Overview, goals, and key terms describe the main ideas covered in that chapter.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.FundamentalsChapter 1 describes LabVIEW and introduces you to some of LabVIEW's features and uses.In Chapter 2, you will get an overview of virtual instrumentation: how data acquisition, GPIB, serial port communication, and data analysis are performed with LabVIEW. You will also learn about LabVIEW's history.In Chapter 3, you will get acquainted with the LabVIEW environment, including the essential parts of a virtual instrument (or VI), the Help window, menus, tools, palettes, and subVIs.In Chapters 4 and 5, you will become familiar with the basics of G programming in LabVIEWÑusing 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 unde