
CHAPTER 1 Introduction 1.1 WHAT IS LABVIEW? Objectives In the past, LabVIEW was just a graphical programming language that was After reading this chapter, developed to make it easier to collect data from laboratory instruments using you will know: data acquisition systems. LabVIEW was always easy to use once you got used to wiring connectors to write your computer programs, and it definitely makes what LabVIEW is and how it can be used to acquire, data acquisition an easier task than without LabVIEW, but LabVIEW is not process, and analyze data just for data acquisition any more. LabVIEW can be used to perform the following: what a LabVIEW VI is, and how front panel and block • acquire data from instruments diagrams are used • process data (e.g., filtering, transforms) how to start LabVIEW • analyze data and create a blank VI • control instruments and equipment how to use LabVIEW menus For engineers, LabVIEW makes it possible to bring information from to open and save VIs the outside world into a computer, make decisions based on the acquired data, and send computed results back into the world to control the way a piece of equipment operates. As an example, the LabVIEW program (front panel) shown in Figure 1.1 reads a process measurement (a temperature value) from a piece of equipment, compares the measured process temperature with the desired temperature (called a setpoint), and outputs a signal to a controller to try to control the temperature at the setpoint value. You can see in Figure 1.1 that when the temperature went above setpoint, the controller output decreased. This causes a valve on a heat source to close (partially) to bring the temperature back to setpoint. In this brief example: • A temperature value was read from an external device. • The desired setpoint temperature was entered on a control on the front panel. • A controller output was calculated using a PI Controller algorithm. • The controller output was written to an external device. 2 Introduction Figure 1.1 LabVIEW VI for PI Controller (front panel). LabVIEW’s ability to get data from outside the real world, use the data inside a pro- gram, and send results back out to the real world allows engineers to interact with and control events in the real world, not just inside computers. Using LabVIEW programs is a fast and efficient way to develop a new device or prototype a new instrument. And LabVIEW is becoming such an industrial standard that the Lab- VIEW program used to create the prototype may soon be the program used in the commercial version as well. 1.2 ASSUMPTIONS The author is making a few assumptions about the reader and about the version of LabVIEW that you have available. 1.2.1 Target Audience As part of the Pearson-Prentice Hall E-Source series, this text is targeted at first- and second-year engineering students. As such, the reader is assumed to have some mathematical ability, but very little experience with LabVIEW. And while LabVIEW is often used for data acquisition, that is not the primary focus of this Section 1.3 Conventions in the Text 3 text. Instead, we will focus on using the mathematical power of LabVIEW to tackle the analysis of data sets, whether they are acquired from an experimental system or not. 1.2.2 LabVIEW Versions LabVIEW is a well-developed program, and the changes from one version to another are small.The author has used LabVIEW 8.5 and LabVIEW 2009 Full versions with no added bells or whistles in developing the examples in this text. For the material covered in this text, users of earlier versions of LabVIEW will see very few differences. LabVIEW is sold in the following packages: • Base Package—reduced mathematics functionality • Full Package—complete set of math functions • Student Edition—full package with a watermark in the lower right corner of each front panel • Professional Package—can create stand-alone applications • NI Developer Suite—includes extra add-ons and toolkits In this text, we will make use of many of the math functions that are available only in the Full, Student, Professional, and Developer packages. Some of the more advanced analysis techniques illustrated in this text will be unavailable in the Base package. For example, Base Full Student Pro Dev Topic ✓ ✓ ✓ ✓ ✓ Trig Functions ✓ ✓ ✓ ✓ ✓ Boolean Functions ✓ ✓ ✓ ✓ ✓ Matrix Math No* ✓ ✓ ✓ ✓ Simultaneous Equations Function ✓ ✓ ✓ ✓ ✓ File I/O ✓ ✓ ✓ ✓ ✓ Graphs ✓ ✓ ✓ ✓ ✓ Basic Statistics No ✓ ✓ ✓ ✓ Interpolation No ✓ ✓ ✓ ✓ Curve Fitting No ✓ ✓ ✓ ✓ Regression No ✓ ✓ ✓ ✓ Integration No ✓ ✓ ✓ ✓ Differentiation No ✓ ✓ ✓ ✓ Differential Equations *An easy workaround is presented in the text. It is assumed that the reader has access to at least the Student LabVIEW package. 1.3 CONVENTIONS IN THE TEXT The following conventions are used in this text: • Keywords—shown in italics the first time they appear. • Literals—items meant to be typed exactly as they appear in the text are shown in bold font. 4 Introduction • Function and Control names—the functions to be selected from the Functions Palette and the Controls to be selected from the Controls Palette will be shown in bold font. The location within the palette structure is indicated using slashes, as Main Palette / Sub-Pallet / Group / Function. • Menu Selections—when actions are initiated from a menu, the menu and submenu choices are indicated, separated by slashes as Menu Option / Submenu Option. 1.4 LABVIEW VIs LabVIEW programs are called VIs. Originally, VI stood for virtual instrument, but LabVIEW is now used for many more applications than just creating a computer simulation of an instrument, and LabVIEW programs are typically referred to sim- ply as VIs. A LabVIEW VI has two parts: • Front Panel—Displays the controls (knobs, buttons, graphs, etc.) and represents the graphical interface for the VI.An example of a VI front panel is shown in Figure 1.1. • Block Diagram—Holds the programming elements (called blocks, functions,or sometimes subVIs) that are wired together to build the graphical program. The block diagram for the PI Controller VI is shown in Figure 1.2. Figure 1.2 PI Controller VI, block diagram. This text is intended for students who are new to LabVIEW, so Figure 1.2 is presented as a preview only. For students who want to know a little more about how the LabVIEW program works, Figure 1.3 shows the major program sections in the PI Controller. (If you are not interested in the program details, you can skip ahead to Section 1.5.) Section 1.5 Starting LabVIEW 5 Figure 1.3 The parts of a LabVIEW program. 1. Read an analog voltage (the process measurement) from the data acquisition system. 2. Get parameter values from the controls on the front panel. 3. Display values on the front panel using numeric indicators and graphs. 4. Calculate the controller output value. 5. Write an analog voltage (the controller output) to the data acquisition system. 1.5 STARTING LABVIEW The learning approach that is used in this text is to try to get the reader creating LabVIEW programs as quickly as possible. To accomplish this, some features may be presented briefly at first, with just enough information to allow an example to be developed. The details will be presented later in the chapter. That said; let’s start LabVIEW. LabVIEW is started from the Windows Start menu as illustrated in Figure 1.4. Start Menu / All Programs / National Instruments LabVIEW If LabVIEW has been used recently, there will be an icon in the left panel of the Windows Start menu (marked with (1) in Figure 1.4). Otherwise, use the All 6 Introduction Figure 1.4 Start menu showing two options for starting LabVIEW. Programs button and find the National Instruments LabVIEW icon in the list of installed programs (marked with (2) in Figure 1.4). Alternatively,there might be a shortcut to LabVIEW on the computer desktop, as shown in Figure 1.5. If your computer does not have a desktop shortcut for LabVIEW, you can create one by right-clicking on the National Instruments LabVIEW icon (marked with (2) in Figure 1.4) and selecting Create Shortcut from the pop-up menu. As LabVIEW loads, the title screen shown in Figure 1.6 is displayed. Once the Figure 1.5 program has loaded into memory, the title screen disappears, and the Getting Started Desktop shortcut icon for window (shown in Figure 1.7) is displayed. LabVIEW. The Getting Started window performs the following: • provides access to online support for LabVIEW • provides access to the LabVIEW Help system • allows you to create a blank VI or an empty project • allows you to open a recently used VI or project • allows you to search for LabVIEW examples Note: The Getting Started window is displayed by default, but that can be changed by using menu options Tools / Options to open the Options dialog, then selecting the Environment category, and checking or clearing the box before Skip Getting Started window on launch. Section 1.5 Starting LabVIEW 7 Figure 1.6 LabVIEW title screen, shown as program is loading. LabVIEW Nomenclature: • VI is synonymous with LabVIEW program. LabVIEW programs are stored as files with .vi extensions. LabVIEW VIs include a graphical user interface (front panel), and a block diagram that contains the programming elements. •A project is a collection of related program elements that are intended to work together. A project can contain multiple VIs plus additional program elements. 1.5.1 The LabVIEW Editing Environment LabVIEW VIs can be created quickly, can be modified as needed, and give scientists and engineers the ability to collect and analyze the data they need in order to accomplish their goals.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages25 Page
-
File Size-