1. Trang chủ
  2. » Công Nghệ Thông Tin

LabVIEW Tutorial Manual pot

250 525 1

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 250
Dung lượng 2,34 MB

Nội dung

LabVIEW ® Tutorial Manual January 1996 Edition Part Number 320998A-01 © Copyright 1993, 1996 National Instruments Corporation. All Rights Reserved. 001Title Page 1 Thursday, August 24, 2000 9:59 AM GPIB: gpib.support@natinst.com DAQ: daq.support@natinst.com VXI: vxi.support@natinst.com LabVIEW: lv.support@natinst.com LabWindows: lw.support@natinst.com HiQ: hiq.support@natinst.com E-mail: info@natinst.com FTP Site: ftp.natinst.com Web Address: http://www.natinst.com BBS United States: (512) 794-5422 or (800) 327-3077 BBS United Kingdom: 01635 551422 BBS France: 1 48 65 15 59 (512) 418-1111 or (800) 329-7177 Tel: (512) 795-8248 Fax: (512) 794-5678 or (800) 328-2203 Australia 03 9 879 9422, Austria 0662 45 79 90 0, Belgium 02 757 00 20, Canada (Ontario) 519 622 9310, Canada (Québec) 514 694 8521, Denmark 45 76 26 00, Finland 90 527 2321, France 1 48 14 24 24, Germany 089 741 31 30, Hong Kong 2645 3186, Italy 02 48301892, Japan 03 5472 2970, Korea 02 596 7456, Mexico 95 800 010 0793, Netherlands 0348 433466, Norway 32 84 84 00, Singapore 2265886, Spain 91 640 0085, Sweden 08 730 49 70, Switzerland 056 200 51 51, Taiwan 02 377 1200, U.K. 01635 523545 National Instruments Corporate Headquarters 6504 Bridge Point Parkway Austin, TX 78730-5039 Tel: (512) 794-0100 Internet Support Bulletin Board Support FaxBack Support Telephone Support (U.S.) International Offices 001Title Page 2 Thursday, August 24, 2000 9:59 AM Important Information Warranty The media on which you receive National Instruments software are warranted not to fail to execute programming instructions, due to defects in materials and workmanship, for a period of 90 days from date of shipment, as evidenced by receipts or other documentation. National Instruments will, at its option, repair or replace software media that do not execute programming instructions if National Instruments receives notice of such defects during the warranty period. National Instruments does not warrant that the operation of the software shall be uninterrupted or error free. A Return Material Authorization (RMA) number must be obtained from the factory and clearly marked on the outside of the package before any equipment will be accepted for warranty work. National Instruments will pay the shipping costs of returning to the owner parts which are covered by warranty. National Instruments believes that the information in this manual is accurate. The document has been carefully reviewed for technical accuracy. In the event that technical or typographical errors exist, National Instruments reserves the right to make changes to subsequent editions of this document without prior notice to holders of this edition. The reader should consult National Instruments if errors are suspected. In no event shall National Instruments be liable for any damages arising out of or related to this document or the information contained in it. E XCEPT AS SPECIFIED HEREIN , N ATIONAL I NSTRUMENTS MAKES NO WARRANTIES , EXPRESS OR IMPLIED , AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE . C USTOMER ’ S RIGHT TO RECOVER DAMAGES CAUSED BY FAULT OR NEGLIGENCE ON THE PART OF N ATIONAL I NSTRUMENTS SHALL BE LIMITED TO THE AMOUNT THERETOFORE PAID BY THE CUSTOMER . N ATIONAL I NSTRUMENTS WILL NOT BE LIABLE FOR DAMAGES RESULTING FROM LOSS OF DATA , PROFITS , USE OF PRODUCTS , OR INCIDENTAL OR CONSEQUENTIAL DAMAGES , EVEN IF ADVISED OF THE POSSIBILITY THEREOF . This limitation of the liability of National Instruments will apply regardless of the form of action, whether in contract or tort, including negligence. Any action against National Instruments must be brought within one year after the cause of action accrues. National Instruments shall not be liable for any delay in performance due to causes beyond its reasonable control. The warranty provided herein does not cover damages, defects, malfunctions, or service failures caused by owner’s failure to follow the National Instruments installation, operation, or maintenance instructions; owner’s modification of the product; owner’s abuse, misuse, or negligent acts; and power failure or surges, fire, flood, accident, actions of third parties, or other events outside reasonable control. Copyright Under the copyright laws, this publication may not be reproduced or transmitted in any form, electronic or mechanical, including photocopying, recording, storing in an information retrieval system, or translating, in whole or in part, without the prior written consent of National Instruments Corporation. Trademarks LabVIEW ® and NI-488M ™ are trademarks of National Instruments Corporation. Product and company names listed are trademarks or trade names of their respective companies. WARNING REGARDING MEDICAL AND CLINICAL USE OF NATIONAL INSTRUMENTS PRODUCTS National Instruments products are not designed with components and testing intended to ensure a level of reliability suitable for use in treatment and diagnosis of humans. Applications of National Instruments products involving medical or clinical treatment can create a potential for accidental injury caused by product failure, or by errors on the part of the user or application designer. Any use or application of National Instruments products for or involving medical or clinical treatment must be performed by properly trained and qualified medical personnel, and all traditional medical safeguards, equipment, and procedures that are appropriate in the particular situation to prevent serious injury or death should always continue to be used when National Instruments products are being used. National Instruments products are NOT intended to be a substitute for any form of established process, procedure, or equipment used to monitor or safeguard human health and safety in medical or clinical treatment. © National Instruments Corporation i LabVIEW Tutorial Manual Table of Contents About This Manual Organization of This Manual ix Conventions Used in This Manual xi Related Documentation xii Customer Communication xiii Customer Education xiii Chapter 1 Introduction to LabVIEW Chapter Information 1-2 What Is LabVIEW? 1-2 How Does LabVIEW Work? 1-3 Installing LabVIEW 1-4 LabVIEW Files 1-4 Virtual Instruments 1-4 Front Panel 1-5 Front Panel Toolbar 1-7 Block Diagram 1-9 Hierarchy 1-11 Icon/Connector Pane 1-12 Tools Palette 1-14 Editing Techniques 1-15 Controls Palette 1-18 Controls and Indicators 1-19 Numeric Controls and Indicators 1-19 Boolean Controls and Indicators 1-20 Configuring Controls and Indicators 1-20 Functions Palette 1-21 Building a VI 1-21 Front Panel 1-23 Block Diagram 1-24 Wiring Techniques 1-27 Tip Strips 1-28 Showing Terminals 1-28 Wire Stretching 1-29 005 IXTOC Page i Thursday, August 24, 2000 10:02 AM Table of Contents LabVIEW Tutorial Manual ii © National Instruments Corporation Selecting and Deleting Wires 1-29 Bad Wires 1-30 Create & Wire Controls, Constants, and Indicators 1-30 Run the VI 1-31 Documenting the VI 1-32 Saving and Loading VIs 1-34 Summary 1-36 Chapter 2 Creating a SubVI Understanding Hierarchy 2-1 Creating the SubVI 2-1 Icon 2-2 Icon Editor Tools and Buttons 2-2 Connector 2-4 Using a VI as a SubVI 2-6 Front Panel 2-6 Block Diagram 2-7 Block Diagram Toolbar 2-8 Some Debugging Techniques 2-9 Opening, Operating, and Changing SubVIs 2-12 Hierarchy Window 2-13 Search Hierarchy 2-14 Online Help for SubVI Nodes 2-15 Simple/Complex Help View 2-15 Links to Online Help Files 2-16 Summary 2-17 Chapter 3 Loops and Charts Using While Loops and Charts 3-1 Front Panel 3-2 Block Diagram 3-3 Mechanical Action of Boolean Switches 3-6 Adding Timing 3-7 For Loop 3-9 Numeric Conversion 3-10 Using a For Loop 3-12 Front Panel 3-12 Block Diagram 3-13 Shift Registers 3-14 Using Shift Registers 3-16 005 IXTOC Page ii Thursday, August 24, 2000 10:02 AM Table of Contents © National Instruments Corporation iii LabVIEW Tutorial Manual Front Panel 3-16 Block Diagram 3-17 Multiplot Charts 3-19 Customizing Charts 3-20 Different Chart Modes 3-22 Summary 3-23 Additional Topics 3-24 Customizing Charts 3-24 Faster Chart Updates 3-24 Stacked Versus Overlaid Plots 3-24 Using Loops 3-24 Testing a While Loop before Execution 3-24 Using Uninitialized Shift Registers 3-26 Chapter 4 Arrays, Clusters, and Graphs Arrays 4-1 Array Controls, Constants, and Indicators 4-1 Graphs 4-2 Creating an Array with Auto-Indexing 4-2 Front Panel 4-2 Block Diagram 4-4 Multiplot Graphs 4-7 Polymorphism 4-8 Using Auto-Indexing on Input Arrays 4-9 Using Auto-Indexing to Set the For Loop Count 4-10 Using the Initialize Array Function 4-11 Using the Graph and Analysis VIs 4-12 Front Panel 4-13 Block Diagram 4-13 Using Arrays 4-15 Creating and Initializing Arrays 4-15 Using the Build Array Function 4-16 Finding the Size of an Array 4-18 Using the Array Subset Function 4-18 Using the Index Array Function 4-19 Summary 4-22 Additional Topics 4-23 More About Arrays 4-23 Efficient Memory Usage: Minimizing Data Copies 4-23 Customizing Graphs 4-23 Graph Cursors 4-24 005 IXTOC Page iii Thursday, August 24, 2000 10:02 AM Table of Contents LabVIEW Tutorial Manual iv © National Instruments Corporation Intensity Plots 4-25 Data Acquisition Arrays (Windows, Macintosh, and Sun) 4-25 Graph Examples 4-25 Chapter 5 Case and Sequence Structures and the Formula Node Using the Case Structure 5-1 Front Panel 5-1 Block Diagram 5-2 VI Logic 5-4 Using the Sequence Structure 5-5 Front Panel 5-5 Modifying the Numeric Format 5-5 Setting the Data Range 5-7 Block Diagram 5-8 Formula Node 5-11 Using the Formula Node 5-13 Front Panel 5-14 Block Diagram 5-15 Summary 5-16 Additional Topics 5-17 More Information on Case and Sequence Structures 5-17 Timing with Sequence Structures 5-17 More Information on Formula Nodes 5-17 Artificial Data Dependency 5-17 Chapter 6 Strings and File I/O Strings 6-1 Creating String Controls and Indicators 6-1 Strings and File I/O 6-2 Using String Functions 6-2 Front Panel 6-2 Block Diagram 6-3 Using Format Strings 6-4 Front Panel 6-4 Block Diagram 6-5 More String Functions 6-7 Front Panel 6-7 Block Diagram 6-8 File I/O 6-9 File I/O Functions 6-10 005 IXTOC Page iv Thursday, August 24, 2000 10:02 AM Table of Contents © National Instruments Corporation v LabVIEW Tutorial Manual Writing to a Spreadsheet File 6-11 Front Panel 6-12 Block Diagram 6-12 Appending Data to a File 6-14 Front Panel 6-14 Block Diagram 6-15 Reading Data from a File 6-16 Front Panel 6-17 Block Diagram 6-17 Using the File I/O Functions 6-18 Specifying a File 6-18 Paths and Refnums 6-19 File I/O Examples 6-20 Summary 6-20 Additional Topics 6-21 Datalog Files 6-21 Binary Byte Stream Files 6-22 Error I/O in File I/O Functions 6-22 Chapter 7 Customizing VIs VI Setup 7-1 Setting Window Options 7-2 SubVI Node Setup 7-3 Using Setup Options for a SubVI 7-3 Front Panel 7-4 Block Diagram 7-4 Front Panel 7-7 Block Diagram 7-8 Custom Controls and Indicators 7-10 Summary 7-13 Additional Topics 7-13 Simulating a Control/Indicator 7-13 Using the Control Editor 7-14 Chapter 8 Data Acquisition and Instrument Control Using LabVIEW to Acquire Data 8-1 About Plug-in Data Acquisition Boards (Windows, Macintosh, and Sun) 8-2 About VISA 8-2 About GPIB 8-3 About Serial Ports 8-4 005 IXTOC Page v Thursday, August 24, 2000 10:02 AM Table of Contents LabVIEW Tutorial Manual vi © National Instruments Corporation Using Serial Ports 8-5 Front Panel 8-5 Block Diagram 8-6 About VXI for Windows, Macintosh, and Sun 8-7 About Instrument Drivers 8-8 Using Instrument Drivers 8-9 Front Panel 8-9 Block Diagram 8-10 Using a Frequency Response Test VI 8-13 Front Panel 8-14 Block Diagram 8-15 Writing a Test Sequencer 8-17 Front Panel 8-17 Block Diagram 8-18 Summary 8-19 Additional Topics 8-20 Error Handling 8-20 Waveform Transfers 8-21 ASCII Waveforms 8-21 Binary Waveforms 8-22 Chapter 9 Programming Tips and Debugging Techniques Programming Tips 9-1 Debugging Techniques 9-5 Finding Errors 9-5 Single Stepping Through a VI 9-5 Execution Highlighting 9-6 Debugging a VI 9-6 Front Panel 9-6 Block Diagram 9-7 Opening the Front Panels of SubVIs 9-9 Summary 9-10 Chapter 10 Program Design Use Top-Down Design 10-1 Make a List of User Requirements 10-1 Design the VI hierarchy 10-2 Write the Program 10-3 Plan Ahead with Connector Patterns 10-3 SubVIs with Required Inputs 10-5 005 IXTOC Page vi Thursday, August 24, 2000 10:02 AM Table of Contents © National Instruments Corporation vii LabVIEW Tutorial Manual Good Diagram Style 10-5 Avoid Oversized Diagrams 10-5 Watch for Common Operations 10-6 Use Left-to-Right Layouts 10-7 Check for Errors 10-7 Watch Out for Missing Dependencies 10-9 Avoid Overuse of Sequence Structures 10-10 Study the Examples 10-10 Chapter 11 Where to Go from Here Other Useful Documentation 11-1 For Information on Advanced Topics 11-2 Appendix A Customer Communication Glossary Index 005 IXTOC Page vii Thursday, August 24, 2000 10:02 AM [...]... information that you may find helpful as you read this manual: • LabVIEW Analysis VI Reference ManualLabVIEW Code Interface Reference ManualLabVIEW Communication VI Reference ManualLabVIEW Data Acquisition Basics Manual (Windows, Macintosh, and Sun) • LabVIEW Data Acquisition VI Reference Manual (Windows, Macintosh, and Sun) • • LabVIEW User Manual • ANSI/IEEE Standard 488.1-1987, IEEE Standard... National Instruments Corporation 1-3 LabVIEW Tutorial Manual 01Intro Page 4 Thursday, August 24, 2000 10:04 AM Chapter 1 Introduction to LabVIEW Installing LabVIEW For instructions on how to install LabVIEW, see your LabVIEW release notes After installing LabVIEW, the default configuration setting is correct for the purposes of this tutorial If you would like to explore LabVIEW configuration options, see... and Common Commands • LabVIEW Tutorial Manual LabVIEW Instrument I/O VI Reference Manual LabVIEW Function Reference Manual available online; printed version available by request xii © National Instruments Corporation 005 ATM Page xiii Thursday, August 24, 2000 10:01 AM About This Manual Customer Communication National Instruments wants to receive your comments on our products and manuals We are interested... have opened LabVIEW, the program prompts you to enter your name, the name of your company, and your LabVIEW serial number (Macintosh) Launch LabVIEW by double-clicking on the LabVIEW icon in the LabVIEW folder If this is the first time you have launched LabVIEW, the program prompts you to enter your name, the name of your company, and your LabVIEW serial number (UNIX) Launch LabVIEW by typing labview ... window If LabVIEW is not in your executable path, you must type in the path to the LabVIEW executable followed by labview, as shown in the following example /usr/lib /labview/ labview (All Platforms) After a few moments, a blank, untitled front panel appears © National Instruments Corporation 1-5 LabVIEW Tutorial Manual 01Intro Page 6 Thursday, August 24, 2000 10:04 AM Chapter 1 Introduction to LabVIEW. .. easier LabVIEW Tutorial Manual 1-2 © National Instruments Corporation 01Intro Page 3 Thursday, August 24, 2000 10:04 AM Chapter 1 Introduction to LabVIEW How Does LabVIEW Work? LabVIEW includes libraries of functions and development tools designed specifically for instrument control For Windows, Macintosh, and Sun, LabVIEW also contains libraries of functions and development tools for data acquisition LabVIEW. .. VIs This manual is organized as follows: • © National Instruments Corporation Chapter 1, Introduction to LabVIEW, describes what LabVIEW is, what a Virtual Instrument (VI) is, how to use the LabVIEW environment (windows, menus, palettes, and tools), how to operate VIs, how to edit VIs, and how to create VIs ix LabVIEW Tutorial Manual 005 ATM Page x Thursday, August 24, 2000 10:01 AM About This Manual. .. icon/connector OBJECTIVE LabVIEW Tutorial Manual To open, examine, and operate a VI, and to familiarize yourself with the basic concepts of a virtual instrument 1-4 © National Instruments Corporation 01Intro Page 5 Thursday, August 24, 2000 10:04 AM Chapter 1 Introduction to LabVIEW Front Panel 1 (Windows) Open LabVIEW by double-clicking with the mouse button on the LabVIEW icon in the LabVIEW group If this... performance and efficiency of LabVIEW applications Contact National Instruments for a detailed course catalog and for course fees and dates © National Instruments Corporation xiii LabVIEW Tutorial Manual 01Intro Page 1 Thursday, August 24, 2000 10:04 AM Chapter Introduction to LabVIEW 1 This chapter describes what LabVIEW is, what a Virtual Instrument (VI) is, how to use the LabVIEW environment (windows,... would like to explore LabVIEW configuration options, see the Preferences Dialog Boxes section of Chapter 8, Customizing Your LabVIEW Environment, in the LabVIEW User Manual LabVIEW Files The LabVIEW system consists of the LabVIEW application and a number of associated files LabVIEW uses several directories and files from the hard drive to store information necessary to create your VIs These directories . read this manual: • LabVIEW Analysis VI Reference Manual • LabVIEW Code Interface Reference Manual • LabVIEW Communication VI Reference Manual • LabVIEW Data Acquisition Basics Manual . ix LabVIEW Tutorial Manual About This Manual The LabVIEW Tutorial contains the information you need to get started with the Laboratory Virtual Instrument Engineering Workbench (LabVIEW) . Chapter 1 Introduction to LabVIEW LabVIEW Tutorial Manual 1-4 © National Instruments Corporation Installing LabVIEW For instructions on how to install LabVIEW, see your LabVIEW release notes.

Ngày đăng: 27/06/2014, 00:20

TỪ KHÓA LIÊN QUAN

w