LOOP X = X + A SIN (q)
In linear programming, each line is executed one after the other. Each time the loop is executed the program calculates a new value of X. In LabVIEW data flow demands a different structure. Load from Sensors, Transducers and LabVIEW library a program called Data Flow.vi. Select Show Diagram from the Windows menu. Click on the Icon with a light bulb. Now run the program by pressing the í key and watch the action. Small colored balls represent packets of data. Note how the data flow is stopped at a program node until all the data packets arrive.
LabVIEW programming is different from conventional linear programming and requires a change in the designer's mind set. However once you experience the advantages of data flow programming, you too will be a fan.
In the first six chapters of Sensors, Transducers and LabVIEW, this new form of object oriented programming is presented with numerous applications to learn and hone your LabVIEW skills. Areas covered include the LabVIEW environment, modular programming, sub-VI's, programming structures, string operations, array operations and plotting routines. Sensors, Transducers & LabVIEW is about 'doing' things in the real world. Starting in Chapter 4, the input/output drivers for parallel and serial ports are introduced so programs can be transformed into actions. Along the way, numerous sensors (temperature, pressure, and magnetic field) are introduced together with transducers (stepping motors, LED displays, printers and plotters) as a means of solving real world interfacing problems. By the end of the first six chapters, all the basic LabVIEW structures and programming styles have been presented so that advanced concepts, sensors, and challenges may be tackled.
The advanced Chapters 7-15 are presented as LabVIEW projects covering topics such as the electronic barometer, remote video over the WEB, faster scanning, the electronic compass, and so on. All the common interfaces Centronics, RS232C, IEEE488, DAQ cards and TCP/IP are covered within the projects.
Each chapter follows the same format. The first section introduces the subject or the problem to be studied. The second section covers background material, hardware or software information necessary to understand the remainder of the chapter. As an example, in Chapter 2, the physics of Hall effect sensors and the design for a Hall sensor interface are discussed. This section is optional. For a reader who is already sensor or transducer savvy, it can be skipped. Section three simulates the sensor and its interface. The following sections build on measurement skills developed in the early part of the chapter to produce a system solution. Modular programming techniques are used throughout. With bricks and mortar in the early sections, walls are built, then roofs, windows and finally the entire house. LabVIEW is a wonderful language to learn the lesson that mighty programs arise from small modules.
Readers with real sensors and interface cards can use them to link the projects with the real world. For readers without sensors, the simulated sensor VIs given in the library can be used. Every effort has been made to make the simulated sensors look and feel like real sensors. In some cases actual measured data sets are built into the sensor simulation.
Objectives of the Book
This book is written for students, scientists, researchers, and practicing engineers who are interested in learning how to use LabVIEW in a wide range of sensor and transducers applications. This book is written for the novice LabVIEW user who learns best from examples, for the practicing engineers who wants a refresher course on practical LabVIEW applications and for the expert who needs a sensor driver in a hurry. The text is a casebook of interesting sensors, circuits, drivers and applications. Over 150 sample programs can be found in the program library on the CD.
This book expects you to have a basic knowledge of your computer's operating system. You should know how to access menus, use the mouse, open and save files. Although previous LabVIEW experience is not necessary, it is an advantage for the sensor projects in the later chapters. The CD provides LabVIEW 5.0 Evaluation Software with a LabVIEW tutorial, highly recommended for the novice user.
After reading this book and working through the many exercises and challenges, you should be able to
How to Use Sensors, Transducers and LabVIEW
- Understand the workings of a wide range of sensors and transducers
- Design LabVIEW drivers for sensors and transducers
- Understand the differences between serial, parallel, GPIB and TCP/IP interface ports
- Build LabVIEW interfaces for serial, parallel, GPIB and TCP/IP ports
- Create application with a DAQ card
- Appreciate the elegance and simplicity of a graphical programming language
- Understand the power of modular (subVI) programming
- Build sensor and transducer applications simulated or in the real world using the ports and real sensors
- Create system applications
For the scientist, researcher, practicing engineers or technologists
This is definitely a book you will want to read, with your computer by your side. "Reading" is eye opening, "doing" is mind expanding but "using" is real learning. As you read the text, ideas and questions will pop into mind. Stop reading and experiment with LabVIEW. Prove to yourself that events do occur as presented. Exercises along the way elucidate some subtle point. Now is the time to try out these ideas. LabVIEW Challenges, much like homework, can be done after the material in the chapter has been understood. Some challenges are simple extrapolations of ideas presented in the chapter, others require exploration, further reading and thought. Completed challenges will deepen your understanding of sensors, transducers and especially LabVIEW. You will soon be creating your own challenges.
I wonder if I could add an altimeter to my bicycle?
What would be the altimeter output?
How would I get the signal into my laptop computer?
How could I calculate how much work is done riding up old Smoky?
For the students
You cannot get enough of LabVIEW. The length of the text and CD allows only some of the many properties of LabVIEW to be covered. Read the LabView manuals, study how other applications are coded, but above all explore. Deep in many LabVIEW menus and sub-menus, you will find many interesting functions that will make for efficient programming. When you find one of these little gems, try it out with a demo program to be sure it does exactly what you expect. Icons and even the HELP text-boxes allow only limited information and can be confusing. Remember in designing a LabVIEW application to solve a problem, there are many paths to the answer. In the absence of constraints such as the fastest or the most efficient program, all solutions are correct. You can learn a great deal by studying other student's solutions. Adding sensors and transducers to your project makes it come alive. The LabVIEW motto is "It's OK to have fun." My motto is "If it is not fun, it is not Physics". My students and myself have had a lot of "fun" using LabVIEW to instrument and control many applications. You can too.
For the Instructor
The basic concepts of LabVIEW programming and simple input/output devices are presented in the first six chapters. Each chapter requires about two 1 hour lectures. LabVIEW diagrams, sensor or transducer specifications can be embedded into an electronic slide-show or on overhead transparencies. Have LabVIEW running in the classroom so that the static LabVIEW images can be run in real time. I like to have both applications running concurrently so that I can switch back and forth during my lecture. Many of the text ideas are suitable for both virtual and real demonstrations. It's one thing to see a demonstration such as stoplights executing some complex 'advanced flashing green' operation on the computer screen, but the student eye opener is when real lights or colored light emitting diodes start flashing the designed operation.
For the hobbyist
Once you have mastered LabVIEW concepts and built a few instrument drivers, the whole world is your stage. Many electronic parts catalogs and electronic magazines describe all kinds of inexpensive sensors and transducers. Utilizing dedicated microcontrollers such as the SMI102 introduced in Chapter 4 provide a very low cost interface for these sensors. Although limited in input/output capability they are ideal for hobby projects. Let your imagination wander, and LabVIEW will provide an easy path to bring computer control to your favorite application.
Sensors, Transducers & LabVIEW CD
The CD included with this book contains demonstration, example, and solution VIs for each chapter of the text. The most effective way to learn a new programming language is to use it. Have your computer close at hand as you read the text. See an idea, try out that idea and check it out with the examples in the library. If you do not have LabVIEW currently installed on your computer, then you can install LabVIEW 5.0 Evaluation Software included on the CD. You will have unlimited edit time but the runtime is limited to 5 minutes.
The program libraries are simply the quickest method to get you up and running. All program VIs discussed in the text are included in the VI library. You will find a complete listing of the 172 programs near the end of the book and on the CD. These VIs are a template, or a starting point for program development. The teaching strategy is, first to understand, then to imitate, then to improve the VIs. Your challenge is to make them even better. All sensors and transducers are simulated in the text so that no additional hardware is required, other than your computer, and the Sensors, Transducers & LabVIEW CD. However, if you do have real sensors or real transducers and access to the RS232, GPIB or TCP/IP ports you can see virtual instrumentation in action. Replace the simulated sensor or transducer VIs with real devices and drivers and let your project 'sing or dance'.
Also included on the CD is over 50 megabytes of Quicktime and Mpeg movies of selected sensors and transducers in action. Enjoy!
What You Need to Get Started
Place the Sensors, Transducers & LabVIEW CDROM into your computer (PC or MAC). Install LabVIEW 5.0 Evaluation Software on your computer hard drive. You will need
40 Megabytes of hard disk space
16-32 Megabytes RAM
fast CPU (Pentium, 68040 or PowerMac)
If you have LabVIEW already installed, you will only need one of the four Sensor, Transducers & LabVIEW libraries.
Chose PC Version 4 or Version 5, MAC Version 4 or Version 5
See the ReadMe file on the CD for further comments
Note: It is not necessary to put the libraries onto your hard drive, but response will be faster if you do. Double click on your favorite program and enjoy the benefits of an easy-to-use graphical programming environment.
Conventions used in the text
Bold—Bold text denotes VIs, functions menus and menu items. For example: Tools
Angle bracket to the right is used to indicate sub-menus. For example: Functions>Numeric>Trigonometric>Sine
Text between left and right angle brackets indicate a key. For example: indicates the Return or Enter key
Text between square bracket is used to indicate a button. For example: [Start Your Engines]
Text between square brackets is also used to indicate a terminal block label or a subVI icon. Examples: [Init] a link labeled Initialize. [AV3] a sub-VI called AV3.
italic—Italic denotes emphasis, key term or concept or a VI. Examples: Friend/Foe.llb.