LabVIEW® Tutorial Manual January 1996 Edition Part Number 320998A-01 © Copyright 1993, 1996 National Instruments Corporation

. All Rights Reserved.

Internet Support GPIB: gpib.support@natinst.com DAQ: daq.support@natinst.com VXI: vxi.support@nat inst.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 Bulletin Board Support BBS United States: (512) 794-5422 or (800) 327-3077 BBS United Kingdom: 01635 55 1422 BBS France: 1 48 65 15 59 FaxBack Support (512) 418-1111 or (800) 329-7177 Telephone Support (U.S.) Tel: (512) 795-8248 Fax: (512) 794-5678 or (800) 328-2203 International Offices 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, I taly 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 00 85, Sweden 08 730 49 70, Switzerland 056 200 51 51, Taiwan 02 377 1200, U.K. 016 35 523545 National Instruments Corporate Headquarters 6504 Bridge Point Parkway Austin, TX 78730-5039 Tel: (512) 794-0100

Important Information Warranty The media on which you receive National Instruments software are warranted not t o fail to execute programming instructions, due to defects in materials and work manship, 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 rep lace software media that do not execute programming instructions if National Ins truments receives notice of such defects during the warranty period. National In struments does not warrant that the operation of the software shall be uninterru pted or error free. A Return Material Authorization (RMA) number must be obtaine d from the factory and clearly marked on the outside of the package before any e quipment will be accepted for warranty work. National Instruments will pay the s hipping costs of returning to the owner parts which are covered by warranty. Nat ional Instruments believes that the information in this manual is accurate. The document has been carefully reviewed for technical accuracy. In the event that t echnical 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 error s are suspected. In no event shall National Instruments be liable for any damage s arising out of or related to this document or the information contained in it. EXCEPT AS SPECIFIED HEREIN, NATIONAL INSTRUMENTS MAKES NO WARRANTIES, EXPRESS O R IMPLIED, AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. CUSTOMER’S RIGHT TO RECOVER DAMAGES CAUSED BY FAULT OR NEGLIGENCE ON THE PART OF NATIONAL INSTRUMENTS SHALL BE LIMITED TO THE AMOUNT TH ERETOFORE PAID BY THE CUSTOMER. NATIONAL INSTRUMENTS WILL NOT BE LIABLE FOR DAMA GES RESULTING FROM LOSS OF DATA, PROFITS, USE OF PRODUCTS, OR INCIDENTAL OR CONS EQUENTIAL DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. This limitation o f the liability of National Instruments will apply regardless of the form of act ion, whether in contract or tort, including negligence. Any action against Natio nal Instruments must be brought within one year after the cause of action accrue s. National Instruments shall not be liable for any delay in performance due to causes beyond its reasonable control. The warranty provided herein does not cove r damages, defects, malfunctions, or service failures caused by owner’s failure to follow the National Instruments installation, operation, or maintenance instruc tions; 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, storin g in an information retrieval system, or translating, in whole or in part, witho ut 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 companie s. WARNING REGARDING MEDICAL AND CLINICAL USE OF NATIONAL INSTRUMENTS PRODUCTS National Instruments products are not designed with components and testing inten ded to ensure a level of reliability suitable for use in treatment and diagnosis of humans. Applications of National Instruments products involving medical or c linical 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 clin ical treatment must be performed by properly trained and qualified medical perso nnel, and all traditional medical safeguards, equipment, and procedures that are appropriate in the particular situation to prevent serious injury or death shou

ld always continue to be used when National Instruments products are of established process, procedure, an health and safety in medical or

National Instruments products are being used. NOT intended to be a substitute for any form or equipment used to monitor or safeguard hum clinical treatment.

Table of Contents About This Manual Organization of This Manual .................................................... ....................................ix Conventions Used in This Manual ......... .......................................................................xi Relate d Documentation ................................................................ .................................xii Customer Communication .................... ........................................................................xiii Cus tomer 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 Techniqu es ............................................................................. ..........................1-15 Controls Palette ................................ .............................................................................1-1 8 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 S trips .......................................................................... ................1-28 Showing Terminals ......................................... .................................1-28 Wire Stretching .......................... ......................................................1-29 © National Instruments Corporation i LabVIEW Tutorial Manual

... ....... Constants................................... ........ .................................................................. 2-1 Icon ........ ................. ............................... 3-16 LabVIEW Tutorial Manual ii © National Instruments Corporation ..................................... ................................................................................................................................................................ 1-32 Saving and Loading VIs ................................... ........................................................................................................ ................... 1-30 Create & Wire Controls.......................................... 3-13 Shift Registers .................................................... 2-6 Block Diagram ......................................................... 2-14 Online H elp for SubVI Nodes ......... 1-36 Chapter 2 Creating a SubVI Understanding Hierarchy....... .......................................................................... ..................................................... ..................................................................................................................................................................................... 2-16 Summary ......................... ................. 2-12 Hierarchy Window .................................. ............................... ......................................... 2-2 Icon Editor Tools and Butto ns ............................ 3-6 Adding Timing ............................................ 2-2 Connector ............................................................................................. ............................................................................................................................... ............................................. 2-6 Front Panel .................. ..... ................................................. ........... ......................................................... 3-2 Bloc k Diagram .................................................................................................. 2-15 Links to Online Help Files . ......... 2-4 Using a VI as a SubVI .................... ..................................... 2 -9 Opening...................................................................................... ................... ......... ...... 1-29 Bad Wires ............................. ................................. 2-8 Some D ebugging Techniques ................................. ..................................................................... and Indi cators ...............................Table of Contents Selecting and Deleting Wires ..................................................... 2-1 Creating the SubVI .................................... 3-7 For Loop ................................. 2-15 Simple/Complex Help View ............................................... 3-14 Using Shift Regi sters ........................................... ............................ 3-12 Front Panel ............................................ 2-7 Block Diagram Toolba r ........... 3-1 Front Panel ................................... ........... ............................... 2-17 Chapter 3 Loops and Charts Using While Loops and Charts ..................... 1-31 Documenting the VI ........................................................................................................................ ........ 3-3 Mechanical Action of Boolean Switches ........................ .............................................................. and Changing SubVIs ............ 2-13 Search Hierarchy ........ 3-9 Numeric Conversion .................................................. 3-10 Using a For Loop . ......... .. ........ 1-30 Run the VI ....... ................. 3-12 Block Diagram .......................... 1-34 Summary ................................................................................................................. Operating.... .......................................................................................................... ............................ .

.

....................... ..................................... 4-22 Additional Topics ............................................... and Indicators ............................................. 4-2 Block Diagram .................................................................................................................. ................................................................................................. 4-8 Using Auto-Indexing on Input Arrays ............... ..................... ............................. 4-15 Creating and Initializing Arrays .................. 4-12 Front Panel ....... ...................... 3-20 Different Chart Modes ................. .......................................................................... ................................................................. 4-16 Finding the Size of an Array .................................................. 4-10 Using the Initialize Array Function ................ 4-4 Multiplot Graphs ............... ...................... ................................................................................................ ..................................................... ...................................................... and Graphs Arrays ...... 4-18 Using the Array Subset Function ... 3-16 Block Diagram .................. ........................... 3-24 Faster Chart Updates ............................................ 4-13 Using Arrays ........................................................... ............................ ....................... .............................. 4-1 Array Controls............................ 4-23 More About Arrays ......................... .................................................................................................................................................................................. 4-2 Creating an Array with Auto-Indexing ............................................................................................................. ........... .......... ................................................................... Constants ............................... ............... 4-11 Using the Graph and Analysis VIs ....... ...................................... 4-7 Polymorphism .................... .................................................................. 4-23 Customizing Graphs ...................................................................................... 3-17 Multiplo t Charts .... .................................................................................................................................................................................... ..................... ................................................................. ......... 4-23 Graph Cursors ......................................................................................... 4-2 Front Panel .... ................................................ ....................................................................... ................... 4-23 Efficient Memory Usage: Minimizing D ata Copies ... .................................................................................................................................. 4-15 Using the Build Array Function ........... 3-23 Additional Topics ................. 4-1 Graph s ...................................................... ................................ 3-22 Summary ...................... ............................................................ .......................... 4-24 ...... 3-24 Stacked Versus Overlaid Plots ........................... ............................................... ........... Clusters........ 4-18 Using the Index Array Function ..... 4-13 Block Diagram ............Table of Contents Front Panel .................................... .............. 3-26 Chapter 4 Arrays.... 4-9 Using Auto-Indexing to Se t the For Loop Count ....................... .................................................. 3-24 Testing a While Loop before Execution ................................................................................. 4-19 Summary ........ .................................................. 3-24 Using Loops .. ...... ............................ 3-19 Customizing Charts ....... ..................... ........... 3-24 Using Uninitialized Shift Registers ........ ... 3-24 Customizing Cha rts .......................

© National Instruments Corporation iii LabVIEW Tutorial Manual .

........ .............. ............................ .......... 5-13 Front Panel ........... 5-2 VI Logic ............. 6-8 File I/O ............................................................... ......................... 6-10 .............. ....................................... .............................................. 5-5 Modify ing the Numeric Format ............... ... ..................................................... 5-5 Front Panel .................. .................................................................. ................................................................... 4-25 Data Acquisition Arrays (Windows..................... 4-25 Chapter 5 Case and Sequence Structures and the Formula Node Using the Case Structure ............................................ 5-1 Front Panel ................................... 6-4 Block D iagram ................................................................... 5-14 Block Diagram ........... 6-3 Using Forma t Strings . .................................................. 5 -5 Setting the Data Range ...... .. 6-2 Block Diagram ...................................................................................................... 6-2 Using String Functions . and Sun) ............... ......................................... ............ 5-4 Using the Sequence Structure ......................................................................... .................... . 6-5 More String Functions .................................... ............................................................................................................................ 5-7 Block Diagram ........................................................................................ ............................................................................................................................................... 5-16 Additional Topics ..... ............................................................ ..... ............... 5-17 More Information on Formula Nodes .......................... 5-15 Summary ........................................................... 6-1 Creating String Controls and Indicators ....................... ................................................................................................................................................................................................................................................. 5-17 Chapter 6 Strings and File I/O Strings ................................................................................................................................................................................................................................... ..................................................................................... ......... 4-25 Graph Examples . .................................................Table of Contents Intensity Plots ............................... ........................ ........................................ 5-17 Timing with Sequence Structures .. 6-2 Fro nt Panel .................................................................. Macinto sh............................................................ 5-17 Artificial Data Depend ency .................................. .......................................................................... 6-7 Front Pa nel . ................................................ 6-1 St rings and File I/O ............................................................. ................................................................................. ................................................. ............................................ .. ............................................................................................................................ 5-8 Formula Node ............................................................... 5-11 Using the Formula Node ........... 51 Block Diagram ................................................................................... .......... 6-4 Front Panel .......................................................................... 6-7 Block Diagram .......... ........... 5-1 7 More Information on Case and Sequence Structures ... ........................... ....... 6-9 File I/O Functions .................................

LabVIEW Tutorial Manual iv © National Instruments Corporation .

.................................................................................................................................................................. 7-7 Block Diagram ......................................................................... and Sun) ........................................................................................................................... ................ 7-8 Custom Controls and Indicators ... ................... ..................................... .......................................... 6-22 Chapter 7 Customizing VIs VI Setup .................................................................. 6-14 Block Diagram ......................................................................................... ................................................................................................... .............. 7-3 Using Setup Options for a SubVI ................................................. ............................................................................................ 8-4 .......... 7-3 Front Panel .............. ....................................................................... ........................................................................................................... 7-14 Chapter 8 Data Acquisition and Instrument Control Using LabVIEW to Acquire Data ...... ................................................. .............................................................. ........................................................... ............................ .... .......................................................................................... 6-1 4 Front Panel ..................................... 6-20 Addition al Topics ....................................................................... 6-1 2 Block Diagram . 6-19 File I/O Examp les ............................. .............................................................................................................. ................................... ...................................................... ............................ 6-12 Appending Data to a File ........................ ................................................................................................ 7-1 0 Summary ... ......... 6-22 Error I/O in File I/O Functions .... 7-13 Additional Topics ........... 6-18 Paths and Refnums ..... 8-2 About GPIB ..... 8-2 About VISA ........ 6-18 Spe cifying a File ................................................... 6-17 Using the File I/O Functions ...................................................................................................... 8-3 About Serial P orts ..................... 7-13 Simulating a Control/Indicator ................................................................................................. 7-1 Setting Window Options ... ...................................... ................ 7-4 Fr ont Panel ............................................................. ....................................... 72 SubVI Node Setup .... 6-21 Datalog Files ................ .................. ........................................................................................ 6-15 Read ing Data from a File ............... ................................. 7-13 Using the Control Editor ................................. Macintosh.............. ............................................ 6-11 Front Panel ....................................................................... ................................................ ............... 6-16 Front Panel ...... ........................... 6-20 Summary ................................... .................................................. ............................. 6-21 B inary Byte Stream Files .............................................................................................................................................................................................. ........................... ...... 8-1 About Plug-in Data Acquisition Boards (Window s................................................................................... ................Table of Contents Writing to a Spreadsheet File ........................................ 6-17 B lock Diagram . ........................................................................ 7-4 Block Diagram ......

© National Instruments Corporation v LabVIEW Tutorial Manual .

....... ............................................................................................................ 9-6 Front Panel ......................... 8-13 Front Panel ................................ ................................................. ........................................................ 10-1 Make a List of User Requirements ..................... ..... .................................................. 9-1 Debugging Techniques ........................................... ..... ............. 8-21 Binary Waveforms ........................ 8-10 Using a Frequ ency Response Test VI .................................................................. 8-22 Chapter 9 Programming Tips and Debugging Techniques Programming Tips .................... ...................................................................... 10-5 ................................. 8-15 Writing a Test Sequencer .................................................................................................................................................... 8-9 Block Diagram .. 10-3 SubVIs with Required Inputs ............................................................ 8-8 Using Instrument Drivers .......................................... .......... Macintosh....................................... ..................................... 8-18 Summary ......................... 10-1 Design the VI hierarchy ........................................................................................ .. 10-2 Write the Program .................................................................. 9-7 Opening the Front P anels of SubVIs .............................. 8-20 Erro r Handling ................................................... 8-9 Front Panel .......... 8-19 Additional Topics .................................. ......... .......... ......................... 9-6 Block Diagram ................. ......................................................................... . 9-9 Summary .............................................................................. ................................................................................................... .......................................................................................................................................................................................... 8-5 Front Panel ............. ............. 9-5 Finding Errors ................ .......... 8-21 ASCII Waveforms ............ and S un ..................................................................................................... .... 9-5 Single Stepping Through a VI ....... 8-17 Front Panel .................. ................................................................................... .................................... ....................................................................................................................................................... 8-17 Block Diagram ............. 8-20 Waveform Transfers ...... ................................ ............Table of Contents Using Serial Ports ................. 8-5 Block Diagram ................... ............................................... 9-10 Chapter 10 Program Design Use Top-Down Design ......... ........................................................................................................................................................... .................... ..................................................................... .................... ........................................................................................ 8-14 Block Diagram ......................... .......... 9-6 Debugging a VI ....................... 9-5 Execution Highlighting ........................................................ ............................ ................................... ................................................................................. ...................... ................................. .............................................................. 10-3 Plan Ahead with Connector Pa tterns .......................................................................................................................................... 8-7 About Instru ment Drivers .................................... 8-6 About VXI for Windows....

LabVIEW Tutorial Manual vi © National Instruments Corporation .

..................................... .............. ........... ....................................................... 10-10 Chapter 11 Where to Go from Here Other Useful Documentation ...... 10-5 Avoid Oversized Diagrams ................................................... ....................... ................................................................................................... .............................................. 10-6 Use Left-to-Right Layouts ............................ 10-9 Avoid Overuse of Sequence Structures ................ ...................................................... 10-5 Watch f or Common Operations ..Table of Contents Good Diagram Style ..................................................................... 11-2 Appendix A Customer Communication Glossary Index © National Instruments Corporation vii LabVIEW Tutorial Manual ............................................................... 10-10 Study the Examples ............................................... ................... ................................................................................ 10-7 Watch Out for Missing Dependencies ....................... 11-1 For Information on Advanced Topics .................... ........ 10-7 Check for Errors ............

This manual does not expla in every LabVIEW feature. how to use the LabVIEW environment (windows. describes what LabVIEW is. and you can also use it for a wide variety of other programmin g applications. Its goal is to introduce the most important LabVIEW fe atures in the context of addressing programming tasks. Therefore. Intro duction to LabVIEW.About This Manual The LabVIEW Tutorial contains the information you need to get started with the L aboratory Virtual Instrument Engineering Workbench (LabVIEW) software package. and how to create VIs. © National Instruments Corporation ix LabVIEW Tutorial Manual . how to edit VIs. and test and measurem ent applications. how to operate VIs. and tools). process control. This manual presumes that you know how to operate your computer and that you are familiar with its operat ing system. and includes lessons to teach you what you need to know to build your own virtual instruments (VIs) as quickly as possible. although you can design a VI that may incorporate several of these basic concepts. This manual is organized as follows: • Chapter 1. Some of the chapters in this tutorial include an Additional Topics section. This manual gives you an overview of the fundamental concepts of LabVIEW. Organization of This Manual Each chapter discusses a different LabVIEW concept. w hich gives an overview of advanced LabVIEW features and refers you to other docu mentation and example VIs. L abVIEW simplifies scientific computation. palettes. menus. we encourage y ou to work through the entire tutorial before you begin building your applicatio n. what a Virtual Instrument (VI) is .

About This Manual • Chapter 2. and Sun) and Instrument Control. and teaches you ho w to use For Loops. teaches you how to create string controls and indicators and teaches you how to use string functions. Where to Go From Here. discusses VXI (for Win dows. and Graphs. Progra mming Tips and Debugging Techniques. Chapter 10. Chapter 5. use basic array functions. shows you how to control a serial port interface from LabVIEW. Macintosh. Customer Communication. describes what a subVI is. Chapter 3. and teaches you how to use a VI as a subVI. introduces While Loops. contains information on other useful res ources to examine as you build your LabVIEW applications. Chapter 8. Chapter 11. and teaches you about using a Frequency Response Test VI. teaches you about GPIB. The Appendix. Macint osh. Chapter 4. teaches you about VISA. Loops and Charts. teaches you how to creat e the icon and connector. teaches you about instrument drivers and how to use t hem. teaches you how to display data in a chart. and graphs. Strings an d File I/O. Case and Se quence Structures and the Formula Node. offers som e techniques to use when creating programs and offers programming style suggesti ons. Program Design. contains forms you can use to request help from National Instrum ents or to comment on our products and manuals. Chapter 9. Clusters. clusters. le input and output operations. gives you tips for programming and debuggin g VIs and teaches you editing techniques. • • • • • • • • • • LabVIEW Tutorial Manual x © National Instruments Corporation . Chapter 6. You also learn wha t polymorphism is. Chapter 7. Custo mizing VIs. shows you how to use the VI and subVI setup options and how to make custom controls and indicators. describes how to use the Case structure and Sequence structure. Arrays. Data Acquisition (for Windows. discusses how to acquire data from a plugin data acquisition board. Creating a SubVI. discusses how to cr eate arrays. and Sun). and how to use graphs to display data. sequence locals and Formula Nodes. teaches you about shift registers and how to use them. save data to les in spreadsheets. and write data to and read data from text les.

<Shift>. and les. or an introduction to a key concept. italic monospace <> » © National Instruments Corporation xi LabVIEW Tutorial Manual . mnemonics. and finally select the Substitute Fon ts option from the last dialog box. s elect the Page Setup item. and symbols. Sections of code. directories. acronyms. • Conventions Used in This Manual The following conventions are used in this manual: bold italic bold italic monos pace Bold text denotes menus. as in drivename\d ir1name\ dir2name\myfile. The Index cont ains an alphabetical list of key terms and topics in this tutorial. metric pre xes. In a ddition. Italic text denotes e mphasis. Bold italic tex t denotes a note. Angle brackets enclose the name of a key on the keyboard—for example. synt ax examples. including th e page where you can nd each one. caution. paths Paths in this manual are denoted using backslashes (\) to separate drive names. Italic text in this font denotes that you must supply the appropriate words or values in the place of these items. or dialog box buttons or options. The seque nce File»Page Setup»Options»Substitute Fonts directs you to pull down the File menu.About This Manual • The Glossary contains an alphabetical list of terms used in this manual. a cross reference. menu items. select Options. or warning. bold text denotes VI input and output parameters. includi ng abbreviations. programming examples. A hyphen between two or more key names enclosed in angle brackets denotes that you should simultaneously press the named keys–for example. Monospace font denotes text or characters that you enter using the keyboard. and messages and responses that the computer automatically prints t o the screen also appear in this font. The » symbol lead s you through nested menu items and dialog box options to a nal action. <Shift-Delete> .

IEEE Standard Digital Interface for Programmable Instrumentation A NSI/IEEE Standard 488. acronyms. Macintosh. Cautio n: Note: This icon to the left of bold italicized text denotes a caution.2-1987.1-1 987 IEEE 488. and Commo n Commands LabVIEW Function Reference Manual available online. Related Documentation The following documents contain information that you may find helpful as you rea d this manual: • • • • • • • • • • LabVIEW Analysis VI Reference Manual LabVIEW Code Interf ence Manual LabVIEW Communication VI Reference Manual LabVIEW Data Acquisition B asics Manual (Windows.2 and the ANSI/IEEE Standard 488. respectively. Abbreviations. metric prefixes. Protocols. which de ne th e GPIB.2 refer to the ANSI/IEEE Standard 488. which alerts you to important inform ation. LabVIEW Tutorial Manual xii © National Instruments Corporation . Warning: This icon to the left of bold italicized text denotes a warning . symbols. IEEE Standard Codes.1 and IEEE 488. which alerts you to the possibility of data loss or a system crash. Macintosh. which alerts you to the possibility of damage to you or your equipment.2-1987. and Sun) LabVIEW Data Acquisition VI Reference Manual (Windows. Formats.1-1987. and terms a re listed in the Glossary. and Sun) LabVIEW Instrument I/O VI Reference Manual LabVIEW User Manual ANSI/IEEE Standar d 488.1 and IEEE 488. This icon to the l eft of bold italicized text denotes a note. printed version a vailable by request. mnemonics.About This Manual IEEE 488.

and we wan t to help if you have problems with them.About This Manual Customer Communication National Instruments wants to receive your comments on our products and manuals. These forms are in the Appendix. Customer Communication. Contact National Instruments for a detaile d course catalog and for course fees and dates. The comprehensi ve Basics course not only teaches you LabVIEW fundamentals. at the end of this manual. To make it easy for you to contact us. Customer Education National Instruments offers hands-on LabVIEW Basics and Advanced courses to help you quickly master LabVIEW and develop successful applications. but also gives you h ands-on experience developing data acquisition and instrument control applicatio ns. © National Instruments Corporation xiii LabVIEW Tutorial Manual . We are interested in the applications you develop with our products. this manual contains comment and configuration forms for you to complete. The follow-up Advanced course teaches you how to maximize the performance an d efficiency of LabVIEW applications.

refer to the address page on the inside front cover of this manual for information about contacting National Instrument s. Instead. If you would like more training after using th is manual. and how to create VIs. this tutorial explains t he theory behind LabVIEW. what a Virtual Instrument (VI) is. how t o use the LabVIEW environment (windows. and guides you through practical uses of LabVIEW features as app lied to actual programming tasks. Because LabVIEW is such a featu re-rich program development system. National Instruments offers hands-on LabVIEW courses to help you quic kly master LabVIEW and develop successful applications. palettes. and tools). this tutorial cannot practically show you ho w to solve every possible programming problem.Chapter Introduction to LabVIEW 1 This chapter describes what LabVIEW is. but also gives you ha nds-on experience developing data acquisition (for Windows. menus. For a detailed cours e catalog and for course fees and dates. © National Instruments Corporation 1-1 LabVIEW Tutorial Manual . Macintosh. how to oper ate VIs. and Sun) and instrument control applications. contains exercises to teach you to use the LabVIEW pro gramming tools. how to edit VIs. The follow-up LabVIEW Advanced course teach es you how to maximize the performance and efficiency of LabVIEW applications in addition to teaching you the advanced features of LabVIEW. The comprehensive LabVIE W Basics course not only teaches you LabVIEW fundamentals.

What Is LabVIEW? LabVIEW is a program development application. while LabVIEW uses a graphical programming language. or National Instruments LabWindows. data p resentation. LabVIEW contains application specific libraries for data acquisition and VXI instrument control. You Will Learn: • • • • • • What LabVIEW is. LabVIEW also contains applicationspecific libraries for GPIB and serial instrument control. so you can set breakpoints. How to edit VIs. animate program execution to see how data pa sses through the program. G. LabVIEW uses terminology. LabVIEW has e xtensive libraries of functions and subroutines for most programming tasks. data analysis. How to creat e VIs. You can use LabVIEW with little programming experience. However. and Sun. LabVIEW includes conventional program development tools. How to use the LabVIEW envi onment (windows and palettes).Chapter 1 Introduction to LabVIEW Chapter Information Each chapter begins with a section like the one that follows. For Windows. and single-step through the program to make debugging and program development easier. What a Virtual Instrument (VI) is. much like various commercial C or BASIC development systems. Other programming systems use text-based languages to create lines of code. Macintosh. and data storage. listing the learni ng objectives for that chapter. and ideas familiar to scientists and engineers and relies on graphical sym bols rather than textual language to describe programming actions. LabVIEW Tutorial Manual 1-2 © National Instruments Corporation . to create programs in block diagram form. How to operate VIs. i cons. LabVIEW is different from those applications in one important respect.

debugging is much easier. You input data using a keyboard and mouse. The block diagram supplies a pictorial sol ution to a programming problem. LabVIEW also contai ns libraries of functions and development tools for data acquisition. The icon and connector pane of a VI work like a g raphical parameter list so that other VIs can pass data to it as a subVI. © National Instruments Corporation 1-3 LabVIEW Tutorial Manual . because it simulates the panel of a p hysical instrument. your top-level VI contains a co llection of subVIs that represent application functions. • • With these features. LabVIEW pr ograms are called virtual instruments (VIs) because their appearance and operati on imitate actual instruments. LabVIEW promotes and adheres to the concept of modular prog ramming. so that you can develop a specialized set of subVIs suited to ap plications you can construct. and accept parameters from higher-level VIs. which you construct in G. • VIs contain an interactive user i nterface. VIs receive instructions from a blo ck diagram. VIs have both an interactive user interface and a s ource code equivalent. Macintosh. or as subprograms within other programs or subprograms. The block diagram contains the source code for t he VI. many low-level subVIs often perform tasks common to severa l applications. A VI within another VI is called a subVI. Because you can execute each subVI by itself. You can use them as top-lev el programs. and t hen view the results on the computer screen. You divide an application into a series of tasks. push buttons. graphs. The followin g are descriptions of these three VI features. which is called the front panel. and Sun. which you can divide again until a complicated application becomes a series of simple subtasks. they are analogous to functions from con ventional language programs. The front panel can contain knobs. and other controls and indicators.Chapter 1 Introduction to LabVIEW How Does LabVIEW Work? LabVIEW includes libraries of functions and development tools designed specifica lly for instrument control. You b uild a VI to accomplish each subtask and then combine those VIs on another block diagram to accomplish the larger task. However. VIs use a hierarchical and modular structure. apart from the rest of the application. Finally. Furthermore. For Windows.

Virtual Instruments LabVIEW programs are called virtual instruments (VIs). in the LabVIEW User Manual. OBJECTIVE To open. and operate a VI. and to familiarize yourself with the basic concepts of a virtual instrument. LabVIEW Tutorial Manual 1-4 © National Instruments Corporation .lib directory. You can access the contents of these files and directories from within the LabVI EW environment.lib directory. located in the vi. the block diagram. This directory contains libraries of VIs. among others: • • • The vi. The tutorial. LabVIEW Files The LabVIEW system consists of the LabVIEW application and a number of associate d files. see the Preferences Dialog Boxes section of Chapter 8. su ch as analysis VIs.Chapter 1 Introduction to LabVIEW Installing LabVIEW For instructions on how to install LabVIEW. Customizing Your LabVIE W Environment. contains a library of VIs that this tu torial uses. This directory contains many sample VIs that demonstrate LabVIEW’s program functionality. The examples directory. see your LabVIEW release notes. examine. Afte r installing LabVIEW. VIs have three main parts : the front panel. These directories and files include. If you would like to explore LabVIEW configuration options . LabVIEW uses several directories and files from the hard drive to store information necessary to create your VIs. Th is file. the default configuration setting is correct for the purpo ses of this tutorial. and the icon/connector.llb library.

If this is the first time you h ave opened LabVIEW. as shown in the following example. If LabVIEW i s not in your executable path. (Windows) Open LabVIEW by double-clicking with the mouse button on the LabVIEW icon in the LabVIEW group. If this is the first time you have launched LabVIEW. (UNIX) Launch LabVIEW by typing labview <Return> in a shell window. and your LabVIEW serial number. /usr/lib/labview/labview (All Platforms) After a few moments. a blank. (Macintosh) Launch LabVIEW by double-clicking on the LabVIEW icon in the LabVIEW folder. and your LabVIEW serial numb er. untitled front panel appears. © National Instruments Corporation 1-5 LabVIEW Tutorial Manual . the program prompt s you to enter your name. the name of your company. the program prompts you to enter your name. you must type in the path to the LabVIEW executab le followed by labview. the name of your company.Chapter 1 Introduction to LabVIEW Front Panel 1.

as the following illustration shows. the direct ories and paths being searched. Select File»Open. the Temperature System Demo VI front panel appears. After a few moments.llb. Open the Temperature System Demo VI by following these steps. and the number of the VI in the loading process. Double-click on Temperature System Demo. the name of the hard drive that the VI is located on.vi. Double-click on examples. b. The front panel contains LabVIEW Tutorial Manual 1-6 © National Instruments Corporation . While the VI loads.Chapter 1 Introduction to LabVIEW 2. Double-click on tempsys. c. Double-click on apps. which describes the name of the VI cur rently loading. a. The following illustration shows the dialog box that appears when you load the Temperature System Demo VI. a dialog box appears.

chart s. Boolean switches. Front Panel Toolbar The front panel contains a toolbar of command buttons and status indicators that you use for running and debugging VIs. Front Panel Toolbar: Run button–Runs the VI Continuous run button–Runs the VI over and over.Chapter 1 Introduction to LabVIEW several numeric controls. knob controls. slide controls. useful for d ebugging Stop button–Aborts VI execution © National Instruments Corporation 1-7 LabVIEW Tutorial Manual . graphs. It also contains font options and alignm ent and distribution options for editing VIs. and a thermometer indicator.

<return> (Macintosh). size. or by clicking and draggi ng across the value with the Labeling tool. The Temperatur e System Demo VI simulates a temperature monitoring application. 2. whi ch you can change using the Temperature Range knobs in the middle left border. for two or more objects 1. The Update Period slide controls how fast the VI acquires the new temperatur e readings. eith er by double-clicking on the value you want to change. I f the current temperature reading is out of the set range. The analysis consists of a running calculation of the mean and standard deviation of the temperature v alues and a histogram of the temperature values. <Return> (Sun). and so on. for two or more object s Distribution ring–Sets distribution options. top edge. run the VI by clicking on th e run button in the toolbar. Use the Operating tool to ch ange the values of the high and low limits. This VI continues to run until you click the Acquisition switc h to Off. The button changes appearance to indicate that the VI is running. LEDs light up next to the thermometer. including gaps. or click the mouse in an open area of the window to enter the new value. highlight the old value. compression. You can also click on the enter button in the toolbar . 3. type a new value and press <Enter> (Windows). and so on. shown in the following illustration. On the front panel. style. You can also turn the data analysis on and off. First.Chapter 1 Introduction to LabVIEW Pause/Continue button–Pauses VI execution/Continues VI execution Font ring–Sets font options. by placi ng the Operating tool on the slider and dragging it to a new location. When the initial value is highlighte d. including vertical. or <Enter> (HP-UX). and color Alignment ring–Sets alignmen t options. LabVIEW also plots high and low temperature limits on the chart. The VI takes te mperature readings and displays them in the thermometer indicator and on the cha rt. LabVIEW Tutorial Manual 1-8 © National Instruments Corporation . Chang e the Update Period slide control. left. including font type.

In this case. such as placing a switch on the front panel. and is an example of how intricate LabVIEW programming can be. Subsequent chapters in thi s tutorial detail structures and elements mentioned in this section. © National Instruments Corporation 1-9 LabVIEW Tutorial Manual .Chapter 1 Introduction to LabVIEW Label Digital Display Scroll Button Slider Housing 4. this is not the best way to stop VI s because the stop button halts the program immediately. Although the VI stops if you click on the stop button in the toolbar. Note: You should always wait for a VI to complete execution or you should design a met hod to stop it. It is not n ecessary to understand all of these block diagram elements at this time to appre ciate the nature of a block diagram. and so it is probably not desirable. and comes to a completion when you click the Acquisition switch. 5. the V I collects the last set of temperature values. Practice adjusting the other controls. Stop the VI by clicking on the Acquisitio n switch. The VI may not stop immediately because the VI has to wait for the las t equation or analysis set to complete operation. performs the analysis. Block Diagram The following block diagram represents a complete LabVIEW application. This may interrupt crit ical I/O functions.

The components are wired together to show the flow of dat a within the block diagram. analysis iteration value. The outermost structure is a While Loop. and stan dard deviation. and mul tiplication functions. which is the VI equivalent o f a program. The values that the shift registers store here are the histogram. G. Case Structure Open the block diagram of the Temperature System Demo VI by choosing Windows»Show Diagram. You can think of the block diagram as source code. Each front panel has an accompanying block diagram. in that order. The components of the b lock diagram represent program nodes such as For Loops. The ar row terminals on the border of the While Loop are called Shift Registers and sto re values from one iteration of the loop to the next. LabVIEW Tutorial Manual 1-10 © National Instruments Corporation . You build the block diagram using the graphical programming languag e.Chapter 1 Introduction to LabVIEW For Loop While Loop Shift Registers 1. Examine the different objects in the block diagram. mean. 2. Case structures. It continue s to run what is inside of it until the Acquisition switch is set to Off.

the VI performs no analysis. The subsequent chapters in this tutorial discuss in greater de tail each element that appears in this VI. Hierarchy The power of LabVIEW lies in the hierarchical nature of VIs. The Case structure controls the temperature analysis . The For Loop tak es 10 temperature readings at the rate specified by Update Period and plots each reading on the thermometer and the chart. and the other keeps a running histogram of th e acquired temperatures. You can see this b y clicking on one of the arrows next to the word True. The VI also compares the temperature to the high and low limits. two subVIs analyze the data—one keeps a running mean and stand ard deviation of the temperatures. The acquisition of the data takes place inside the For Loop. If the Analysis switch is off. and the histogram and analysis iteration value are reset to z ero. © National Instruments Corporation 1-11 LabVIEW Tutorial Manual .Chapter 1 Introduction to LabVIEW The two main structures inside the While Loop are a For Loop and a Case structur e. look at a VI that the Temperature System Demo VI uses as a subVI in its block d iagram. After you create a VI. Here. As an example. In the False case. You do not need to fully understand all of the structur es at this point. you can use it as a subVI in the block diagram of a higher level VI. no ana lysis takes place. Change back to the True case using the same method you used to change to th e False case. You can have an essentially unlimited number of layers in the hierarchy.

The cursor changes to the Wiring to ol. The connector termina ls determine where you must wire the inputs and outputs on the icon. The icon and connec tor are located in the upper right corner of the VI front panel. It turns black. the data in it passes to (or is received fro m) the other end of the wire. Select Show Connector from the pop-up menu.Chapter 1 Introduction to LabVIEW 1. Notice tha t a control or indicator becomes highlighted on the front panel. 3. The foll owing front panel appears. Icon/Connector Pane You use the icon/connector pane to turn a VI into an object that you can use in the block diagrams of other VIs as a subroutine or function. They correspond to t he controls and indicators on the front panel of the VI. 2. A pop-up menu appears. The termina ls are analogous to parameters of a subroutine or function. The icon graphi cally represents the VI in the block diagram of other VIs. Open the Temperature Status subVI by double-clicking on the subVI icon. Put the Operating tool on the icon pane in the upper right corner of the front panel and pop up. The icon hides the conn ector until you choose to view it. LabVIEW Tutorial Manual 1-12 © National Instruments Corporation . shown on the left. Icon Connector The squares on the connector are terminals that correspond to the controls and i ndicators on the front panel. When you wire t he control or indicator (terminal). Click on a terminal. 4.

At this time. 6. Select Show Icon. Select File»Close and do not save any changes you have made. Place the Wiring tool on the connector in the front panel and pop up. © National Instruments Corporation 1-13 LabVIEW Tutorial Manual . and maintain. you can make your block diagrams modular. It is en ough to notice that a subVI can be complex or simple in itself. By creating subVIs. The Wiring tool changes back to the Operating too l.Chapter 1 Introduction to LabVIEW 5. 8. understand. Switch to the front panel (Windows»Show Panel). yo u do not need to understand what all the parts of the block diagram do. 9. Switch to the block diagram by selecting Windows»Show Diagram. A pop-up m enu appears. 7. This modularity ma kes VIs easy to debug.

If you have closed the Tools palette.Chapter 1 Introduction to LabVIEW Tools Palette LabVIEW uses a floating Tools palette.The following Illustration displays the Tools palette. and selects objects Labeling to ol–Edits text and creates free labels Wiring tool–Wires objects together in the bloc k diagram Object pop-up menu tool–Brings up on a pop-up menu for an object Scroll tool–Scrolls through the window without using the scrollbars Breakpoint tool–Sets br eakpoints on VIs. select Windows»Show Tools Palette to display th e palette. and cases Probe tool–Creates probes on wires Color copy tool–Copies colors for pasting with the Color tool Color tool–S ets foreground and background colors LabVIEW Tutorial Manual 1-14 © National Instruments Corporation . Operating tool–Places Controls and Functions palette items on the front panel and block diagram Positioning tool–Positions. which you can use to edit and debug VIs. resizes. functions. loops. You use the <Tab> key to tab through the commonly used tools on the palette. sequences.

The Editing Exercise VI is located in examples\general\contro ls\ smplctls. To work on the Editing Exercise V I. Choose the Positioning tool from the Tool s palette. The front panel of the Editing Exercise VI contains a number o f LabVIEW objects. Click on the digital control and drag it to another location. © National Instruments Corporation 1-15 LabVIEW Tutorial Manual . Click on a blank space on the front panel to deselect the control. 3. 1. Your objective is to change the front panel of the VI as the following illustration shows. If the Tools palette is not visible. b.Chapter 1 Introduction to LabVIEW Editing Techniques OBJECTIVE To learn LabVIEW editing techniques. a. and then click on t he label and drag it to another location. select File»Open.llb. Notice that the label follows the control. select Windows»Show Tools Palette to display it. 2. The control owns the label. Reposition the digital control.

or click on the first letter in the label and drag the cursor to the end of the label. a. Click on the selected switches and drag them to a different location. Copy the digital control to the block diagram to create a corr esponding constant. 5. 8. Click on the front panel t o make it active. hold down <Ctrl> (Windows). 7. The digital control now appears as a correspondi ng constant on the block diagram. Select the text by using the Labeling tool. Cl ick on the digital control. You can position an owned lab el anywhere relative to the control. Choose the Positioning tool from the Tools palette. drag the digita l control to the block diagram. or <Alt> (HP-UX). Using the Positioning tool. You can also use the Copy and Paste options fr om the Edit menu to copy the control and then paste it to the block diagram. Using the Positioning tool. but when the control moves. and drag until all the switc hes lie within the selection rectangle. click on the free label. 9. you can use t he middle mouse button to drag the label. click in an open area near the four switches. While holding the mouse button down. Create an owned label for the digital indicator. and drag the duplicate of the free label to a new location. hold down the mouse button. This creates a duplicate copy of the l abel. <o ption> (Macintosh). the label follo ws. Reposition the four slide switches as a group. LabVIEW Tutorial Manual 1-16 © National Instruments Corporation . b. Change the selected text size to 12 points by choosing Size from the Font rin g. 11. b. a. Switch to the block diagram by selecting Windows»Show Diagram. b. Change the font size of the free label. 6.Chapter 1 Introduction to LabVIEW Notice that the control does not follow the label. located in the toolbar. Mov e the block diagram so that you can see both windows. Dupl icate the free label. For UNIX. Not e: You can use this same process to drag or copy a constant from the block diagr am to the front panel to create a corresponding control. You can triple-click on the text. 10. a. <meta> (Sun). 4.

hold down the <Shift> key while resizing the LED. © National Instruments Corporation 1-17 LabVIEW Tutorial Manual . 14. When you release the mouse button . Place the four button swit ches so they are aligned horizontally and evenly spaced. c. Choose a color from the selection palette. Change the color of the round LED. 12. a. b. Using the Positionin g tool. the object assumes the last color you selected. Resize the round LED. click in an open area near the four switches and drag until all the swit ches lie within the selection rectangle. Click and drag the cursor outwa rd to enlarge the LED. Pop up on the digital indicator and choose Show»Label from the pop-up menu. Type Digital Indicator inside the bordered box and click the mouse button out side the label. Space the switches evenly by clicking on the Distribution ring and choosing the Horizontal Centers distribut ion. 13 . The front panel should now look similar to the following illustration. Align the switches horizontally by clicking on the Alignment ring in the tool bar and choosing the Vertical Centers alignment. If you want to maintain the current ratio of horizontal t o vertical size of the LED.Chapter 1 Introduction to LabVIEW a. a. b. b. You can also end text entry by pressing <Enter> on the numeric k eypad. Place the Positioning tool over a corner of the LED until the tool becomes the Resizing cursor. pop up on the LED. Using the Color tool.

Controls Palette The Controls palette consists of a graphical. floating palette that automaticall y opens when you launch LabVIEW. You use this palette to place controls and indi cators on the front panel of a VI. Do not save any changes. Close the VI by selecting File»Close. you can open the palette by selecting Windo ws»Show Controls Palette from the front panel menu. LabVIEW Tutorial Manual 1-18 © National Instruments Corporation . If the Controls palette is not visible. You can also pop up on an open area in the front panel to access a temporary copy of the Controls palette.Chapter 1 Introduction to LabVIEW 15. Each top-level icon contains subpalettes.

The two most commonly used numeric objects are the di gital control and the digital indicator. Controls and Indicators Numeric Controls and Indicators You use numeric controls to enter numeric quantities. while numeric indicators d isplay numeric quantities.Chapter 1 Introduction to LabVIEW The following illustration displays the top-level of the Controls palette. Label Increment Buttons Digital Control Label Digital Indicator © National Instruments Corporation 1-19 LabVIEW Tutorial Manual .

buttons. on any object that has a pop-up menu. shown at left. An easy way to access the pop-up menu is to click the Object pop-up menu tool. Pop up on the label for its pop-up menu Pop up on the digital display for its pop-up menu LabVIEW Tutorial Manual 1-20 © National Instruments Corporation . and LEDs.Chapter 1 Introduction to LabVIEW Boolean Controls and Indicators You use Boolean controls and indicators for entering and displaying Boolean (Tru e/False) values. The most commonly used Boolean objects are the vertical switch and the round LED. The following picture illustrates this display method for a digital control. Popping up on individual components of controls and indicators d isplays menus for customizing those components. Configuring Controls and Indicators You can configure nearly all the controls and indicators using options from thei r pop-up menus. Boolean objects simulate switches.

you can select Windows»Show Functions Palette from the block diagram menu to display i t. Each to p-level icon contains subpalettes. VIs. You can also pop up on an open area in the block diagram to access a temporar y copy of the Functions palette. and then multiply the reading by 100. © National Instruments Corporation 1-21 LabVIEW Tutorial Manual . You will use the Demo Voltage Read VI to measure the voltage. and so on) on the block diagram of a VI. If the Functions palette is not visible.0 to convert the voltage into a temperature (in degrees F).Chapter 1 Introduction to LabVIEW Functions Palette The Functions palette consists of a graphical. indicators. The following illustration displays the top-lev el of the Functions palette. You use this palette to place nod es (constants. floating palette that automatical ly opens when you switch to the block diagram. Building a VI OBJECTIVE To build a VI that simulates acquisition of a temperature reading.

A/D Board PC Sensor (HP-UX) The sensor could also be connected to an analog-to-digital converter tha t is connected to the computer through GPIB. Macintosh. as shown in the following illustrat ion. This also converts voltage to digital data. and Sun) The sensor connects to an analog-to-digital conver ter (A/D) board. (Windows. as shown in the following illustration. which converts voltage to digital data.Chapter 1 Introduction to LabVIEW Imagine that you have a transducer or sensor that converts temperature to voltag e. GPIB Board hp GPIB-based ADC HP Workstation Sensor LabVIEW Tutorial Manual 1-22 © National Instruments Corporation .

Open a new front panel by selecting File»New. if you have closed all VIs. use right-click (<command>-click on Macintosh).0.0 in thermometer scale to highlight it . Us ing the Labeling tool.0 in the scale and click the mouse button anywhere outside the displ ay window. and place it on the front panel. b. select New VI from the LabVIEW dialog box. Type Temp inside the label text box and click on the enter button on the toolbar. © National Instruments Corporation 1-23 LabVIEW Tutorial Manual . LabVIEW automatically scales the intermediary increments.Chapter 1 Introduction to LabVIEW Front Panel 1. You can also access the Controls palette by popping up in an open area of the front panel. 4. Note: If the Controls palette is not visible.0 and 100. Type 100. For Windows and UNIX. 3. a. Y ou can show the label again by popping up on the control and selecting Show»Label. to pop up. Remember. double-click on 10. Note: If you click outside the text box without entering text. Select a Thermometer indicator from Controls»N umeric. Rescale the thermometer control to display the temperature between 0. select Windows»Show Controls Palette to di splay the palette. 2. the label disappears.The temperat ure control should now look like the following illustration.

You need two numeric constants: one for the scaling factor of 100 and one for th e device constant. Select the block diagram objects from the Functions palette. The Demo Voltage Read VI (Functions»Tutorial) s imulates reading a voltage from a plug-in data acquisition board. When you position the mouse on the blo ck diagram. Multiply funct ion (Functions»Numeric). Note: If the Functions palette is not visible. sel ect the icon and then the object from the top-level of the palette. For the first numeric constant.0 when the constant first appears on the block diagram. type 100. This is your opportunity to place the object where you want on the block diagram.0. Numeric Constant (Functions»Numeric). select Windows»Show Functions Palette to display the palette.Chapter 1 Introduction to LabVIEW Block Diagram 1. or choose th e object from the appropriate subpalette. LabVIEW Tutorial Manual 1-24 © National Instruments Corporation . You can also access the Functions palette by popping up in an open area of the block diagram. For each object that you want to insert. the function multiplies the voltage ret urned by the Demo Voltage Read VI by 100. In this exercise. LabVIEW displays an outline of the object. Open the block diagram by choosing Windows»Show Diagram.

String Constant (Functions»String). Consta nts. Channel appears in th e default label so you do not have to change the label. Notice that you do not have to change to the Labe ling tool to insert the value when using this feature. Notice that in this instance. If these options are not available for a particular function. No te: You can create and wire controls. the two numerics represent the constant 100. see the Create & Wire Controls.Chapter 1 Introduction to LabVIEW 2. Type 0 when the constant first a ppears on the block diagram. 4. Type 1 when the constant first appears on the block diagram. Using the Labeling too l. For more information on this feature. In this example.0 and the device fo r the multiply function. This changes the default value of zero to one. at the bottom left of the Demo Voltage Read VI and select Crea te Constant from the pop-up menu. In this example. This option automatically creates a string con stant and wires it to the Demo Voltage Read VI. pop up on the input marked Board ID on the Demo Voltage Read VI and select Create Const ant from the pop-up menu. change the default label (Board ID) to Device. and Indicators section later in this chapter. Create the second numeric constant using a shortcut to automatically create and wire the constant to the Demo Voltage Read VI. Create Constant and Create Indicator options are disabled on the pop-up me nu. This option automatically creates a numeric constant a nd wires it to the Demo Voltage Read VI. Pop up on the inpu t marked Channel. a. constants and indicators with most functio ns. you use the string constant to represent the channel number. Using the Wiring tool. 3. b. the Create Con trol. © National Instruments Corporation 1-25 LabVIEW Tutorial Manual . c.

0 to convert it to a temperatu re in °F.Chapter 1 Introduction to LabVIEW 5. Blue wires carry integers. As you pass an editing tool over the VI icon. LabVIEW highlights the wiring terminals in both the block diagram and t he Help window. The Demo Voltage Read VI simulates reading the voltage at Channel 0 of a plug-in board. Placing any of the editing tools on a node displays the inputs and ou tputs of that function in the Help window. Blue wire (integer) Orange wire (floating-point numbers) Pink wire (string) LabVIEW color keys wires to the kind of data each wire carries. orange wires carry floating-point numbers. You can activate the Help window by choosing Hel p»Show Help. green wires carry Booleans . this flashing highligh t can help you to connect your inputs and outputs to the proper terminals. wire the remaining objects together as explained in the W iring Techniques section later in this chapter. When you begin to wire your own diagrams. LabVIEW Tutorial Manual 1-26 © National Instruments Corporation . Using the Wiring tool. The VI then multiplies the voltage by 100. and pink wires carry strings.

and click on the second terminal. It does not matter at which terminal you start . When the Wiring tool is over a terminal. The hot spot of the tool is the tip o f the unwound wiring segment. Hot Spot To wire from one terminal to another. the terminal area blinks. the arrow at the end of this mouse symbol shows where to click and the number printed on the mouse button indicates how many times to click the mouse button. © National Instruments Corporation 1-27 LabVIEW Tutorial Manual . click the mouse button. Click with the mouse button. You can bend a w ire once by moving the mouse perpendicular to the current direction.Chapter 1 Introduction to LabVIEW Wiring Techniques In the wiring illustrations in this section. Do not hold down the mouse bu tton while moving the Wiring tool from one terminal to another. press the spacebar. To create m ore bends in the wire. to tack the wire down and m ove the mouse perpendicularly. to indicate that clicking connects the wire to that terminal. To change the direction of the wi re. cli ck the Wiring tool on the first terminal. move the tool to the second terminal.

yellow text banners that display the name of each terminal. LabVIEW displays wire stubs that ind icate each input and output. These tip strips should help you to wire the terminal s.Chapter 1 Introduction to LabVIEW Tip Strips When you move the Wiring tool over the terminal of a node. Showing Terminals It is important that you wire the correct terminals of a function. pop up on the func tion and choose Show»Terminals. The wire stub has a dot at its end if it is an inpu t to the node. You can show the icon connector to make correct wiring easier. Tip strips consist of small. LabVIEW Tutorial Manual 1-28 © National Instruments Corporation . pop up on the function and again select Show»Terminals. To return to the icon. a tip strip for that terminal pops up. Note: When you place the Wiring tool over a node. To do this. The following illustration displays the tip strip (Measured Voltage) that app ears when you place the Wiring tool over the output of the Demo Voltage Read VI.

You select a wire segment by clicking on it with the Positioning tool. If you do. A wire branch contains all the wire segments from one junction to a nother. segment junction bend segment Selects a segment Selects a branch Selects an entire wire © National Instruments Corporation 1-29 LabVIEW Tutorial Manual . select the wire you want to delete and then press <Delete>. from a terminal to the next junction. and triple-clicking selects the entire wire. The point where three or four wire segments join is called a junction. horizontal or ve rtical piece of wire.Chapter 1 Introduction to LabVIEW Wire Stretching You can move wired objects individually or in groups by dragging the selected ob jects to a new location with the Positioning tool. or from one terminal to another if there are no junctions in between. Selecting and Deleting Wires You may accidentally wire nodes incorrectly. Double-clicking selects a branch. A wire segment is a single.

You can remove a bad wire by clicking on it with the Positio ning tool and pressing <Delete>. LabVIEW has two features th at you can use to create and wire a control or constant. Dashed Wire (Bad) Dotted Wire (Good) Create & Wire Controls. or connecting a source terminal to a desti nation terminal when the data types do not match (for instance. Note: Do not confuse a dashed wire with a dotted wire. A dotted wire represents a Boolean data type. LabVIEW automatically creates LabVIEW Tutorial Manual 1-30 © National Instruments Corporation . Choosing Edit»Remove Bad Wires deletes all bad wi res in the block diagram. connecting a num eric to a Boolean). Constants. such as connecting two controls. You can get a bad wire for a number of reas ons. a s the following illustration shows. and Indicators For terminals acting as inputs on the block diagram. You access these featur es by popping up on the terminal and choosing Create Control or Create Constant.Chapter 1 Introduction to LabVIEW Bad Wires A dashed wire represents a bad wire. This is a useful quick fix to try if your VI refuses t o run or returns the Signal has loose ends error message.

Run the VI 1. For Windows and Macintosh. LabVIEW automatically creates and wires the correct indicator type to the output of a terminal. © National Instruments Corporation 1-31 LabVIEW Tutorial Manual . The follow ing illustration shows an example pop-up menu. You a ccess this feature by popping up on the terminal and choosing Create Indicator. 4. Note: Click on the cont inuous run button in the toolbar. In UNIX. 2. you must click on the continuous run button. make the front panel active by clicking anywhere o n it. make the front panel active by clicking on the window title bar o r by choosing Windows»Show Panel. 3. Loops and Charts. Notice that you have to rerun the VI each time. of this tutorial.Chapter 1 Introduction to LabVIEW and wires the correct control or constant type to the terminal input. This is covered in Chapter 3. The continuous run button is not the preferred method for repeating block diagra m code. The VI then completes execution and quits. Click on the continuous run button again to de select it. Run the VI by clicking on the run button in the toolbar of the front panel. If you want to repeatedly run th e VI. For a terminal acting as an output on the block diagram. You should use a looping structure. you can choose the Crea te Indicator feature to create and then wire an indicator to the terminal.

. panel (or their respective object and choosing Descri the front panel and block Data Operations»Description.. Type the description of the VI in the VI Information dialog box... block diagram: Pop up on the object and choose Description.. 1. Type the description for the VI..... as shown in the following illustrat ion.Chapter 1 Introduction to LabVIEW Documenting the VI You can document the VI by choosing Windows»Show VI Info. front panel: Pop up on the object and choose .... Select Windows»Show VI Info. Note: You cannot change the description while running a VI.. You can view the descriptions of objects on the front terminals on the block diagram) by popping up on the ption. Document the VI.... You can then recall the description by again selecting Windows»Show VI Info.. LabVIEW Tutorial Manual 1-32 © National Instruments Corporation . The location of this choice differs between diagram. and click on OK.

.Chapter 1 Introduction to LabVIEW The following illustration is an example pop-up menu that appears while you are running a VI. Type the description for the indicator. as shown in the following illustratio n. 2. b. and click on OK... pop up on the thermom eter indicator and choose Data Operations»Description. © National Instruments Corporation 1-33 LabVIEW Tutorial Manual . but you can view any previously entered information. On the front panel. You cannot add to or change the description while running the VI. Document the thermometer indicator. a.

. Do not save your files in the examples directory. create your own directory and label it Tutorial VIs. Saving and Loading VIs As with other applications.1. Select File»Save As. or the New VI Library button to create the 2. specify a l ocation in the file system where you have write privileges.. Create the VI lib rary.. If you are using W indows 3. you mig ht select your home directory.. you should save your VIs into VI libraries because you can use long file names (up to 255 characters) with mixed cases. If you are using UNIX. Edit» Preferences. rename. 1. For a list of the advantages and disadvantages of using VI libraries and individual files.. you should save all VIs that you create during this tut orial into VI libraries to become familiar with using these libraries. you can save your VI to a file in a regular director y. you can also save multiple VIs in a single file called a VI lib rary... and delete fi les more easily than if you are using a VI library.. Otherwise. To create the VI library. see the Saving VI s section in Chapter 2. you should be familiar with how the y work. VI Library. Even though yo u may not save your own VIs in VI libraries. (Windows) Select New.. (Macintosh) If you use the native file dialog box.llb library is an example of a VI library..1. With LabVIEW.. 3. of the LabVIEW User Manual.. The tutorial. click on Save»New.. For example.select Use LLBs to access LabVIEW’s file dialog box.. Instead. you should not us e VI libraries unless you need to transfer your VIs to Windows 3.Chapter 1 Introduction to LabVIEW 3. Show the description you created again by popping up on the thermometer indicato r and selecting Data Operations» Description. Creating VIs. Saving VIs a s individual files is more effective because you can copy.. For that reason. (UNIX) Select Save»New.. LabVIEW Tutorial Manual 1-34 © National Instruments Corporation . Save your VI in a VI library..

Name the VI and save it in your new library. Type My Thermometer. That is. VI libraries. it appears in LabVIEW’s file dialog box as a folder with VI on the folder icon.llb extension if you do not include it. click on mywork.llb in the directory list to make sure you save your VI in the right p lace. LabVIE W appends the . Regular directories appear as a folder without the VI label. After you create a VI library.1. Directory VI Library le VI 5.vi in the dialog box. a.Chapter 1 Introduction to LabVIEW 4. you must limit your library names to eight characters or less.llb. save. Make sure it is mywork. you cannot create a VI library inside of another VI li brary. VI libraries have the sam e load. © National Instruments Corporation 1-35 LabVIEW Tutorial Manual . Close the VI by selecting File»Close. however. either. For Wi ndows 3. b. 6. Look at the name in the ring contro l at the top of the dialog box. Enter mywork as the name of the new library in the dialog box and click on the V I Library button. There is n o way to list the VIs in a VI library outside of the LabVIEW environment. If it is not. Click on OK. You cannot create a new directory inside a VI library.llb extension. are n ot hierarchical. and open capabilities as directories. The library name must be followed by an .

You use the Color tool to set the fore ground and background color of windows. and so on. The front panel specifies the inputs and outputs of the VI. terminals. The block diagram consists of the executable code that you create using nodes. floating palette. You u se the Controls palette to add controls and indicators to the front panel. The most commonly used tools are: Ope rating tool Positioning tool Labeling tool Wiring tool Color tool You use the Op erating tool to manipulate front panel controls and indicators. You can also access the Controls palette by selecting Windows»Show Controls Pale tte. you place controls and indicators to denote the inputs and outputs of the VI. and debug VIs. With the icon/connector.Chapter 1 Introduction to LabVIEW Summary Virtual instruments (VIs) have three main parts: the front panel. The fro nt panel and block diagram contain toolbars. controls. you can use a VI as a sub VI in the block diagram of another VI. You use the Wiring tool to wi re objects together in the block diagram. Controls and indicators have different options that are configured from the ir pop-up menus. resize. you use tools from the Tools palette to build. In the front panel. LabVIEW Tutorial Manual 1-36 © National Instruments Corporation . edit. and the icon/connector. You use the Labeling tool to create free labels and to enter text in labels. and select objects. which display the run button along with other buttons that control the execution of the VI. You use the Posi tioning tool to position. The C ontrols palette automatically pops up on the front panel when you launch LabVIEW . On the front panel and block diagram. indicators. the block diag ram. The Tools palette consists of a graphical . See the LabVIEW User Manual for more information regarding fron t panel controls and indicators. You use the <Tab> key to tab throu gh the commonly used tools on the palette. and wires.

You access the pop-up menu by popping up on the object or by using the Object pop-up menu tool. pop up! © National Instruments Corporation 1-37 LabVIEW Tutorial Manual . an d subVIs) on the block diagram. So remember—when in doubt. You can modify nearly all LabVIEW objects through th eir own pop-up menus. which also include features that you can use for execution debugging and single-stepping through VIs. Popping up on individual components of an object accesses their own pop-up menus. You use the Functions palette to place nodes (structures. On the block diagram. functions. See the LabVIEW User Manual for more information concerning block diagram programming. You can also open the Function s palette by selecting Windows»Show Functions Palette. which are associated with the front panel controls and indicators o n the block diagram. you develop your source diagram by connecting nodes and terminals using the Wiri ng tool. The Functions palette automatically pops up on t he block diagram when you open the block diagram.Chapter 1 Introduction to LabVIEW The block diagram contains buttons. LabVIEW automatically place s terminals.

Therefore. If a block diagram has a la rge number of icons.Chapter Creating a SubVI You Will Learn: • • • What a subVI is. and maintain. © National Instruments Corporation 2-1 LabVIEW Tutorial Manual . you construct subVIs to perform the necessary operation s on the data as it flows through the block diagram. Creating the SubVI OBJECTIVE To make an icon and connector for the My Thermometer VI you created in Chapter 1 and use the VI as a subVI. Then. Just as there is no limit to the number of subroutines you can use in a C program. How to create the icon and connector. To use a VI as a subVI. 2 Understanding Hierarchy One of the keys to creating LabVIEW applications is understanding and using the hierarchical nature of the VI. When creating an application. After you create a VI. you start at the top-level VI and define the inputs and outputs fo r the application. You can also call a subVI inside another subVI. you can use it as a subVI in the block diagram of a higher-level VI. you must create an icon to represent it on the block diagram of another VI. and a connector pane t o which you can connect inputs and outputs. u nderstand. This modular approach makes applications easy to debug. How to use a VI as a subV I. a subVI is analogous to a subroutine in C. group them into a lower-level VI to maintain the simplicity of the block diagram. there is no limit to the number of subVIs you can use in a L abVIEW program.

Icon Editor Tools and Buttons The tools to the left of the editing area perform the following functions: Penci l tool Line tool Draws and erases pixel by pixel. Do uble-click on this tool to frame the icon in the foreground color.Chapter 2 Creating a SubVI Icon Create the icon. Select My Thermometer. open it by selecting File»Open. or it can be a t extual description of the VI or its terminals. you can a lso double-click on the icon pane to edit the icon. Do uble-click to frame the icon in the foreground color and fill it with the backgr ound color. C opies the foreground color from an element in the icon.vi from mywork. Selects an area of the icon for moving. As a shortcut.. Draws straight lines. 1. Press <S hift>and then drag this tool to draw horizontal. and diagonal lines. An i con can be a pictorial representation of the purpose of the VI. cloning. 3.. Draws a recta ngle bordered with the foreground color and filled with the background color. or other changes.llb.. Draws a rectangular border in the foreground color. E nters text into the icon design. Invoke the Icon Editor by popping up in the icon pane in the upper right corner of the front panel and choosing Edit Icon. 2. Fills an outlined area w ith the foreground color. If you have closed the M y Thermometer VI. vertical. which represents the VI in the block diagram of other VIs. Dropper tool Fill bucket tool Rectangle tool Filled rectangle tool Select tool Text tool LabVIEW Tutorial Manual 2-2 © National Instruments Corporation .

Chapter 2 Creating a SubVI Foreground/ Background Displays the current foreground and background colors. double-click on the Text tool. 5. Close the Icon Editor by clicking on OK once you complete your icon. a. a. Draw the thermometer with the Pencil tool. 4. The buttons at the right of the editing screen perform the following functions: Undo OK Cancel Cancels the last operation you performed. T o change the text font. s elect the interior section of the default icon. Erase the default icon. shown at left. The new ico n appears in the icon pane in the upper right corner of the front panel. © National Instruments Corporation 2-3 LabVIEW Tutorial Manual . Press <Delete> to erase the interior of the default icon. With the Select tool. Your icon should look similar to the following illustration. Create the text with the Text tool. Experiment with the edito r. 6. Returns to the front panel without sa ving any changes. Saves your drawing as t he VI icon and returns to the front panel. Click on each to get a co lor palette from which you can choose new colors. 7.

a. LabVIEW Tutorial Manual 2-4 © National Instruments Corporation .Chapter 2 Creating a SubVI Connector Now. 1. single terminal connector pane 2. you can create the connector. The cursor automatically changes to the Wiring tool. Assign the terminal to the thermometer. Because LabVIEW selects a terminal pattern based on the number of controls and i ndicators on the front panel. as th e following illustration shows. and the terminal turns b lack. Define the connector terminal pattern by p opping up in the icon pane on the front panel and choosing Show Connector. Click on the terminal in the connecto r. there is only one terminal—the thermometer indicator .

The icon repr esents the VI in the block diagram of the calling VI. Remember that front panel controls can be used as inputs only.Chapter 2 Creating a SubVI b. A moving dashed line frames the indicator. Click on the thermometer indicator. connector control If you click in an open area on the front panel. © National Instruments Corporation 2-5 LabVIEW Tutorial Manual . you have not made the connection correct ly. 4. This VI is now complete and ready for use as a subVI in other VIs. Save the VI by choosing File»Save. On the Macintosh. Note: The connector specifies the inputs and ou tputs to a VI when you use it as a subVI. if you are using the native file dialog box to save into a VI library. Repeat the previous steps if necessary. Close the VI by choosing File»Close. you must click on the Use LLBs button before selecting the VI library. If the terminal is white. indicating that you have assigned the indicator to t hat terminal. 3. the dashed line disappears and the selected terminal dims. The connector (with one te rminal) outputs the temperature. front panel indicators can be used as outputs only. a s the following illustration shows.

If you open a VI that does not have an icon and a connector. Front Panel 1. You select VIs to use as subVIs from Functions»Select a VI.. just as a subroutine call statement in a program is not the subroutine itself. The M y Thermometer VI you built returns a temperature in degrees Fahrenheit. OBJECTIVE To build a VI that uses the My Thermometer VI as a subVI. a blank.Chapter 2 Creating a SubVI Using a VI as a SubVI You can use any VI that has an icon and a connector as a subVI in the block diag ram of another VI. A block d iagram that contains several identical subVI nodes calls the same subVI several times.. LabVIEW Tutorial Manual 2-6 © National Instruments Corporation . A subVI node (icon/connector) is analogous to a subroutine call. You cannot wire to th is node. from which you can select any V I in the system. A subVI is analogous to a subroutine. Open a new front panel by selecting File»New.. You will take that reading and convert the temperature to degrees Centigrade. Choosing this option produces a file dialog box. The subVI node is not the subVI itself. square box appears in the calling VI’s block diagram.

floating-point number. For example. Label it Temp in deg C. LabVIEW places the My Thermometer VI on the block diagram.A dialog box appears. Locate and open the mywork. The terminal symbols suggest the data type of the control or indicator. a DBL terminal represents a double-precis ion.Chapter 2 Creating a SubVI 2. Block Diagram 1..vi or highlight it and click on Open in the dialog box. Similarly. Pop up in a free area of the block diagram and choose Functions»Select a VI. You do not have to type the decimal and trailing zeroes.. Double-click on My Thermometer. © National Instruments Corporation 2-7 LabVIEW Tutorial Manual . type 20. Select Windows»Show Diagram. LabVIEW adds them automatically when you enter the value.. LabVIEW creates the correspondi ng terminal in the block diagram. and press <Enter> on the numer ic keypad. Change the r ange of the thermometer to accommodate the temperature values. LabVIEW automa tically adjusts the intermediate values. 3. Ad d the other objects to the block diagram as shown in the following illustration.l lb library. change the upper limit of the thermometer to 40 and press <Enter> on the numeric keypad. double-click on the lower limit. Choose the thermometer from Controls»Numeric. 3. 2. With the Operatin g tool. Each time you create a new control or indicator.

Assign the values of 32.0. you may need to sele ct Relink to SubVI from the icon pop-up menu.Chapter 2 Creating a SubVI Numeric Constant (Functions»Numeric). Return to the front panel and click on the run button in the toolbar. you can use the pop up on functions and choose Create Constant to automatically create and wire the correct constant to a function. Add three numeric constants to the block dia gram. Block Diagram Toolbar: The block diagram toolbar contains the following buttons that you can use for de bugging VIs. Block DiagramToolbar The block diagram contains additional options not included on the front panel to olbar. Note: Remember. If necessary. The Divide function (Functions»Numeric) computes t he value of 5/9 for the temperature conversion.0 to the constants by using the Labe ling tool. Hilite execute button–Displays data as it passes through wires LabVIEW Tutorial Manual 2-8 © National Instruments Corporation . Note: A broken wire between the Thermometer icon and the Temp in deg C terminal might indicate that you have assigned the subVI connector terminal to the front panel indicator incorrectly. 5. Wire the di agram objects as shown in the previous block diagram illustration. T he Subtract function (Functions»Numeric) subtracts 32 from the Fahrenheit value fo r the conversion to Centigrade. choose Edit»Remove Bad Wires. and 9. When you have modified the subVI. 4.0. 5. Review the instructions in the Creating the SubVI section earlier in this chapter. The Multiply function (Functions»N umeric) returns the Centigrade value from the conversion process.

Select Windows»Show Diagram. suppose y ou want to see the Fahrenheit value for comparison and debugging.Chapter 2 Creating a SubVI Step into button–Steps into loops. A Probe window pops up with the ti tle Temp 1 and a yellow glyph with the number of the probe. and so on Step out button–Completes execution of loops. you examine the probe and exe cution highlighting features. LabVIEW contai ns some tools that can help you. of this tutorial. Select the Probe t ool from the Tools palette. However. These techniques and other debugging tools and tip s are discussed in greater detail in Chapter 9. and so on Step over button–Begins single stepping. subVI. In this exercise. The Probe window also appears on the front panel. 1. as shown in the foll owing illustration. steps over a loop. 2. Programming Tips and Debugging T echniques. subVIs. Click with the Probe tool on the temperature value ( wire) coming out of the My Thermometer subVI. VIs. and so on Some Debugging Techniques The thermometer should display a value in the selected range. block diagrams. © National Instruments Corporation 2-9 LabVIEW Tutorial Manual .

in the toolbar. just as if you had probed the wire. Also notice that data values appear on the wires and display the values contained in the wires at that time. LabVIEW Tutorial Manual 2-10 © National Instruments Corporation . Return to the block d iagram of the VI by choosing Windows»Show Diagram. The t emperature in degrees Fahrenheit appears in the Probe window. Another useful debugging technique is to examine the flow of data in the block d iagram using LabVIEW’s execution highlighting feature. 7. 5. The hilit e execute button changes to an illuminated light bulb. 4. Begin execution highlighting by clicking on the hilite execute button. Moving bubbles represent the flow of data through the VI. Run the VI and notice tha t execution highlighting animates the VI block diagram execution. Move the Probe window so you can view both the probe and thermometer values as shown in the following illustration. Run the VI. shown at left. Return to the front panel. Close the Probe window by clicking in the close box in the top-left corner of th e Probe window title bar.Chapter 2 Creating a SubVI 3. 6. as show n in the following block diagram.

and nothing in pa th 2 depends on data from path 1. © National Instruments Corporation 2-11 LabVIEW Tutorial Manual . not necessar ily in a top-to-bottom or left-to-right manner. uses data flow programming. Programming Tips and Debuggin g Techniques. C licking on this button executes the Divide function. it highlights the next item that executes in the VI. in the toolbar. Begin single steppi ng by clicking on the step over button. Step over the divide function by clicking on the step over button. however. 9. In conventiona l text-based languages. After LabVIEW completes thi s portion of the sequence. Execution highlighting is a useful tool for examining the data flow nature of LabVIEW and is discussed further in Chapter 9. of this tutorial. The preceding illustration shows that LabVIEW can multitask between paths 1 and 2 because there is no data depen dency. In data flow programming . You can also use the single stepping buttons if you want to have more control over the debugging process. in the toolbar. After LabVIEW completes this po rtion of the sequence. the program statements execute in the order in which the y appear. Clicking on this button displays the first execution sequence in the VI. LabVIEW. it highlights the next item that executes in the VI. because the multiply function is dependant upon the data from the Subtract and Divide funct ions. Path 3 must execute last. 8.Chapter 2 Creating a SubVI Path 1 Path 3 Path 2 Notice the order in which the different nodes in LabVIEW execute. a node executes when data is available at all of the node inputs. that is. nothing in path 1 depends on data from path 2. however.

Clicking on this button opens the front panel and block diagram of y our thermometer subVI. Save the VI in mywork. 11. Finish executing the block diagram by clicking on the step out button. Name it Using My Thermometer. it highlight s the next item that executes in the VI. Opening. The following illustr ation shows your finish execution options in the pop-up menu of the step out but ton. LabVIEW Tutorial Manual 2-12 © National Instruments Corporation . in t he toolbar. in the toolbar. Operating. Step into the My Thermometer subVI by clicking on the step into button. Clicking on this button completes all remaining sequences in the b lock diagram. 12. You then open the block diagram by selecting Win dows»Show Diagram. Any changes you make to a subVI alter only the version in memor y until you save the subVI. On this pop-up me nu.vi.llb. You can also hold down the mouse button when clicking on the step out button to access a pop-up menu. You open the block diagram of the subVI by double-clicking on the subVIs icon or by selecting Project»This VI’s SubVIs. and Changing SubVIs You can open a VI used as a subVI from the block diagram of the calling VI. You can now choose to single step through or run the subV I. and close the VI .Chapter 2 Creating a SubVI 10. you can select how far the VI executes before pausing. Notice that the changes affect all calls to the subV I and not just the node you used to open the VI. After LabVIEW completes this portion of the sequence.

or pop up on an empty space in the window to access the following options. placing roots at the top. Switch to vertical layout–Arranges the nodes from top-to-bottom. Use the <Tab> key toggle between the Positioning and Scrol l window tools. If a focus node exists. Include/Exclude VIs in VI libraries–Toggles the hierarch y graph to include or exclude VIs in VI libraries. LabVIEW displays the name of the VI below the VI icon. This feature is useful for moving nodes from the Hierarchy windo w to the block diagram. the View menu and pop-up menus include Show all VIs and Full VI Pat h in Label options that you cannot access on the toolbar. Include/Exclude global variab les–Toggles the hierarchy graph to include or exclude global variables. This windo w contains a toolbar that you can use to configure several types of settings for displayed items.Chapter 2 Creating a SubVI Hierarchy Window You use the Hierarchy window (Project»Show VI Hierarchy) to visually display the d ependencies of VIs by providing information on VI callers and subVIs. Include/Ex clude typedefs–Toggles the hierarchy graph to include or exclude typedefs. The following illustration shows an example of the VI hierarch y toolbar. As you move the Operat ing tool over objects in the Hierarchy window. You can use buttons on the Hierarchy window toolbar or the VIEW menu. • Redraw–Rearranges nodes after successive operations on hierarchy nodes if you need to minimize li ne crossings and maximize symmetric aesthetics. • • • • • In addition. placin g roots on the left side. © National Instruments Corporation 2-13 LabVIEW Tutorial Manual . Switch to horizontal layout–Arranges the nodes from left-to-right. you then scroll through the window so that the first root that shows subVIs is visible.

Any VIs that contain subVIs have an arrow button next to the VI that you can use to show or hide the VI’s subVIs. and so on. or <Shift-Enter> (HP-UX) to find t he previous node that matches the search string. or you can press <Shift-Enter> (Windows). Clicking on the red arrow button or double-clicking on the VI itself opens the VI’s subVIs. You initiate the search by typing in the name of the node. a search window appears. Double-clickin g on a VI or subVI node opens the front panel of that node. After finding the correct node. Search Hierarchy You can also search currently visible nodes in the Hierarchy window by name. A black arrow button on a VI node means that all subVIs ar e displayed. The following illus tration shows the search hierarchy.Chapter 2 Creating a SubVI You can drag a VI or subVI node to the block diagram or copy it to the clipboard by clicking on the node. <Shift>-click on a VI or subVIs node to select multipl e selections for copying to other block diagrams or front panels. such as showing or hiding subVIs. anywhere on the window. edit t he VI icon. You can also pop up on a VI or subVI node to access a menu with opt ions. which displays the text as you type it in and concurrently searches through the hierarchy. As you type in the text. open the VI or subVI front panel. <Shift-Return> (Sun). <shi ft-return> (Macintosh). you can press <Enter> to search for the next nod e that matches the search string. LabVIEW Tutorial Manual 2-14 © National Instruments Corporation .

To access the simple help view. Your thermometer VI also tion dialog box. LabVIEW displays the required. press the Simple/Complex Diagram Help switch. The following illustration s is the Digital Thermometer VI from Function contains the text you typed in the VI Informa First select Help»Show Help. This s»Tutorial.Chapter 2 Creating a SubVI Online Help for SubVI Nodes When you place one of the tools on a for the subVI with wires attached to hows an example of online help. Simple/Complex Help View In the Help window. the Help window shows the icon each terminal. you can specify whether you want to display the simple or co mplex view for block diagram objects. Then place the Positioning tool on the subVI to displ ay its wiring diagram. subVI node. © National Instruments Corporation 2-15 LabVIEW Tutorial Manual . In simple help view. Note: When you open the Help window. recommended. In comp lex help view. It also displays the full path name of a VI. LabVI EW automatically defaults to the simple help view. LabVIEW displays only the required and recommended inputs for VIs and functions. and optional inputs f or VIs and functions.

Links to Online Help Files In the Help Window.. to associate the help file and topic with your VI. The following ill ustration shows the options that appear in the VI Setup dialog box... you can specify which inputs are required. When designing your o wn VIs. and optional inputs appear in gray text. choose Documentation from the ring control at the top of the box... recommended inputs appe ar in plain text. and then enter the path of the help file in the Help Path box. required inputs appear in bold text.Chapter 2 Creating a SubVI or choose Help»Simple Diagram Help. you must specify the link to the help fil e by clicking on the icon pane and selecting VI Setup. The following illustration shows both views of the Simple/Complex Diagram Help switch. If you want to create your own help file. recommended. Simple Help Complex Help In the Help window. When the VI Setup dial og box opens. You select Browse. or optional by p opping up on an input or output on the connector pane and selecting the correct option from the This Connection is submenu. LabVIEW Tutorial Manual 2-16 © National Instruments Corporation . you can click on the online help button to access LabVIEW’s on line help as well as help files that you have created using a help compiler.

of this tutorial. you can choose between VI layout. You can use s ingle stepping to debug VIs and examine data flow in VIs and subVIs.Chapter 2 Creating a SubVI For more information on creating help files.. makes your block diagrams more unders tandable and simplifies debugging. These debug ging techniques and more are described further in Chapter 9. Summary LabVIEW’s ability to call VIs as subVIs within higher-level VIs facilitates modula r block diagrams. You can also use online help to show the simple o r complex view of a VI or subVI. you can then use the VI as a subVI. © National Instruments Corporation 2-17 LabVIEW Tutorial Manual . global v ariables. Once you have created the icon and connector for a VI. You can use the online help to wire subVIs correctly. With the Hierarchy window.. A VI used as a subVI must have an icon and co nnector. in Chapter 25. see the Creating Your Own Help File s section. You create the icon using the Icon Editor. LabVIEW contains several tools for debugging VIs. The connector terminals pass data to the subVI code and receive the res ults from the subVI. You define the c onnector by choosing the number of terminals you want for the VI and then assign ing a front panel control or indicator to each of those terminals. and so on. Execution highlighting animates a block dia gram by displaying the data flow as moving bubbles and autoprobes. Managing Your Applications. in turn.. Yo u select subVIs using Functions»Select a VI. You use the Hierarchy window to graphi cally display dependencies of VIs and subVIs. in the LabVIEW User Manual . You access the Hierarchy window by selecting Project»Show VI Hierarchy. Programming Tips an d Debugging Techniques. Modularization. LabVIEW also includes online help for subVIs. including information about typedefinitions. You can place probes on any wire and display the value that pass es through that wire as the VI runs.

LabVIEW has four structures: the Wh ile Loop. Use the front panel in the following illustration to get started. How to use a For Loop. A knob control on the front panel will adjust the loop rate between 0 and 2 seconds and a switch will stop the VI. Case and Sequence Structures and the Formula Node. This cha pter introduces the While Loop and For Loop structures along with the chart and the shift register. For examples of charts. Using While Loops and Charts OBJECTIVE To use a While Loop and a chart for acquiring and displaying data in r eal time. and the Sequence structure. You will build a VI that generates random data and displays it on a ch art.llb.Chapter Loops and Charts You Will Learn: • • • • How to use a While Loop. The Case and Sequence structures are explained in Chapter 5. © National Instruments Corporation 3-1 LabVIEW Tutorial Manual . see examples\ general\structs. For examples of structures. You will learn to change the mechanical action of the switch so you do not have to turn on the switch each time you run the VI. What a shift register i s and how to use it. the For Loop. How to display data in a chart. the Case structure.llb. 3 Structures control the flow of data in a VI. see examples\ general \graphs\ charts.

6. Open a new front panel. 5. Label the chart Random Signal. You use this switch to stop the acquisition. Use the Color tool to make the free label border transparent. Using the Labeling tool. Place a vertical switch (Controls»Boolean) in the front pa nel. double-click on 10. The digital d isplay shows the latest value.0. 4. <return> (Macintosh).Chapter 3 Loops and Charts Front Panel 1. The click enters the valu e. The T in the bottom left corner of the c olor palette makes an object transparent. Pop up on the chart and choose Show»Digital Display. Label the switch Enable. Use t he Labeling tool to create the free label for ON and OFF. 3.0 in the chart. LabVIEW Tutorial Manual 3-2 © National Instruments Corporation . type 1. <Return> (Sun). Place a waveform chart (Controls»Graph) in the front panel. o r <Enter> (HP-UX) to input your change to the scale. The chart displays random dat a in real time. and click outside the label area. 2. You can also press <Enter> (Windows).

Place a knob (Controls»Numeric) in the front panel. double-click on 10. type 2. The While Loop is a resizable box that is not dropped on the diagram immediately. Instead. and click outside the label area to enter the new value. This knob controls the timing of the While Loop later in this exercise. Using the Labeling tool. Label the knob Loop Delay (sec ).0. Place the While Loop in the block diagram by selecting i t from Functions»Structures. A While Loop is then created with the specified location and size. click in an area above and to the left of all the terminals. Pop u p on the knob and deselect Show»Digital Display to hide the digital display that s hows by default. 8. © National Instruments Corporation 3-3 LabVIEW Tutorial Manual . Cont inue holding down the mouse button. Open the block diagram. and drag out a rectangle that encompasses th e terminals. 2.0 in the scale arou nd the knob. To do so.Chapter 3 Loops and Charts 7. Block Diagram 1. you have the chance to position and resize it.

shown in the following illustration. LabVIEW Tutorial Manual 3-4 © National Instruments Corporation . The While Loop is an in definite looping structure. Select the Random Number (0-1) function from Functions»Numeric. iteration terminal conditional terminal The While Loop is equivalent to the following pseudo-code: Do Execute Diagram Inside the Loop (which sets the condition) While Condition is TRUE 3. Leave the Loop Delay te rminal unwired for now. The iteration terminal is an output numeric terminal that contains the n umber of times the loop has executed. the diagram continues to generate random numbers and display them on the cha rt. is a resizable box you use to execute the diagram inside it until the Boolean value passed to the condition al terminal (an input terminal) is FALSE. the iteration terminal outputs 0. Wire the diagram a s shown in the opening illustration of this Block Diagram section. 5. In this example. so if the loop runs once. the iteration count always starts at zero. Return to the front panel and turn on the vertical switc h by clicking on it with the Operating tool. connecting th e Random Number (0-1) function to the Random Signal chart terminal. as long as the switch is on (TRU E). 4. The diagram within its border executes as long as th e specified condition is true. the While Loop always executes at leas t once. The VI checks the conditional terminal at the end of each iteration. and the Enab le switch to the conditional terminal of the While Loop.Chapter 3 Loops and Charts conditional terminal iteration terminal The While Loop. Run the VI. therefore. However.

pop up on the chart and choose Data Operations»Clear Chart.024 points... To stop the loop. To scroll through the chart. To clear the display buffer and reset the ch art.. click and hold down the mouse butto n on either arrow in the scrollbar.Chapter 3 Loops and Charts 6. You can use the Positioning tool to adjust the size and position of the scrollbar. © National Instruments Corporation 3-5 LabVIEW Tutorial Manual . 7. Turning the switch off sends the value FALSE to the loop conditional terminal and stops the loop. The chart has a display buffer that retains a number of points after they have scrolled off th e display. Note: The display buffer default size is 1. click on the vertical switch. You can increase or decrease th is buffer size by popping up on the chart and choosing Chart History Length. Give the chart a scrollbar by popping up on the chart and selecting S how»Scrollbar.

Switch When Released. Latch When Pressed. during a mouse click. Switch Until Released. LabVIEW contains an example that demonstrates these behavior s called Mechanical Action of Booleans. you can modify the mechanical action of Boolean controls. This action is similar to what happens when you click on a check mark in a dialog box. As an example. Switch Until Rel eased action changes the control value when you click on the control. It retains the new value until you release the mouse button. and La tch Until Released.llb. it becomes high lighted but does not change until you release the mouse button. The action is similar to that of a doorbell. The action is similar to that of a ceiling ligh t switch. within the graphical boundary of the control. you first must turn on the vertica l switch and then click on the run button. Switch When Pressed action changes the control value each time you click on the control with the Operating tool. The default value of the switch is off (FALSE). at which time the control rev erts to its original value. With LabVIEW. The acti on is not affected by how often the VI reads the control. There are six possible choice s for the mechanical action of a Boolean control–Switch When Pressed. consider the following vertical switch.Chapter 3 Loops and Charts Mechanical Action of Boolean Switches You may notice that each time you run the VI. and is not affected by how often the VI reads the control. Switch When Released action changes the control value only after you release the mouse butt on. LabVIEW Tutorial Manual 3-6 © National Instruments Corporation .vi located in examples\general\controls\b ooleans. Latch When Released. in the toolbar. and is not affected by how often the VI reads the control.

the control reverts to the old value. That is. Run the VI. y our operating system may not maintain this level of timing © National Instruments Corporation 3-7 LabVIEW Tutorial Manual . depending on which o ne occurs last. 1. It retains the value until your VI reads the value once or until you release the mouse button. however. Pop up on the switch and choose Mechanical Action»Latch When Presse d. such as once per second or once pe r minute.Chapter 3 Loops and Charts Latch When Pressed action changes the control value when you click on the contro l. 2. Latch Until Released action changes the control value when you click on the control. However. c. b. yo u may want to take data at certain intervals. Click on the vertical switch to stop the acquisition. LabVIEW’s timing functions express time in milliseconds (ms).) This action is similar to that of a circuit breake r and is useful for stopping While Loops or having the VI do something only once each time you set the control. a. clicking on this action highlights the button. It retains the new value until the VI reads it once. This action guarantees at least one new v alue. Latch When Released action changes the control v alue only after you release the mouse button. (This action happens whether or not you continu e to press the mouse button. The switch mov es to the OFF position and changes back after the While Loop condition terminal reads the value. As with Switch When Released. Pop up on the switch and choose Data Operations»Make Current Value Default. Modify the vertical switch so it is used only to stop the VI. When your VI reads the value once. at which point the contr ol reverts to its default value. the While Loop executed as quickly as possible. Adding Timing When you ran the VI. This makes the ON position the defaul t value. this action is similar to the behavior of bu ttons in a dialog box. Turn on the vertical switch. and releas ing the mouse button latches a reading. change the switch so that you need not turn on the switch each time yo u run the VI.

1) The timer has a default resolution of 55 ms. You can configure LabVIEW to have 1 ms resolution by selecting Edit»Preferences. The following list contains guidelines for determining the accuracy of LabVIEW’s timing functions on your system. such as an 80386. 1. LabVIEW Tutorial Manual 3-8 © National Instruments Corporation . Modify the VI to generate a new random number at a time interval specified by th e knob. the timer has an resolution of 16 2/3 ms (1/60th of a second)... timer resolution is 1 ms. However. • (Macintosh) For 68K systems without the QuickTime extension. se lecting Performance and Disk from the Paths ring. as shown in the preceding diagram. • (Windows 95/NT) The timer has an resolution of 1 ms. If you have a Pow er Macintosh or have QuickTime installed.Chapter 3 Loops and Charts accuracy. This function ensures that no iteration is shorter than the specified number of milliseconds. • (Windows 3. so on slower systems. • (UNIX) The timer has a resolution of 1 ms. You can control loop timing using the Wait Until Next ms Multiple function (Func tions»Time & Dialog). in the LabVIEW User Manual to decide if you should use this option. Read the description of the Use Default Timer option in the Performance and Disk Preferences section in Chapter 8. this is hardware dependent. and unchecking the Use Default Timer checkbox. you may have lower resolution timing. LabVIEW does not use the 1 ms resolution by default because it places a greater load on your operating system. Customizing Your LabVIEW Environment..

In this exercise. 2. Rotate the knob to get different values for the number of seconds. Thus. the loop executes once every 1000 milliseconds (once a s econd). Numeri c Constant (Functions»Numeric). While holding down the mouse button. you multiply the knob terminal by 1000 to convert the knob value in seconds to milliseconds. Run the VI. a small icon representing the For Loop appears in the block diagram.vi. Instead .llb. A For Loop (see preceding illustration) is a resizable box. first click in an area ab ove and to the left of all the terminals. Use this value as the input to the Wait Until Next ms Multiple fun ction. Save and close the VI in mywork. 3. For Loop Loop Count Numerical Input Numerical Output You place the For Loop on the block diagram by selecting it from Functions»Structu res. like the While Loop. © National Instruments Corporation 3-9 LabVIEW Tutorial Manual . Like the While Loop.0. the multiply funct ion multiplies the knob value by 1000 to convert seconds to milliseconds. Name it My Random Signal.The numeric constant holds the constant by which yo u must multiply the knob value to get a quantity in milliseconds. if the k nob has a value of 1. d rag out a rectangle that encompasses the terminals you want to place inside the For Loop. it is not dropped on the diagram immediately. To do so. When you release the mouse button. and you h ave the opportunity to size and position it. In this exercise. Multiply function (Functions»Numeric).Chapter 3 Loops and Charts Wait Until Next ms Multiple function (Functions»Time & Dialog ).

all the numeric controls and indicators that you have used have been double-precision.Chapter 3 Loops and Charts LabVIEW creates a For Loop of the correct size and in the position you selected. The iteration terminal contains the number of ti mes the loop has executed. can represent numeri cs as integers (byte. The For Loop is equivalent to the following pseudo-co de: For i = 0 to N-1 Execute Diagram Inside The Loop The example in the following illustration shows a For Loop that generates 100 ra ndom numbers and displays the points on a chart. The default representation for a numeric is a double-p recision. The For Loop executes the diagram inside its border a predetermined number of t imes. LabVIEW Tutorial Manual 3-10 © National Instruments Corporation . double. word. Numeric Conversion Until now. The For Loop has two terminals: the count terminal (an input terminal) The count terminal specifies the number of times to execute the loop.floatingpoint. floating-point numbers. or long) or floating-point numbers (single-. however. LabVIEW. the iteration terminal (an output terminal). or extended-precision).

Gray Dot Note: When the VI converts floating-point numbers to integers. LabVIEW con verts one of the terminals to the same representation as the other terminal. but rounds 7. it rounds to the neares t integer. For example. LabVIEW places a gray dot. floating-point number to the count terminal. Notice the gray dot in the count terminal of the first For Loop. © National Instruments Corporation 3-11 LabVIEW Tutorial Manual . If you wire a double-precision . See the IEEE Standard 754 for details. consider the For Loop count termina l.5 t o 8. called a coercion dot. the VI rounds 6. on the terminal wh ere the conversion takes place.5 to 6. it is rounded to the nearest even integer. LabVIEW converts the number to a long integer. The terminal representation is a long integer. As a reminder. For example. If a number is exactly halfway between two integers. This is an IEEE Standard method for reading numbers.Chapter 3 Loops and Charts If you wire two terminals together that are of different data types.

0 to 1. b. Open a new front panel and add the objects shown in the preceding illustration t o it. Place a digital indicator on the front panel and label it Maximum Value . Change the scale of the chart to range from 0.Chapter 3 Loops and Charts Using a For Loop OBJECTIVE To use a For Loop and shift registers to calculate the maximum value i n a series of random numbers. Front Panel digital indicator Waveform chart with scrollbar and digital display showing 1. c. You will use a For Loop (N = 100) instead of a Whi le Loop. LabVIEW Tutorial Manual 3-12 © National Instruments Corporation . Place a waveform chart on the front panel and name it Random Data. Pop up on the chart and choose Show»Scrollbar and Show»Digital Display. a.0.

4. Nume ric Constant (Functions»Numeric). You set the initial value of the shift register to zero for this e xercise because you know that the output of the random number generator is from 0. you execute the For Loop 100 times. 2. If you did not initialize the shift register. Numeric Constant (Func tions»Numeric). © National Instruments Corporation 3-13 LabVIEW Tutorial Manual . then that value is already greater than all the expected data values. you could g et a maximum output value that is not related to the current set of collected da ta.0. You must know something about the data you are collecting to initial ize a shift register. The For Loop needs to know how many iterations t o make.0. 3.0 to 1. Open the block diagram. For example. Random Number (0-1) function (Functions»Numeric) to generate the random data. Add the shift reg ister by popping up on the right or left border of the For Loop and choosing Add Shift Register. Add the other objects to the block diagram. then it wou ld contain the maximum value of a previous run of the VI. and is alw ays the maximum value. Add the For Loop (Functions»Structures). Therefore. if you initialize the shift register to 1.Chapter 3 Loops and Charts Block Diagram 1. In this case.

Run the VI. You create a shift register by popping up on the left or right border of a loop and selecting Add Shift Register. 5. Save the VI. Shift Registers Shift registers (available for While Loops and For Loops) transfer values from o ne loop iteration to the next. That data shifts at the end of the iteration and appears in the left terminal at the beginning of the LabVIEW Tutorial Manual 3-14 © National Instruments Corporation .vi. i t contains only the last calculated maximum. but because it is outside the loop. Name the VI My Calculate Max.Chapter 3 Loops and Charts Max & Min function (Functions»Comparison) takes two numeric inputs and outputs the maximum value of the two in the top right corner and the minimum of the two in the bottom right corner. Note: Updating indicators each time a loop iterates is time-consuming and you should t ry to avoid it when possible to increase execution speed. If the Maximum Value terminal was inside the For Lo op. you would see it continuously updated. The shift register contains a pair of terminals directly opposite each other on the vertical sides of the loop border. The right terminal stores the data upon t he completion of an iteration. 7. 6. wire only the maximum output and ignore the minimum output. Wire the terminals as shown. Because you are only interested in the maximum value fo r this exercise.

array. This feature is useful for averaging data points. A shift register can hold any d ata type–numeric. you can access values from the last t hree iterations. The shift register automatica lly adapts to the data type of the first object that you wire to the shift regis ter. Before Loop Begins First Iteration Initial Value Initial Value New Value Subsequent Iterations Previous Value New Value Last Iteration Previous Value New Value New Value You can configure the shift register to remember values from several previous it erations. string. Boolean. You create additiona l terminals to access values from previous iterations by popping up on the left or right terminal and choosing Add Element. For example. and so on. if a shift register con tains three elements in the left terminal. © National Instruments Corporation 3-15 LabVIEW Tutorial Manual .Chapter 3 Loops and Charts next iteration (see the following illustration).

Chapter 3 Loops and Charts Contains i-1 Contains i-2 Contains i-3 Pop up on left terminal to add new elemen ts or use Positioning tool to resize the left terminal to expose more elements Previous values are available at the left terminals Latest value passes to right terminal Pop up on border for new shift register Using Shift Registers OBJECTIVE You will build a VI that displays two random plots on a chart. The two plots should consist of a random plot and a running average of the last four po ints of the random plot. Front Panel 1. Open a new front panel and create the front panel shown in the preceding illustr ation. LabVIEW Tutorial Manual 3-16 © National Instruments Corporation

Chapter 3 Loops and Charts 2. 3. After you add the waveform chart to the front panel, change the scale to range f rom 0.0 to 2.0. After adding the vertical switch, set the ON state to be the def ault and set the mechanical action to Latch When Pressed. Block Diagram 1. Add the While Loop (Functions»Structures) in the block diagram and create the shif t register. a. Pop up on the left or right border of the While Loop and choose A dd Shift Register. b. Add an extra element by popping up on the left terminal of the shift register and choosing Add Element. Add a third element in the same manner as the second. 2. Build the block diagram shown in the previous illustration. Random Number (0-1) function (Functions»Numeric) generates raw data. Compound Arit hmetic function (Functions»Numeric). In this exercise, the compound arithmetic fun ction returns the sum of random numbers from two iterations. To add more inputs, pop up on an input and choose Add Input from the pop-up menu. © National Instruments Corporation 3-17 LabVIEW Tutorial Manual

Chapter 3 Loops and Charts Divide function (Functions»Numeric). In this exercise, the divide function returns the average of the last four random numbers. Numeric Constant (Functions»Numeric) . During each iteration of the While Loop, the Random Number (0-1) function gene rates one random value. The VI adds this value to the last three values stored i n the left terminals of the shift register. The Random Number (0-1) function div ides the result by four to find the average of the values (the current value plu s the previous three). The average is then displayed on the waveform chart. Wait Until Next ms Multiple function (Functions»Time & Dialog), ensures that each iter ation of the loop occurs no faster than the millisecond input. The input is 500 milliseconds for this exercise. If you pop up on the icon and choose Show»Label, t he label Wait Until Next ms Multiple appears. 3. Pop up on the input of the Wait Until Next ms Multiple function and select Create Constant. A numeric constant appears and is automatically wired to the function. Use the Labeling tool to ent er 500. The numeric constant wired to the Wait Until Next ms Multiple function s pecifies a wait of 500 milliseconds (one half-second). Thus, the loop executes o nce every half-second. 4. Notice that the VI initializes the shift registers with a random number. If you do not initialize a shift register terminal, it contains the default value or th e last value from the previous run. In this case, the first few averages would b e meaningless. 5. Run the VI and observe the operation. LabVIEW only plots the a verage on the graph. Note: Remember to initialize shift registers to avoid incorporating old or default dat a into your current data measurements LabVIEW Tutorial Manual 3-18 © National Instruments Corporation

Chapter 3 Loops and Charts Multiplot Charts Charts can accommodate more than one plot. You must bundle the data together in the case of multiple scalar inputs. You should modify the block diagram to displ ay both the average and the current random number on the same chart. 1. Modify the block diagram as shown in the previous illustration. Bundle function (Functions»Cluster). In this exercise, the Bundle function bundles , or groups, the average and current value for plotting on the chart. The bundle node appears as shown at left when you place it in the block diagram. If you po p up on the bundle and choose Show»Label, the word Bundle appears in the label. Yo u can add additional elements by using the Resizing cursor (accessed by placing the Positioning tool at the corner of the function) to enlarge the node. Note: T he order of the inputs to the Bundle function determines the order of the plots on the chart. For example, if you wire the raw data to the top input of the Bund le and the average to the bottom, the first plot corresponds to the raw data and the second plot corresponds to the average. © National Instruments Corporation 3-19 LabVIEW Tutorial Manual

Chapter 3 Loops and Charts 2. Run the VI. The VI displays two plots on the chart. The plots are overlaid. That is, they share the same vertical scale. Try running the VI with execution highl ighting turned on to see the data in the shift registers. Remember to turn off t he hilite execute button, in the toolbar, when you finish so the VI can execute at full speed. Customizing Charts You can customize charts to match your data display requirements or to display m ore information. Features available for charts include: a scrollbar, a legend, a palette, and a digital display. On the chart, the digital display has been enabled. Notice that a separate digit al display exists for each trace on the chart. 1. 2. If the scrollbar is present , hide it by popping up on the chart and deselecting Show»ScrollBar. Customize the Y axis. a. Use the Labeling tool to double-click on 2.0 in the Y scale. Type in 1.2 and press <Enter> (Windows); <return> (Macintosh); <Return> (Sun); or <Ente r> (HP-UX). b. Again using the Labeling tool, click on the second number from the bottom on the Y axis. Change this number to 0.2, 0.5, or something other than the current number. This number determines the numerical spacing of the Y axis divisions. LabVIEW Tutorial Manual 3-20 © National Instruments Corporation

and choosing Show»Legend. Show the legend by poppin g up on the chart. you can modify the chart display while the VI is running.Chapter 3 Loops and Charts Note: The chart size has a direct effect on the display of axis scales. You can change plot 1 to Running Avg in the same way. You can also select a hair line width. Choose the color you want from the color palette that appears. Run the VI. Using this pop-up menu. you can change the def ault line setting to one that is larger than 1 pixel. Rename 0 to Current Value by double-clicking on the label with the Labeling tool and typing in the n ew text. respectively. Like the legend. If you have a color monitor. or point style by popping up on what you want to change in the legend with the Color tool. With the palette. you can also color the plot background. Show the chart pop-up palette by popping up on t he chart and choosing Show»Palette. You can place the legend anywhere relative to the chart. use the buttons from the palette to mo dify the chart. scale the X or Y axis. You can set the plot line width by popp ing up on the plot in the legend. If the text disap pears. Move the legend if necessary. 3. You can reset the chart. While the VI is running. If yo u want the graph to autoscale either of the scales continuously. which is not displayed on the computer screen. but is printed if you r printer supports hairline printing. enlarge the legend text box by resizing from the left corner of the legen d with the Resizing cursor. you can place the palette anywhere relative to the chart . © National Instruments Corporation 3-21 LabVIEW Tutorial Manual . Increase the c hart size if you have trouble customizing the axis. The Positioning tool changes to the Resizing cursor to indicate that you can resize the legend. click on the lo ck switch to the left of each button to lock on autoscaling. 4. You can set the plot line style and the point style by popping up on the plot in the legend. You can also scroll to view other areas or zoom into areas of a graph or chart. Stretch the legend to i nclude two plots using the Resizing cursor. 5. You can use the X and Y buttons to rescale the X and Y axes. and change the display format at any time. traces.

us e the Resizing cursor to make the display area of the chart smaller. the text may become larger th an the maximum size that the waveform can correctly present. Different Chart Modes The following illustration the Data Operations»Update fault mode is strip chart.) . scroll the area displayed. The de (If the VI is still running. If you change the axis.Chapter 3 Loops and Charts You can use the other buttons to modify the axis text precision or to control th e operation mode for the chart. and sweep chart. or zoom in on areas of the chart. Experiment with these buttons to explore their o peration. Note: Mod ifying the axis text format often requires more physical space than was original ly set aside for the axis. To correct this. the Data Operations subm the chart. scope chart. enu is the pop-up menu for LabVIEW Tutorial Manual 3-22 © National Instruments Corporation shows the three chart display options available from Mode: strip chart.

© National Instruments Corporation 3-23 LabVIEW Tutorial Manual .Chapter 3 Loops and Charts The strip chart mode scrolling display is similar to a paper tape strip chart re corder. 1. it plots the value to the right of the last value. The scope chart mode has a retracing display similar to an oscilloscope. The scope chart is significan tly faster than the strip chart because it is free of the overhead processing in volved in scrolling. Summary LabVIEW has two structures to repeat execution of a subdiagram—the While Loop and the For Loop. but it does not go blank wh en the data hits the right border. and shifts old values to the left. As the VI receives each new value. Stop the VI. For each iteration you want to recall. As the VI receives each new value. and select Data Operations»Update Mode»Sweep Chart. The While Loop executes as l ong as the value at the conditional terminal is TRUE. The sweep chart mode acts much like the scope chart. 2. and save it. Instead. Shift registers (a vailable for While Loops and For Loops) transfer values from one iteration to th e beginning of the next. W hen the plot reaches the right border of the plotting area. You can control the loop timing by using the Wait Until Next ms Multiple function. This function ensures that no iteration is shorter than a specified number of milliseconds (1000 ms equals one second). Make sure the VI is still running. you must add a new element to the left terminal of the shift register. pop up on the chart. The For Loop executes a se t number of times. Make sure the VI is still running. a moving vertical line marks the beg inning of new data and moves across the display as the VI adds new data. and select Data Operations»Update Mode»Scope Chart. Both structures are resizable boxes. You place the subdiagram to b e repeated inside the border of the loop structure. 3. You can configure shift registers to access values from previous iterations.vi. it plots the value at the right margi n. pop up on the chart. the VI erases the pl ot and begins plotting again from the left border. Name it My Random Average.

Customizing Charts For more information on charts. The LabVIEW Tutorial Manual 3-24 © National Instruments Corporation . in the LabVIEW User Manual.llb. You can also find more information on loops in Chapter 19. Graph and Chart Controls an d Indicators. Structures. Testing a While Loop before Execution The While Loop always executes at least once. because LabVIEW performs the loop test for continuation after the diagram executes. You can also stack plots on a chart. a gray coercion dot appears.vi example located in ex amples\general\graphs\charts. in your LabVIEW User Manual. Feel free to explore th is material now. Refer to the charts. This do t is located at the terminal where the VI converts the data. The chart treats these in puts as new data for a single plot. You wire a Boolean input to the Case structure selector terminal so the s ubdiagram for the FALSE condition executes if the While Loop is not supposed to execute. You can construct a While Loop that pretests its conditional terminal by including a Case structure inside the loop. Stacked Versus Overlaid Plots Earlier in this chapter you made a multiplot chart that had the plots overlaid. so you ca n find them in most of the LabVIEW examples as well as the exercises in this tut orial. or to go on to the next chapter and refer back to these topics as necessary. Additional Topics The rest of this chapter discusses more advanced topics.Chapter 3 Loops and Charts When LabVIEW must force the numeric representation of one terminal to match the numeric representation of another terminal. refer to Chapter 15. Faster Chart Updates You can pass an array of multiple values to the chart.vi example located in e xamples\general\graphs\charts.llb Using Loops While and For Loops are basic structures for programming with LabVIEW. Refer to the charts.

In the following illustration. While (pretest condition) Do actual work of While Loop Loop © National Instruments Corporation 3-25 LabVIEW Tutorial Manual . labels represent the pretest co ndition and the actual work performed by the While Loop. and its results are wired to both the conditional terminal of the While Loop and the selector terminal of th e Case structure.Chapter 3 Loops and Charts subdiagram for the TRUE condition contains the work of the While Loop. This example has the same result as the following pseudocode. The test for continuation occurs outside the Case structure.

Chapter 3 Loops and Charts Using Uninitialized Shift Registers You initialize a shift register by wiring a value from outside a While or For Lo op to the left terminal of the shift register. you want to r epeatedly execute a VI with a loop and shift register. for exa mple. shift register terminal u nwired from outside the loop. the initial output of the shift register is the last value from the pr evious execution. so that each time the VI executes. to avoid reprogramming the function. Sometimes. you must leave the left. The following version of a Fluke 8840A multimet er driver uses two uninitialized shift registers to remember the last state of t he driver so that you have to reprogram the instrument only when you first use i t or when a control parameter changes. LabVIEW Tutorial Manual 3-26 © National Instruments Corporation . To do that. This can improve performance in instr uments slow to execute commands. and trigger parameters in inst rument driver VIs every time they execute. You can use uninitialized shift registers. range. however.

The Tru e case executes and programs the function. that is. the default for an uninitialized Boolean. © National Instruments Corporation 3-27 LabVIEW Tutorial Manual . range. You can modify the operation to program th e changed control only by using separate Case structures for each control. the value of the b ottom shift register is FALSE. when any of the controls changes. and trigger parameters and set s the meter to use slow measurements. Case and Sequence Struc tures and the Formula Node. Case structures are discussed in greater detail in Chapter 5.Chapter 3 Loops and Charts The first time this VI executes after you load or compile it. The True case also executes if the current value of any of the three parameter controls differs from the last value.

An array has one or more dimensions and up to 2 – 1 elements per dimension.1 6 6. memo ry permitting. Arrays in LabVIEW can be any type (except array. and Indicators You create array controls. How to use graphs to display data. bout clusters. How to generate arrays on loop boundaries.8 5 5.Chapter Arrays. Constants.2 3 8. © National Instruments Corporation 4-1 LabVIEW Tutorial Manual . the second element has index 1. see examples\ general\ arrays. or graph) .2 2 8. or clus ter. or graph. index 10-element array 0 1. How to use some basic array fu nctions.0 8 2. Clusters.llb. The following one-dimensi onal array of numeric values illustrates this structure. and Graphs You Will Learn: • • • • • • About arrays. Boolean. The index is in the range 0 t o n-1. where n is the number of elements in the array.0 7 1. constants. What polymorphism is. You access each array element through its index. The array element cannot be another array. string. and indicators on the front panel or block diagram by combining an array constant with a numeric.0 4 4. and so on. For examples of arrays. Notice that the first e lement has index 0. chart.7 Array Controls.5 9 1. 4 Arrays An array consists of a collection of data elements that are all the same 31 type .2 1 3. chart.

in this tutorial) is that a graph plots data as a block. LabVIEW Tutorial Manual 4-2 © National Instruments Corporation . and intensity graphs (see the Additional Topics section at the end of this chapt er for information on intensity graphs). see examples\ general\graphs. waveform graphs. You will also modify the VI to graph multiple plots. Clusters.5 Max Y axis 1. Loops and Charts. 2. Creating an Array with Auto-Indexing OBJECTIVE To create an array using the auto-indexing feature of a For Loop and p lot the array in a waveform graph. Front Panel *digital indicator array* *waveform graph* Autoscale Y disabled Min Y axis -0. Label the array constant Waveform Array. Place an array shell from Controls»Array & Cluster in the front panel. LabVIEW has three types of graphs: XY graphs. The difference between a graph and a ch art (discussed in Chapter 3. Open a new front panel. and Graphs Graphs A graph indicator consists of a two-dimensional display of one or more data arra ys called plots. whereas a chart plots data point by point or array by ar ray.Chapter 4 Arrays. For examples of graph VIs. You will build a VI that generates an array u sing the Generate Waveform VI and plots the array in a waveform graph.5 1.

7. Modify the Y axis limits by double-clicking on the scale limits with the Labeling tool and entering the new numbers. and intensity graphs. such as acquired t ime-varying waveforms.5 and the maximum to 1. As stated previously. Place a waveform graph from Controls»Graph i n the front panel. they automatically adjust the X and Y axis scale limits to display the entire input data set. 4. The waveform graph plots arrays with uniformly spaced points. LabVIEW has three types of graphs: XY graphs. Enlarge the graph by dragging a corner with the Resizi ng cursor. By default. This indicator displays the array contents. Clusters. Disable a utoscaling by popping up on the graph and deselecting Y Scale»Autoscale Y. graphs autoscale their input. a graph indicator is a two-dimensional display of one or m ore data arrays called plots. Place a digital indicator from Controls»Numeric inside the element display of the array constant. That is. 5.5. wave form graphs. as the following illustration shows. Change the Y axis minimum to -0. Label the graph Waveform Graph.Chapter 4 Arrays. 6. and Graphs 3. © National Instruments Corporation 4-3 LabVIEW Tutorial Manual .

You need to resize the Bundle func tion icon before you can wire it properly. When the tool changes. The tool transforms into the Resizing cursor shown at left. redu cing wire clutter. so wire the loop iteration terminal to this i nput. Place the Positioning tool on the low er right corner of the icon. The cluster in the block diagram you are buil ding here groups related data elements from multiple places on the diagram. Popping up on the VI and selecting Show»Label displays the word Generate Wav eform in the label. Bundle function (Functions»Cluster) assembles the plot components into a cluster. The For Loop automatically accumulates the arrays at its boundary. Now.Chapter 4 Arrays. In this ca se. and Graphs Block Diagram 1D array 1. the numeric constant wired to the loop count numeric input has the For Loop create a 100-element array (indexed 0 to 99). your subVIs require fewer connection t erminals. click and drag down until a third input terminal appears. This is called auto-indexing. Clusters. The Generate Waveform VI (Functions»Tutorial) returns one point of a waveform. When you use clusters. you can continue wiring your block diagram as shown in the first illustration in this section. A cluster is analogous to a record in Pascal LabVIEW Tutorial Manual 4-4 © National Instruments Corporation . A cluster consists of a data type that can contain data elements of different types. Notice that the wire from the Generate Waveform VI becomes t hicker as it changes to an array at the loop border. Build the block diagram shown in the preceding illustration. The VI requires a scalar index input.

and Graphs or a struct in C. see the following illustration. and select Create Const ant to automatically add and wire a numeric constant for that terminal. Note: Be s ure to build data types that the graphs and charts accept. Notice that you c an pop up on the For Loop count terminal.Chapter 4 Arrays. Check the data type information that appears in the Help window. the initial X value. the delta X value (1) . Numeric Constant (Functions»Numeric). provided by the numeric constants on the block diagram). For an example. Move the Wiring tool over the graph t erminal. Each wire in the cable would represent a different element of th e cluster. Three numeric constants set the number of Fo r Loop iterations. be sure to check your data types by taking the following steps: • • • Open the Help window by choosing Help»Show Help. shown at left. Clusters. The components include the initial X value (0). and the Y array (waveform data. much like a t elephone cable. and the delta X value. You can think of a cluster as a bundle of wires. As you build your blo ck diagram. In LabVIEW. © National Instruments Corporation 4-5 LabVIEW Tutorial Manual . use the Bundle function to assemble a cluster.

5 and the initial X value to 20. Clusters. the delta value of X. you specified an initial X and a delta X value fo r the waveform. The VI plots the auto-indexed waveform array on the waveform graph. Return to the front panel and run the VI. When the tool changes. d rag to the right or straight down. 2. 3. Change the delta X value to 0. this graph would correspond to 50 seconds worth of data starting at 20 seconds . and Graphs Each iteration of the For Loop generates one point in a waveform that the VI sto res in the waveform array created automatically at the loop border. the initial X value is zero and the delta X valu e is 1. Experiment with several combinations for the initial and delta X values. 6 index 6 7 8 index 7 8 In the previous block diagram. If you want to view more than one element at a time. The array now displays several elements in as cending index order. If you enter a number greater than the array size.5 for each point (see the X axis). indicating that you have not defined a value for that index. the Bundle function bundles the initial value of X (Xo). you can wire the waveform LabVIEW Tutorial Manual 4-6 © National Instruments Corporation . Run the VI again. The tool transforms into the Resizing cursor shown at left. you can resize the array in dicator. Place the Positioning tool on the lower right corner of the array. The initial X value is 0 and the delta X value is 1. Notice that the graph now displays the same 100 points of data with a starting v alue of 20 and a delta X of 0. In these instances. Yo u can view any element in the array by entering the index of that element in the index display. however. Often. 4. In a timed test . and the array for plotting on the graph. as the following illustration shows. After the lo op finishes execution. the display d ims. beginning with the element corresponding to the specified i ndex.Chapter 4 Arrays.

Chapter 4 Arrays. Select Edit»Remove Bad Wires . Run the VI. Multiplot Graphs You can create multiplot waveform graphs by building an array of the data type n ormally passed to a single-plot graph. and Graphs array directly to the waveform graph terminal. To delete the function and constants. select the function and con stants with the Positioning tool then press <Delete>. as the following illustration sho ws. Return to the block diagram. 6. Clusters. 2D array © National Instruments Corporation 4-7 LabVIEW Tutorial Manual . Notice that the VI plots the waveform with an initial X value of 0 and a de lta X value of 1. Delete the Bundle function and the numeric constant s wired to it. 5. Finish wiring the block diagram as shown in the previous illustration.

outside the For Loop. inside and outside the For Loop. Notice that the two waveforms plot on the same waveform graph. dimensions. Enlarge the Build Array fu nction to create two inputs by dragging a corner with the Positioning tool. Save and close the VI. the function multiplies two scalar values. Th e previous block diagram is an example of polymorphism. In this exercise. or representations. Continue building your block diagram as shown in the preceding diagram. the f unction multiplies an array by a scalar value. In this exercise. Clusters.vi. which in this case is a two-dimensional array. Run the VI. you use thi s function to create the proper data structure to plot two arrays on a waveform graph. Sine function from (Functions»Numeric»Trigonometric). Most LabVIEW functions are polymorphic. you can change from a line graph to a bar gr aph by choosing Common Plots»Bar Graph. Inside the For Loop. Switch to the front pa nel. Build Array function (Functions»Array).llb. LabVIEW Tutorial Manual 4-8 © National Instruments Corporation . and Graphs 1.Chapter 4 Arrays. Be sure to save your work in mywork. Remember that you can find the Multiply and Divide functions in Functions»Numeric. 3. Polymorphism Polymorphism is the ability of a function to adjust to input data of different t ypes. you use the function in a For Loop to build an array of points that represents one cycle of a sine wave. Name it My Graph Waveform Arrays. 2. The initial X val ue defaults to 0 and the delta X value defaults to 1 for both data sets. Notice that you use the Multiply function in two locations. Note: Y ou can change the appearance of a plot on the graph by popping up in the legend for a particular plot. Pi c onstant (Functions»Numeric»Additional Numeric Constants). For example.

. arrays of clusters. the two scalars are added together.Chapter 4 Arrays. Open the Separate Array Values. These principles can be applied to other LabVIEW functions and data types. You can also us e other combinations. the scalar is added to each element of the array.. 2.llb. Clusters. Open the block diagram. and Graphs The following example shows some of the polymorphic combinations of the Add func tion. For more information about polymorphism. The VI is located in examples\ general\arrays. You can pop up on the array and choose Show Case True or Show Case False to view th e true and false cases of the array. In the second combination. Using Auto-Indexing on Input Arrays OBJECTIVE You will open and operate a VI that uses auto-indexing in a For Loop t o process an array. and the result is an array. Some functions may acce pt numeric and Boolean inputs. see Online Reference»Function and VI Re ference»Introduction to Functions. 1. each element of one array is added to the corresponding element of the other array.vi by selecting File»Open. In the first combination. such as clusters of numerics. and the result is a scalar. and so o n. La bVIEW functions may be polymorphic to different degrees. . In the third combination. © National Instruments Corporation 4-9 LabVIEW Tutorial Manual . others may accept a combination of any data types .

to a thin wire inside the loop. If you use autoindexing for more than one array. Clusters. LabVIEW automatically sets the count to the array si ze. and Graphs The following illustration shows the block diagram with both True and False case s visible. indicating it i s a single element.Chapter 4 Arrays. LabVIEW Tutorial Manual 4-10 © National Instruments Corporation . When you use auto-indexing on an array entering a For Loop. The ith element of the array is automatically indexed from t he array during each iteration. the count becomes the smallest of the possibilities. Notice that the wire from Input Array changes from a thick wire outside the For Loop. eliminating the need to wire a value to the count terminal. indicating it is an array. Using Auto-Indexing to Set the For Loop Count Notice that the count terminal is left unwired. or if you set the count.

Chapter 4 Arrays. Using the Initialize Array Function Notice that the two shift registers are initialized using the Initialize Array f unction. Clusters. located in Functions»Array. and Graphs 1. this function cre ates a one-dimensional array. In the following illustration. Create a digital control o n the front panel. 2. Pop up on the array tunnel of a While Loop to enable auto-indexing. Close the VI and do not save changes. wire it to the count terminal. You can disable auto-indexing by popping up on the tunnel (entry point of the i nput array) and selecting Disable Indexing. Run the VI and experiment with different array sizes. Note: LabVIEW automatically enables Auto-indexing for every array wired to a For Loop. tunnel LabVIEW automatically disables auto-indexing for every array wired to a While Lo op. Use this function to create an array whose el ements all have the same value. You may not be familiar with some of the structures used in this examp le. and check the output arrays to see how different counts affect the output arrays. © National Instruments Corporation 4-11 LabVIEW Tutorial Manual . They are discussed in greater detail later in this tutorial.

one for each additional dimension.Chapter 4 Arrays. if element i s a long integer with the value of five and dimension size has a value of 100. pop up on the lower-left side of the function and select Add Dimension. During the acquisition. maximum. and minimum temperatures. Using the Graph and Analysis VIs OBJECTIVE You will build a VI that measures temperature every 0. the VI plots the data on a graph and calculates the average. After completing the acquisition. Yo u can also use the Resizing cursor to enlarge the Initialize Array node and add more dimension size inputs. from block diagram constants. The following block diagram shows how to initialize a threedimensional array. You can remove di mensions by shrinking the node by selecting Remove Dimension from the function p op-up menu or with the Resizing cursor. as shown in the preceding illustration. t he function creates an empty array of the specified type and dimension. the VI displays the measurements in real time on a strip chart. For example. LabVIEW Tutorial Manual 4-12 © National Instruments Corporation . You c an wire the inputs from front panel control terminals. t he result is a one-dimensional array of 100 long integers all set to five. and Graphs The element input determines the data type and the value of each element.25 seconds for 1 0 seconds. or from calculations on other parts of your diagram. For example s of analysis VIs. To create and initialize an array that has more than one dimen sion. Clusters. The di mension size input determines the length of the array. see examples\analysis. if all the dimension size inputs are zero. As you saw in the previous example.

The Mean. Clusters. After acquisition. The Temperature waveform chart displays the temperature as it is acquired. and minimum temperatures. and Graphs Front Panel 1. the VI plots the data in Temp Graph. and Min digita l indicators display the average. You can modify the point styles of the waveform chart and waveform graph b y popping up on their legends. Open a new front panel and build the front panel shown in the preceding illustra tion. Block Diagram © National Instruments Corporation 4-13 LabVIEW Tutorial Manual . maximum. Max.Chapter 4 Arrays.

Clusters. Build the block diagram shown in the previous illustration. R eturns one temperature measurement. Use the Positioning tool to resize the function by dragging one of the corners. Array Max & Min fu nction (Functions»Array). Numeric constant (Functions»Numeric). Wait Until Next ms Multiple function (Functi ons»Time & Dialog ). The components include the initial X value (0).25. The Wait Until N ext ms Multiple function causes each iteration to take place every 250 milliseco nds. this function ensures the For Loop executes every 0. and selecting My Thermometer VI. this function returns the maximum and minimum temperature measured during the acquisition. and Graphs 1.vi.25 so that the VI plot s the temperature array points every 0... The VI stores the temperature measurements in an array created at the For L oop border (auto-indexing).Chapter 4 Arrays. After the For Loop completes execution. Your completed VI bundles the data array with an initial X value of 0 and a de lta X value of 0. the delta X value (0. Bundle function (Functions»Cluster) assembles the plot components into a cluster . The VI requires a delta X value of 0.25).llb as My Tempera ture Analysis. The Mean VI (Functions»Analys is»Probability and Statistics) returns the average of the temperature measurements . and the Y array (temperature data). 3. 2. the array pa sses to various nodes. using the following elements: The Digital Thermometer VI (Functions»Tutorial.25 seconds (250 milliseconds). The Mean VI returns the average of the temperature measurements .25 seconds on the waveform graph. LabVIEW Tutorial Manual 4-14 © National Instruments Corporation . or you can use the VI you built in Chapter 2 by choosing Functions»Select a VI. You can also pop up on the Wait Until Next ms Multiple function and select Create Co nstant to automatically create and wire the numeric constant. R eturn to the front panel and run the VI. In this exercise. Save the VI in mywork. The Array Max & Min function returns the maximum and mini mum temperature. In this exercise. The For Loop executes 40 times.

you can then choose a numeric constant. Array and Cluster Constants and Indicators. Clusters. and Graphs Using Arrays LabVIEW has many functions to manipulate arrays located in Functions»Array. you can choose F unctions»Array and then select and place the array constant on your block diagram.Chapter 4 Arrays. There are several ways to create and initialize arrays on the block diagram. String To Byte Array x[i]=ASCII code of ith character Sine Pattern x[i]=cos(2πi /N) © National Instruments Cor oration 4-15 LabVIEW Tutorial Manual   . For information on how to create array controls and indicators on the front panel. as the following illustration shows. Note: You can also create an array and its corresponding control on the front panel an d then copy or drag the array control to the block diagram to create a correspon ding constant. Using the Operating tool. boolean const ant. see Chapter 15. or string constant to place inside the empty array. You have already seen how to create arrays at loop bounda ries and how to use the Initialize Array function. The following illustrat ion shows an example array constant with a numeric constant inserted into the ar ray shell. Some block diagram functions also produce arrays. Creating and Initializing Arrays If you need an array as a source of data in your block diagram. Some c ommon functions are discussed here. in the LabVIEW User Manual.

Initially. Clusters. fiv e string constants are built into a one-dimensional array of strings. -1. You can add as many in uts as you need to the Build Array fu nction. and Gra hs Using the Build Array Function Build Array function (Functions»Array). The result is a 3 x 3 array with the rows 3. To add more in uts. o u on the left side of the function and select Add Element In ut or Add Array In ut. three grou s of numeric constants are built into three. 8. the Build Array function a ears wit h one scalar in ut. You can use it to create an array from sca lar values or from other arrays.Cha ter 4 Arrays. one-dimensional nume ric arrays. The three arrays are then combined into a two-dimensional numeric ar ray. 4. 6. 2. or by selecting Remove In ut. 7. and 5. LabVIEW Tutorial Manual 4-16 © National Instruments Cor oration                                      . and each in ut can be either a scalar or an array. You can also enlarge the Build Array node with the Resizing cursor ( lac e the Positioning tool at the corner of an object to transform it into the Resiz ing cursor). On the left. The following exam les show two ways to create and initialize arrays with values from block diagram constants. On the rig ht. -2. You can remove in uts by shrinking the node with the Resizing curso r.

F or instance. and scalar 3. First. Po u on the first (to ) in ut in the Build Array node and select Change to Array. Clusters. Next. or next-to-last in ut . wire the arrays and scalars to the node. the elements o f array 2. Do the same for the fourth. the out ut arr ay consists of a 2D array © National Instruments Cor oration 4-17 LabVIEW Tutorial Manual                                        . The out ut array is a 1D array co m osed of the elements of array 1 followed by scalar 1. create a Build Array node with five in uts. For exam le.Cha ter 4 Arrays. and scalar 3. arra y 2. scalar 2. scalar 1. and equal to the dimension of arrays you wire to array in uts. The dimension of the out ut array is always one dimension higher than the elemen ts you wire to element in uts. scalar 2. as the following illustration shows. if you wire a series of 1D arrays to element in uts. and Gra hs You can also create an array by combining other arrays along with scalar element s. Element and array in uts can vary by no more than one dimension. as the following illustration shows. su ose you have two arrays and three scalar elements that you w ant to combine into a new array with the order array 1.

Finding the Size of an Array Array Size returns the number of elements in the in ut array. You cannot build an array with scalar element in uts and 2D or higher array in uts. and array in uts must be 3D arrays. Clusters. LabVIEW Tutorial Manual 4-18 © National Instruments Cor oration                             . Number of elements Array 7 3 2 5 4 2D Array 2 rows 3 columns Using the Array Subset Function You can use this function to extract a ortion of an array or matrix. and Gra hs whose rows corres ond to the 1D in uts. If element in uts are 2D arrays.Cha ter 4 Arrays. then the out ut is a 3D array. Any array in uts in this exam le must be 2D arrays.

Notice that the index of the third element is 2 because the first elem ent has index 0.Cha ter 4 Arrays. The following illustrations show exam les of Array Subsets. © National Instruments Cor oration 4-19 LabVIEW Tutorial Manual             . Clusters. Array Index Length 2D Array Row Index Row Length Column Index Column Length New 2D Array Using the Index Array Function The Index Array function accesses an element of an array. and Gra hs Array Subset returns a ortion of an array starting at index and containing leng th elements. Notice that the array index begins with 0. The following illustra tion shows an exam le of an Index Array function accessing the third element of an array.

You can also disable indexing on the row ter minal. By giving it a row index. LabVIEW Tutorial Manual 4-20 © National Instruments Cor oration                         . To restore a disabled index. You have now disabled the access to a s ecific array column. To do this. Clusters. Array Disabled in ut (em ty box) Notice that the index terminal symbol changes from a solid to an em ty box when you disable indexing. and Gra hs Array Index Element You can also use this function to slice off one or more dimensions of a multi-di mensional array to create a subarray of the original.Cha ter 4 Arrays. the result is an array whose elements are the elements of the s ecified row of the 2D array. use the Enable Indexing comma nd from the same menu. stretch the In dex Array function to include two index in uts. and select the Disable Indexing command on the o -u menu of the second index terminal as shown in the followin g illustration.

Extract Column Extract Row From a three-dimensional array. The following exa m le shows how to extract a one-dimensional row or column arrays from a two-dime nsional array. and Gra hs You can extract subarrays along any combination of dimensions. The following figure shows several ways to slice a three-dimensional array. The dimension of the out ut object must equal the number of disabled index te rminals. © National Instruments Cor oration 4-21 LabVIEW Tutorial Manual                 .Cha ter 4 Arrays. you can extract a two-dimensional array by disab ling two index terminals. The following rules govern the use of the Index Array function to slice arrays. One disabled–1D com onent. Two d isabled–2D com onent. Clusters. 1. or a one-dimensional array by disabling a single index terminal. For exam le: • • • Zero disabled–scalar element.

Many functions mani ulate arrays.Cha ter 4 Arrays. This feature is useful when creating and rocessing ar rays. and then adding the desired control of i ndicator to the array shell. You can dis lay more than one lot on a gra h using the Build Array function from Functions»Array. as shown in the                                                                  . The new. Kee in mind that arrays can b e of any data ty e. Both the For Loo and the While Loo can accumulate arrays at their borders. All functions that acce t numeric i n ut can acce t any numeric re resentation. You can lot your data using gra hs. Clusters. Summary An array consists of a collection of data elements of the same ty e. you used array functions to work with only one-dimensional arrays. In the exercises in this cha ter. The values wired to enabled terminals must identify the out ut elements. or a cluster o f numerics. Polymor hism is the ability of a function to a djust to in ut data of different data ty es. such as the Build Array function and the Index Array function from Functions»Array. Gra hs have many useful feature s that you can use to customize your lot dis lay. an array of numerics. 0th element is the one closest to the receding illustration. you lace an array constant from Functi ons»Array on the block diagram. Note: Remember that by default. Remember that you can also create an array on the front an el by selecting Controls»Array & Cluster. such as Boolean or string. and then you add the desired constant or indicator to the array shell. and Gra hs 2. you can inter ret the lower left receding exam e a one-dimensional array of all elements at column 0 et the u er right exam le as a command to generate a age 1. le as a command to generat and row 3. First. the same functions also work with multidimensional arrays. LabVIEW Tutorial Manual 4-22 © National Instruments Cor oration                             Thus. You can inter r two-dimensional array of original. The exam le s you studied in this lesson used numeric arrays. The gra h au tomatically becomes a multi lot gra h when you wire the array of out uts to the terminal. LabVIEW enables indexing on For Loo s and disables indexing on While Loo s. however. You create an array on the block diagram using a two-ste rocess.

Search 1D Array. Some of the o tio ns include a legend. and Online Reference»Function and VI Re ference»Cluster Functions. Clusters.Cha ter 4 Arrays. Performance Issues. in the LabVIEW User Manual. refer to Cha ter 15. through which you can define the color and style for a give n lot. © National Instruments Cor oration 4-23 LabVIEW Tutorial Manual                                                           . Multi ly Array Elements. see the Memory Usage section in Cha ter 27. These fu nctions include Re lace Array Element. Sort 1D Array. of the LabVIEW User Manual. For more infor mation about arrays and the array functions available. and Gra hs Additional To ics More About Arrays Many more array functions exist in LabVIEW than we have discussed here. and a cursor dis lay.recision arrays instead of double. a alette from which you can change scaling and format o tions while the VI is running. Customizing Gra hs Both waveform and XY gra hs have a number of o tional arts that you can show or hide using the Show submenu of the o -u menu for the gra h. The following illustration of a gra h show s all of the o tional com onents exce t for the cursor dis lay. Reverse 1 D Array. Efficient Memory Usage: Minimizing Data Co ies To save memory. If you want to understand how LabVIEW uses memory. you can use single. and many other array functions. Online Refere nce»Function and VI Reference»Array Functions.recision arrays. Arra y and Cluster Controls and Indicators.

Cha ter 4 Arrays. and you can move multi le cursor s at the same time. The following illustration shows a waveform gra h with the cursor dis lay. LabVIEW can set and read cursors rogrammatic ally. and Gra hs major grids Y scale minor grids legend X scale alette Gra h Cursors You can lace cursors and a cursor dis lay on all the gra hs in LabVIEW. and you can label the cursor on the lot. Cursor Name Cursor Movement Control Y Position Cursor Style Control Lock to Plot Control X Position Active Cursor Button for Cursor Movement LabVIEW Tutorial Manual 4-24 © National Instruments Cor oration                               . You can set a cursor to lock onto a lot. Clusters. There is no limit to the number of cursors a gra h can have.

Cha ter 4 Arrays. or rogrammatically. Both intensity lots acce t two-dimensional arrays o f numbers. in your LabVIEW User Manual. usin g an attribute node for the chart. refer to intgra h. Macintosh. © National Instruments Cor oration 4-25 LabVIEW Tutorial Manual                                                                                        . Gra h and C hart Controls and Indicators. in the LabVIEW Data Acquisition Basics Manual for more information on mani ulating data arrays.vi in exam les\general\ gra hs\zoom. and Gra hs For more detailed information on customizing gra hs.llb in the exam les\general\gra hs directory. where each number is ma ed to a color. You can define the color ma ing interactively. For more information about the intensity lot s. see Cha ter 16. Clusters.llb for an exam le that reads cursor values and rogrammatically zooms in and out of a gra h using the cursors. Gra h Exam les You can find a number of gra h exam les located in exam les\ general\gra hs. whi ch contains VIs to erform many varied functions with arrays and gra hs. Basic Data Acquisition Conce ts. Data Acquisition Arrays (Windows. For exam les using the intensity chart and gra h. and Sun) Data returned from a lug-in data acquisition board using the Data Acquisition V Is can be in the form of a single value. Refer to the ZoomGra h . See the Data Organization in for Analog A lications section in Ch a ter 3. a one-dimensional array. Intensity Plots LabVIEW has two methods for dis laying three-dimensional data: the intensity cha rt and the intensity gra h. or a two-dimen sional array. see Cha ter 16. using an o tional color ram scale. in the LabVIEW User Manual. Gra h and Chart Controls and Indicators.

Cha ter Case and Sequence Structures and the Formula Node You Will Learn: • • • • • How to use the Case structure. anel as shown in the revious illust                    . The free label acts as a note to the user. What Sequence Locals are and how to use them. The Square Root Value indicator dis lays the square root of the number. © National Instruments Cor oration 5-1 LabVIEW Tutorial Manual       O en a new front anel and build the front ration. the VI returns an error. How to use the Sequence structure. see exam les\general\ structs. Front Panel 1. otherwis e. The Number control su lies the number. If the number is ositive the VI calculates the square root of the number. For ex am les of structures. What a Formula Node is and how to use it.llb. 5 Using the Case Structure OBJECTIVE You will build a VI that checks a number to see if it is ositive.

the Case structure is Boolean and it has only two cases: True and Fa lse. A Boolean Case structure is analogous to an if-then-else statement in textbased. Enlarge the Case structure by dragging one corner with the Resizing cu rsor. 2. Place a Case structure (Functions»Structures) in the block diagram. It LabVIEW Tutorial Manual 5-2 © National Instruments Cor oration         . By default.Cha ter 5 Case and Sequence Structures and the Formula Node Block Diagram Selection Terminal 1. rogramming languages. O en the block diagram.

00 and dis lays a dialog box with the message Error. Enter text ins ide the box with the Labeling tool. © National Instruments Cor oration 5-3 LabVIEW Tutorial Manual                       . Greater Or Equal To 0? function (Functions»Com arison).. Square Root function (Funct ions»Numeric). The function returns a TRU E if the number in ut is greater than or equal to 0.00 Numeric Constant (Functions»Numeric).. the func tion determines whether the number in ut is negative. Select the other block diagram objects and wi re them as shown in the block diagram illustration. -99999. You can dis lay only one case at a time. the function dis lays a dialog box that contains the m essage Error. In this exercise. the VI executes either the True case or the False case. the function returns the square root of the in ut number. If the number is greater than or equal to zero..Negative Number.Negat ive Number. String Constant (Functions»String). The False case out uts -99999. 3. To change cases.. In this exercise. th e VI executes the True case and returns the square root of the number. In this exercise. click on the arrows at the to of the Case structure.Cha ter 5 Case and Sequence Structures and the Formula Node automatically changes to numeric when you wire a numeric control to the selectio n terminal. In this exercise. One Button Dialog function (Functions»Time & D ialog).

then you must ut the indicator in that case or use a global or local variable . If you do not want to assign the out ut in all cases to a value . Notice that when you change the digital control to a negative number.Negative Number" end if LabVIEW Tutorial Manual 5-4 © National Instruments Cor oration                                   .Cha ter 5 Case and Sequence Structures and the Formula Node Note: You must define the out ut tunnel for each case. When you create an out ut tunne l in one case. LabVIEW dis lays the error message you set u in the False case of the case str ucture. Try a number greater than zero an d a number less than zero by changing the value in the digital control you label ed Number. Save and close the VI. clicking on the tunnel itself each time.00 Dis lay Message "Error. Return to the front anel and run the VI.. VI Logic if (Number >= 0) then Square Root Value = SQRT(Number) else Square Root Value = -99999.vi. Unwir ed tunnels a ear as white squares. you a ssign a value to the out ut tunnel in the False case because the True case has a n out ut tunnel. 4. 5. In this exercise. Name it My Square Root.. Be sure to wire to the out ut tunnel for eac h unwired case. tunnels a ear at the same osition in all the other cases.

O en a new front anel and build the front anel shown in the following illustra tion. Time to Match indicates how many seconds it took to find the matching number. Modifying the Numeric Format By default. The # of iterations indicato r dis lays the number of iterations before a match.. The Number to Match control contains the number you want to match. The Current N umber indicator dis lays the current random number. Be sure to modify the controls and indicators as described in the text fol lowing the illustration. o tion to denote time and date formats f or numerics.14). You can use the Format & Precision.. 3. LabVIEW dis lays values in numeric controls in decimal notation with two decimal laces (for exam le. You can also use the Format & Precision. Front Panel 1. © National Instruments Cor oration 5-5 LabVIEW Tutorial Manual                                     . o tion of a control or indicator o -u menu to change the recision or to dis la y the numeric controls and indicators in scientific or engineering notation..Cha ter 5 Case and Sequence Structures and the Formula Node Using the Sequence Structure OBJECTIVE You will build a VI that com utes the time it takes to generate a rand om number that matches a given number..

Re eat the revious ste for the Current Number. 2. a. You must be in the front anel to access the menu..Cha ter 5 Case and Sequence Structures and the Formula Node 1. b. Po u on the Number to Match digital control and choose Re resentation»Long. b. Change the re resentation of the digital control and two of the digital indicato rs to long integers. Change the recision on the Time to Match indicator. LabVIEW Tutorial Manual 5-6 © National Instruments Cor oration                           ... and the # of iterations digi tal indicators. Po u on the Time to Ma tch digital indicator and choose Format & Precision. a. Enter a 3 for Digits of Precision and click on OK.

dark border frames the control that is out of range. and click on OK. or sus end execution. a solid. b... in the toolbar.Cha ter 5 Case and Sequence Structures and the Formula Node Setting the Data Range With the Data Range. a. when a range error sus end s execution. Po u on th e Time to Match indicator and choose Data Range.. as shown in the following illustration. © National Instruments Cor oration 5-7 LabVIEW Tutorial Manual                          . Your o tions are to ignore t he value. 1. The range error symbo l a ears in lace of the run button. o tion you can revent a user from setting a control or i ndicator value outside a reset range or increment. Fill in the dialog box.. Also.. Set the data range between 0 and 100 with an increment of 1. coerce it to within range.

Cha ter 5 Case and Sequence Structures and the Formula Node Block Diagram 1. O en the block diagram. LabVIEW Tutorial Manual 5-8 © National Instruments Cor oration       . 2. Place the Sequence structure (Functions»Structures) in the block diagram.

executes block diagrams sequentially. a node execute s when data is available at all of the node in uts. the function retu rns a random number between 0. Multi ly function (Functions»Numeric). and so on. which looks like frames of film. you need two Tick Coun t functions. You can create sequence locals on the border of a frame. However . 6. LabVIEW uses the Sequence structure a s a method to control the order in which nodes execute. Frame 0 in the revious illustration contains a small box with an arrow in it. LabVIEW laces the diagr am that the VI executes first inside the border of Frame 0. Create a new frame by o ing u on the frame border and choose Add Frame After. 3. Random Number (0-1) function (Functions»Numeric). 5. In other words. it laces the diagra m it executes second inside the border of Frame 1. In conventional rogramming languages. Returns the number of millisec onds that have ela sed since ower on. although sometimes it is nec essary to execute one node before another. 4. only one frame is visible at a time. the rogram statements exe cute in the order in which they a ear. Finish the b lock diagram as shown in the o ening illustration of the Block Diagram section. Re eat this ste to create Frame 2. For this exercise.0 and 100. In this exercise. The arrow inside the square a ea rs automatically when you wire a function to the sequence local.0. © National Instruments Cor oration 5-9 LabVIEW Tutorial Manual                                                              . In data flow rogramming. T hat box is a sequence local variable which asses data between frames of a Seque nce structure. Create the sequence local by o ing u on the bottom bor der of Frame 0 and choosing Add Sequence Local. you cannot access the data in frames receding the frame in which you created the sequence local. The sequence local a ears as an em ty square. As with the Case s tructure. the function multi lies the random number by 100. The data wired to a frame sequence local is then available in subsequent frames.Cha ter 5 Case and Sequence Structures and the Formula Node The Sequence structure. Enlarge the structure by dr agging one corner with the Resizing cursor. Tick Count (ms) function (Functions»Time & Dialog). Returns a random nu mber between 0 and 1.

8. Increment function (Functions»Numeric). the function com ares the random number to the number s ecified in the front anel and returns a TRUE if the numbers are not equal. In this exercise. this function returns FALSE. In this exercise. Divide function (Functions»Numeric). In this exercise. where the value is available in subsequen t frames. The V I subtracts the old time ( assed from Frame 0 through the Sequence local) from t he new time to com ute the time ela sed. In Fram e 0. Not Equal? function (Functions»Com a rison). Save and close th e VI. the VI executes the While Loo as long as the number s eci fied does not match the number that the Random Number (0-1) function returns. LabVIEW Tutorial Manual 5-10 © National Instruments Cor oration                                   . In Frame 2. In this exercise. In this exercise. the function returns the time (in millis econds) ela sed between Frame 2 and Frame 0. the function increments the While Loo count by 1. the Tick Count (ms) function returns the current time in milliseconds. the function divides the number of milliseconds ela sed by 100 0 to convert the number to seconds. This value is wired to the sequence local. the Tick Count (ms) function returns a new time in milliseconds. 7. the numeric const ant re resents the maximum number that can be multi lied. In this exercise. the function rounds the random number b etween 0 and 100 to the nearest whole number. the function converts the number from milliseconds to seconds. Ot herwise. Return to the front anel and ent er a number inside the Number to Match control and run the VI. Numeric constant (Functions»Numeric). Name it My Time to Match. Subtract functi on (Functions»Numeric). In t his exercise. In Frame 1.Cha ter 5 Case and Sequence Structures and the Formula Node Numeric Constant function (Functions»Numeric).vi. Round to Nearest funct ion (Functions»Numeric).

For exam le. You enter the formula or formulas inside the box. in lieu of creating block diagram subsections. You enter formulas with the Lab eling tool. With the Formula Node. as shown in the follow ing illustration. or formulas . © National Instruments Cor oration 5-11 LabVIEW Tutorial Manual                                   . Variables are case sensitive.).Cha ter 5 Case and Sequence Structures and the Formula Node Formula Node The Formula Node is a resizable box that you can use to enter formulas directly into a block diagram. This feature is useful when an equation has many v ariables or is otherwise com licated. consider the equation: y = x2 + x + 1. You can im lement the same equation using a Formula Node. If you im lement this equation using regular LabVIEW arithmetic functi ons. Ty e the variable name in the box. Each formula statement must end with a semicolon (. You create the in ut and out ut terminals of the Formula Node by o ing u on the border of the node and choosing Add In ut (Add Out ut). you can directly enter a com licated formula. You lace the Formula Node on the block diagram by selecti ng it from Function»Structures. the block diagram looks like the one in the following illustration.

Cha ter 5 Case and Sequence Structures and the Formula Node The o erators and functions available inside the Formula Node are listed in the Hel window for the Formula Node. A semi colon terminates each formula statement. Formula Node functions are described in more detail in Cha ter 20. If x is negative. as shown in the following illustration. and assigns the result to y. if (x >= 0) then y = sqrt(x) else y = -99 end if LabVIEW Tutorial Manual 5-12 © National Instruments Cor oration                   . The Formula Node. of the LabVIEW User Manual. The following exam le shows how you can erform a conditional assignment inside a Formula Node. Consider the following code fragment that com utes the square ro ot of x if x is ositive. the cod e assigns -99 to y.

Cha ter 5 Case and Sequence Structures and the Formula Node You can im lement the code fragment using a Formula Node, as shown in the follow ing diagram. Conditional O erator False Condition Condition True Condition Using the Formula Node OBJECTIVE You will build a VI that uses the Formula Node to calculate the follow ing equations. y1 = x3 - x2 + 5 y2 = m * x + b where x ranges from 0 to 10. You will use only one Formula Node for both equatio ns, and you will gra h the results on the same gra h. © National Instruments Cor oration 5-13 LabVIEW Tutorial Manual

 

 

 

 

 

 

Cha ter 5 Case and Sequence Structures and the Formula Node Front Panel 1. O en a new front anel and build the front anel shown in the receding illustra tion. The waveform gra h indicator dis lays the lots of the equation. The VI us es the two digital controls to in ut the values for m and b. Create the gra h legend shown in the receding illustration by selecting Show»Lege nd. Use the Resizing cursor to drag the legend downward so it dis lays two lots . Use the Labeling tool to rename the lots. You can define the line style for e ach lot using the legend o -u menu. You can also color each lot by o ing u on the legend and choosing Color. LabVIEW Tutorial Manual 5-14 © National Instruments Cor oration

 

    

 

 

 

 

 

 

 

 

 

 

   

 

 

 

 

 

 

 

 

Cha ter 5 Case and Sequence Structures and the Formula Node Block Diagram 1. 2. Build the block diagram shown in the receding illustration. Place the For Loo (Functions»Structures) in the block diagram and drag the corner to enlarge the loo .

Formula Node (Functions»Structures). With this node, you can directly enter formul a(s). Create the three in ut terminals by o ing u on the border and choosing Add In ut. You create the out ut terminal by choosing Add Out ut from the o -u menu. When you create an in ut or out ut terminal, you must give it a variable name. The variable name must exactly match the one you use in the formula. The n ames are case sensitive. That is, if you use a lower case a in naming the termin al, you must use a lower case a in the formula. You can enter the variable names and formula with the Labeling tool. Note: Although variable names are not limit ed in length, be aware that long names take u considerable diagram s ace. A sem icolon (;) terminates the formula statement. Numeric Constant (Functions»Numeric). You can also o u on the count terminal and select Create Constant to automat ically create and wire the numeric constant. The numeric constant s ecifies the number of For Loo iterations. If x range is 0 to 10 including 10, you need to w ire 11 to the count terminal. © National Instruments Cor oration 5-15 LabVIEW Tutorial Manual

 

 

   

 

 

 

 

    

 

 

 

   

 

 

     

 

 

 

 

Cha ter 5 Case and Sequence Structures and the Formula Node Because the iteration terminal counts from 0 to 10, you use it to control the X value in the Formula Node. Build Array (Functions»Array) uts two array in uts int o the form of a multi lot gra h. Create the two in ut terminals by using the Res izing cursor to drag one of the corners. 3. 4. Return to the front anel and run the VI with different values for m and b. Save and close the VI. Name the VI My Equations.vi. Summary Two of the LabVIEW structures that control data flow are the Case structure and the Sequence structure. LabVIEW de icts both structures like a deck of cards; on ly one case or one frame is visible at a time. You use the Case structure to bra nch to different subdiagrams de ending on the in ut to the selection terminal of the Case structure. You lace the subdiagrams inside the border of each case of the Case structure. The case selection can be either Boolean (2 cases) or 31 nu meric (u to 2 – 1 cases). LabVIEW automatically determines the selection terminal ty e when you wire a Boolean or numeric control to it. You use the Sequence str ucture to execute the diagram in a s ecific order. You lace the ortion of the diagram that you want to execute first in frame 0 of the Sequence structure, the diagram that you want to execute second in frame 1, and so on. You use sequence locals to ass values between Sequence structure frames. The data assed in a s equence local is available only in frames subsequent to the frame in which you c reated the sequence local, and not in those frames that recede the frame. With the Formula Node, you can directly enter formulas in the block diagram. This fea ture is useful when a function equation has many variables or is com licated. Re member that variable names are case sensitive and that each formula statement mu st end with a semicolon (;). LabVIEW Tutorial Manual 5-16 © National Instruments Cor oration

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

   

Cha ter 5 Case and Sequence Structures and the Formula Node Additional To ics More Information on Case and Sequence Structures For more information on Case and Sequence structures, see the Case and Sequence Structures section, in Cha ter 19, Structures, of the LabVIEW User Manual. Also, because these structures are fundamental LabVIEW rogramming elements, you can see their use in many of the VIs in the exam les directory. Timing with Sequence Structures One common use of Sequence structures is to calculate the execution time of a fu nction or VI. The Timing Tem late.vi exam le in exam les\general\structs.llb inc ludes a tem late for this o eration. More Information on Formula Nodes You can find more information on Formula Nodes in Cha ter 20, The Formula Node, of the LabVIEW User Manual. Artificial Data De endency Nodes not connected by a wire can execute in any order. Nodes do not necessarily execute in left-to-right, to -to-bottom order. A Sequence structure is one way to control execution order when natural data de endency does not exist. Another way to control execution order is to create an artificial data de endency, a con dition in which the arrival of data rather than its value triggers execution of an object. The receiver may not actually use the data internally. The advantage of artificial de endency is that all of the nodes are visible at one level, alth ough, in some cases, the confusion created by the artificial links between nodes can be a disadvantage. You can o en the Timing Tem late (data de ).vi from exam les\general\structs.llbto see how the Timing Tem late has been altered to use a rtificial data de endency rather than a sequence structure. © National Instruments Cor oration 5-17 LabVIEW Tutorial Manual

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

see exam les\ general\strings. in Controls»String & Table. You can use strings for more than sim le text messages. About file in ut and out ut o erations. For exam l es of strings. Storing numeric data to d isk can also involve strings. To store numbers in an ASCII file. shown at left. you must first convert numbers to strings before writing the numbers to a disk file. 6 Strings A string is a collection of ASCII characters. © National Instruments Cor oration 6-1 LabVIEW Tutorial Manual                       . How to use string functions. you can ass numeric data as charac ter strings and then convert these strings to numbers. How to save data to files in s readsheet form at. You can enter or change text inside a string control using the O erating tool or the Labeling tool. Enlarge string controls and indicators by dragging a corner with the Positioning tool. In instrument control. Creating String Controls and Indicators You can find the string control and indicator. How to write data to and read data from text files.llb.Cha ter Strings and File I/O You Will Learn: • • • • • How to create string controls and indicators.

Front Panel *string control* *string indicator* *digital control* *string control* *digital indicator* Re resentation -> 132 LabVIEW Tutorial Manual 6-2 © National Instruments Cor oration                     . If this o tion is dimmed. you must increase the vert ical size of the window to make it available. Using String Functions OBJECTIVE LabVIEW has many functions to mani ulate strings. The VI also determines the out ut string length. You will build a VI that converts a number to a str ing and concatenates the string with other strings to form a single out ut strin g.Cha ter 6 Strings and File I/O Strings and File I/O If you want to minimize s ace that a front anel string control or indicator occ u ies. select Show»Scrollbar. You will find these functions in Functions»String.

O en a new front anel and build the front anel shown in the receding illustra tion. String Length function (Functions»String) returns the num ber of characters in the concatenated string.Cha ter 6 Strings and File I/O 1. Block Diagram 1. of this tutorial to learn more about strings used for instrument comma nds. Format Into String function (Functions»String) concatenates and formats numbers an d strings into a single out ut string. Use the Resizing cursor on the icon to ad d three argument in uts. The two string controls and the digital control can be combined into a single ou t ut string and dis layed in the string indicator. © National Instruments Cor oration 6-3 LabVIEW Tutorial Manual                               . Build the block diagram shown in the receding illustration. Be sure to modify the controls and indicators as de icted. The digital indicator dis lay s the string length. Data Acquisition and Instrument Control. The Combined String out ut in this exercise has a similar f ormat to command strings used to communicate with GPIB (IEEE 488) and serial (RS -232 or RS-422) instruments. Refer to Cha ter 8.

Notice that the Format Into String function concatenates the two str ing controls and the digital control into a single. Save the VI a s My Build String.vi. LabVIEW Tutorial Manual 6-4 © National Instruments Cor oration   O en the My Build String VI that you created in the revious exercise. and so on). and an y text that se arates the arguments.               . out ut string. you can s ecify the form at of arguments. With format strings. octal. base (hex. Using Format Strings OBJECTIVE You will use the My Build String VI that you created in the revious e xercise to create a format string. Front Panel 1. Run the VI.Cha ter 6 Strings and File I/O 2. including the field width. You will use this VI in the next exercise. 3.

The following dialog box a ears. © National Instruments Cor oration 6-5 LabVIEW Tutorial Manual              . in the o rder that you wired them. Note: You can also double-click on the node to access the Edit Format String dialog bo x. Po u on Format Into String and select Edit Format String. Notice that the Current Format Sequence contains the argument ty es.Cha ter 6 Strings and File I/O Block Diagram 1.

4. Set the recision of the numeric to 4. Name it My Format S tring. Pressing this button automatically inserts the c orrect format string information and wires format string to the function.vi. The following illustration shows the selected o tions to set the recision of number. Return to the front anel and ty e text inside the two string controls and a number in side the digital control. 5. or <Enter> (HP-UX). Highlight the numeric beside the Use S eci fied Precision checkbox. c. ty e in 4. <Return> (Sun). and ress <Enter> (Windows). b. Save and close the VI. Highlight Format fractional number in the Current Format Sequence list box. Run the VI. Click in the Use S ecified Precision checkbox. 3. <return> (Macin tosh). a. Press the Create String button. LabVIEW Tutorial Manual 6-6 © National Instruments Cor oration                       .Cha ter 6 Strings and File I/O 2.

Also. In the following exercise. you used the string functions to create a lo ng string from numbers and smaller strings. You will take a sub set of a string that contains the string re resentation of a number and convert it to a numeric value. or you can show the block diagram to see how to arse the com onents out of the in ut string. you will examine a VI that arses information out of a longer string.vi from exam les\general\ strings. O en the Parse String. Front Panel 1. notice that the numeric art of the string was arsed out and convert ed to a number. Notice that the string subset of DC is chosen for the in ut str ing. are indexed starting with zero).llb. You can try different control values (remember that strings. lik e arrays.Cha ter 6 Strings and File I/O More String Functions OBJECTIVE In the revious exercise. © National Instruments Cor oration 6-7 LabVIEW Tutorial Manual                             . Run the VI with the default in uts.

Scan From String makes conversions according to the format. E. The first charact er offset is zero. shown in the on. +.             receding illustrati   . If yo u do not wire format string. String Subset function (Functions»String) returns the substring beginning at offset and contains length number of characters.Cha ter 6 Strings and File I/O Block Diagram 1. If you wire a format string. and eriod) to numbers. -. Scan From String makes default conversions for each default in ut terminal in the function. e. such as when you convert a data string received from an instrument into the data valu es. In many instances. The first character offset is zero. This function starts scanning the strin g at offset. you must convert strings to numbers. Scan From String function (Functions»String) scans a string and converts valid . LabVIEW uses the String Subset and From Ex onential/Fract/Eng functions to arse the in ut string. LabVIEW Tutorial Manual 6-8 © National Instruments Cor oration     O en the block diagram of the Parse String VI. numeric characters (0 to 9.

Do not save the VI. • This section discusses ASCII byte stream files because that is the most common d ata file format. File I/O The LabVIEW file I/O functions (Functions»File I/O) are a owerful and flexible se t of tools for working with files. Da talog les are similar to database les because you can store several different data ty es into one (log) record of a le. se e exam les\file. • Datalog les. you must convert all data to ASCII str ings. These les are the most c om act and fastest method of storing data. • ASCII Byte Stream. You can store or retrieve data from files in three different fo rmats. You must convert the data to binary s tring format and you must know exactly what data ty es you are using to save and retrieve the data to and from les. © National Instruments Cor oration 6-9 LabVIEW Tutorial Manual                                         . You should store data in ASCII format when you want to access it from another software ackage. or when the string contains only valid numeric character s. the LabVIEW file I/O functions move and rename files and directories. such as a word rocessing or s readshe et rogram. To store data in this manner. Binary Byte Stream. 2.Cha ter 6 Strings and File I/O The Scan From String function is useful when you know the header length (VOLTS D C in the exam le here). and write data in binary form for s eed and com actness. See the Additional To ics section at the end of this cha ter fo r more information on the other two ty es of files. Close the VI by selecting File»Close. In addition to reading and writing data. These les are in binary format that only LabVIEW can access. create s reads heet-ty e files of readable ASCII text. For exam les of file I/O.

The Write To S readsheet File VI conver ts a 1D or 2D array of single. These utility functions are built u on intermediate-level VIs that incor orate error checking and handling with the fil e I/O functions. For additional File I/O functions. This section d escribes the nine. LabVIEW Tutorial Manual 6-10 © National Instruments Cor oration                                                                           . commas. This VI o ens the file beforehand and close s it afterwards. The Read From S readsheet File VI reads a s ecified nu mber of lines or rows from a numeric text file.Cha ter 6 Strings and File I/O File I/O Functions Most file I/O o erations involve three basic ste s: o ening an existing file or creating a new file. and closing the file. The Read Lines From File VI reads a s ecified number of lines from a byte stream file beginning at a s ecified character offset. such as t abs. You can also set a delimiter or string of delimiters. You can use this VI to read s readsheet files saved in text for mat. LabVIEW contains many utility VIs in Functions»File I/O. You can o tionally trans ose the array. This saves you from arsing your s readsheet if you used a delimiter other than the default tab to set u the s rea dsheet. Therefore. and converts the data to a 2D. You can use this VI to create text files readable by m ost s readsheet rograms. beginning at a s ecified charact er offset. single. This VI o ens or creates the file beforehand and closes it afterwards.recision numbers to a text string and writes the string to a new byte stream file or a ends the string to an existing file. and so on. This VI o ens the file beforehand and closes it afterwards. This VI o ens the f ile beforehand and closes it afterwards. and then closes the file. writes the data. high-level utilities. in your s readsheet. writing to or reading from the file. You can o tionally trans ose the data. The Read Characters From Fi le VI reads a s ecified number of characters from a byte stream file beginning a t a s ecified character offset. This VI o ens or creates the file.recision array of numbers. The Write Characters To File VI writes a character string to a new byte stream file or a ends the string to an existing file. select Function»File I/O»Binary File VIs or Function»File I/O»Advanced File Functions.

Later you can access this file from a s reads heet a lication. as shown in the following figure. tabs se arate c olumns and EOL (End of Line) characters se arate rows.Cha ter 6 Strings and File I/O Writing to a S readsheet File One very common a lication for saving data to a file is to format the text file so that you can o en it in a s readsheet. OBJECTIVE You will modify an existing VI to use a file I/O function so that you can save d ata to a new file in ASCII format. In most s readsheets. Tab Line Se arator O ening the file using a s readsheet rogram yields the following table. © National Instruments Cor oration 6-11 LabVIEW Tutorial Manual                                 .

Cha ter 6 Strings and File I/O Front Panel 1. O en the My Gra h Waveform Arrays.vi you built in Cha ter 4 of this tutorial. As you recall, this VI generates two data arrays and lots them on a gra h. You mo dify this VI to write the two arrays to a file where each column contains a data array. Block Diagram 2. O en the block diagram of My Gra h Waveform Arrays and modify the VI by adding t he block diagram functions that have been laced inside the oval, as shown in th e receding illustration. 6-12 © National Instruments Cor oration LabVIEW Tutorial Manual

 

 

 

 

 

 

 

 

 

   

Cha ter 6 Strings and File I/O The Write To S readsheet File VI (Functions»File I/O) converts the two-dimensional array to a s readsheet string and writes it to a file. If you have not s ecifie d a ath name, then a file dialog box o s u and rom ts you for a file name. T he Write To S readsheet File writes either a 1-dimensional or 2-dimensional arra y to file. Because you have a 2D array of data in this exam le, you do not have to wire to the 1D in ut. With this VI, you can use a s readsheet delimiter or st ring of delimiters, such as tabs or commas in your data. Boolean Constant (Funct ions»Boolean) controls whether or not LabVIEW trans oses the 2D array before writi ng it to file. To change the value to TRUE click on the constant with the O erat ing tool. In this case, you want the data trans osed because the data arrays are row s ecific (each row of the two-dimensional array is a data array). Because e ach column of the s readsheet file contains a data array, the 2D array must firs t be trans osed. 3. Return to the front anel and run the VI. After the data arr ays have been generated, a file dialog box rom ts you for the file name of the new file you are creating. Ty e in a file name and click on OK. Caution: Do not attem t to write data in VI libraries, such as the mywork.llb. Doing so m ay result in overwriting your library and losing your revious work. 4. 5. Save the VI, name it My Waveform Arrays to File.vi, and close the VI. You now can use s readsheet software or a text editor to o en and view the file you just create d. You should see two columns of 100 elements. In this exam le, the data was not converted or written to file until the entire data arrays had been collected. If you are acquiring large buffers of data or wo uld like to write the data values to disk as they are being generated, then you must use a different File I/O VI. © National Instruments Cor oration 6-13 LabVIEW Tutorial Manual

 

 

 

 

 

 

 

 

 

 

 

 

 

   

 

 

 

 

 

   

 

 

 

 

 

 

 

 

Cha ter 6 Strings and File I/O A ending Data to a File OBJECTIVE You will create a VI to a end tem erature data to a file in ASCII for mat. This VI uses a For Loo to generate tem erature values and store them in a file. During each iteration, you will convert the data to a string, add a comma as a delimiting character, and a end the string to a file. Front Panel 1.

The front anel contains a digital control and a waveform chart. Select Show»Digit al Dis lay. The # of oints control s ecifies how many tem erature values to acq uire and write to file. The chart dis lays the tem erature curve. Rescale the y axis of the chart for the range 70.0 to 90.0, and rescale the x axis for the ran ge 0 to 20. 2. Po u on the # of oints digital control and choose Re resentati on»Long. LabVIEW Tutorial Manual 6-14 © National Instruments Cor oration

 

 

 

 

   

 

 

O en a new front anel and ion.

lace the objects as shown in the receding illustrat

   

  

  

 

 

 

   

 

 

 

 

    

Cha ter 6 Strings and File I/O Block Diagram 1. 2. 3. 4. O en the block diagram. Add the For Loo and enlarge it. This VI generates the n umber of tem erature values s ecified by the # of Points control. Add a Shift Re gister to the loo by o ing u on the loo border. This shift register contain s the ath name to the file. Finish wiring the objects. Em ty Path constant (Functions»File I\O»File Constants). The Em ty Path function ini tializes the shift register so that the first time you try to write a value to f ile, the ath is em ty. A file dialog box rom ts you to enter a file name. The My Thermometer VI you built in Cha ter 2 (Functions»Select a VI...) or the Digital Thermometer VI (Functions»Tutorial) returns a simulated tem erature measurement f rom a tem erature sensor. Format Into String function (Functions»String) converts the tem erature measurement (a number) to a string and concatenates the comma th at follows it. © National Instruments Cor oration 6-15 LabVIEW Tutorial Manual

 

 

 

 

 

 

 

 

 

 

    

 

 

 

 

 

 

 

 

 

 

Cha ter 6 Strings and File I/O String constant (Functions»String). This format string s ecifies that you want to convert a number to a fractional format string and follow the string with a comm a. The Write Characters To File VI (Functions»File I/O) writes a string of charact ers to a file. Boolean Constant (Functions»Boolean) sets the a end to file? in ut of the Write Characters To File VI to True so that the new tem erature values a re a ended to the selected file as the loo iterates. Click the O erating tool on the constant to set its value to True. 5. Return to the front anel and run t he VI with the # of oints set to 20. A file dialog box rom ts you for a file n ame. When you enter a file name, the VI starts writing the tem erature values to that file as each oint is generated. Save the VI, name it My Write Tem erature to File.vi, and close the VI. Use any word rocessing software such as Write fo r Windows, Teach Text for Macintosh, and Text Editor in O en Windows for UNIX to o en that data file and observe the contents. You should get a file containing twenty data values (with a recision of six laces after the decimal oint) se a rated by commas. 6. 7. Reading Data from a File OBJECTIVE You will create a VI that reads the data file you wrote in the reviou s exam le and dis lays the data on a waveform gra h. You must read the data in t he same data format in which you saved it. Therefore, since you originally saved the data in ASCII format using string data ty es, you must read it in as string data with one of the file I/O VIs. LabVIEW Tutorial Manual 6-16 © National Instruments Cor oration

 

 

 

 

 

 

 

    

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  

 

 

The front anel contains a string indicator and a waveform gra h.Cha ter 6 Strings and File I/O Front Panel 1. © National Instruments Cor oration 6-17 LabVIEW Tutorial Manual             O en a new front anel and build the front tion. The String Rea d from File indicator dis lays the comma delimited tem erature data from the fil e you wrote in the last exam le. Build the block diagram as shown in the receding illustration. The gra h dis lays the tem erature curve.                 anel shown in the receding illustra   . Block Diagram 1.

Cha ter 6 Strings and File I/O The Read Characters From File VI (Functions»File I/O) reads the data from the file and out uts the information in a string. C). followed by colon-se arated folder names. 2. LabVIEW Tutorial Manual 6-18 © National Instruments Cor oration                                                                    . You must know how the data was stored in a fil e in order to read the data back out. a file d ialog box rom ts you to enter a file name. you can us e the Read Characters From File VI to determine the known number of characters t o read. An exam le is HardDrive:DataFolder:Test1 for a file named Test1 in the folder DataF older on the HardDrive. and close the VI. At this oint. (Macintosh) A athname consists of the drive name.llb) takes an ASCII str ing containing numbers se arated by commas. followed by a colon. An exam le is C:\DATADIR\TEST1 for a file named TEST1 in the directory DATADIR on the C drive. Select the data file you just wrote to disk when the file dialog box rom ts you.vi. In this exam le. S ecifying a File There are two ways to s ecify a file— rogrammatically or through a dialog box. you do not need to determine the number of characters to read because there are fewer characters in the file than the default (512). Using the File I/O Functions Sometimes the file I/O functions do not rovide the functionality you may need f or saving data to disk. followed by a colon. If you know how long a file is. Save the VI. 3. The Extract Numbers VI (exam les\general\strings. You should see the same data values dis layed in the gra h as you saw in the My Write Tem erature to File VI exam le. Return to the front anel and run the VI. line feeds. or other non-numeric cha racters and converts them to an array of numerics. you must use the functions from Functions»F ile I/O»Advanced. you su ly the filename and the athname for the VI. If no ath name is s ecified. (Windows) A athname consists of the drive name (for exam le. followed by backslash-se arated directory names. followed by the filename . In the rogrammatic method. followed by the filename. name it My Tem erature from File.

The File I/O functions do not contain any error checking or handling and merely return an error value. the new refnum may be different fro m the refnum that LabVIEW used reviously. LabVIEW remembers information for each refnum. when you build a lications that use low-level functions. Therefore. (All Platforms) Using the dialog box method. All o erations erformed on o en files use the file r efnums to identify each file. If you subsequently o en the file. Paths and Refnums A ath consists of a LabVIEW data ty e that identifies files. A refnum consists of a LabVIEW data ty e that identifies o en files. If you o en a file multi le times.Cha ter 6 Strings and File I/O (UNIX) A athname consists of slash-se arated directory names followed by the fi lename. © National Instruments Cor oration 6-19 LabVIEW Tutorial Manual                                                                                      . If you close the file. An exam le is /usr/datadirectory/ test1 for a file named test1 in the di rectory /usr/ datadirectory. such as the curre nt location for reading from the file and the degree of access to the file that other users are ermitted. When you o en a file. A refnum is only valid for the eriod during which the file is o en. LabVIEW disassociates the refnum with the file. You can enter or d is lay a file ath using the standard syntax for a given latform with the ath control and ath indicator. the ath control and indicator works l ike a string control or indicator. LabVIEW returns a refnum associated with the file. each o en file o erat ion returns a different refnum. the Fi le Dialog function dis lays a dialog box that you can use to interactively searc h for a directory and then ty e in a filename. In many ways. In addition to associating an o erati on with a file. you must write your own error checki ng and handling to avoid any roblems that may occur. exce t that LabVIEW formats the ath a ro ri ately for any latform su orted by LabVIEW. so that you can have concurrent but inde endent o era tions on a single file.

when you read from a fi le. The Read from Text File VI (in exam les\file\sm lfile. Remember that you can use strings or other data ty es in file in ut and out ut o erations. When writing to a file. and close the file.llb) writes an ASCII text file that contains data values with time-stam s. you can use the intermediate-level utility VIs or the File I/O functions. Similarly. Summary A string is a collection of ASCII characters. The binary file is faster and m ore com act. LabVIEW Tutorial Manual 6-20 © National Instruments Cor oration                                                           . LabVIEW can erform file o erations. the file I/O VIs combine these ste s into a single subVI. read the data. Do not forget to use error checking and handling when writing data to or rea ding data from files. String controls and indicators are located in Controls»String & Table. LabVIEW contains many functions for mani ulat ing strings. For greater flexibility. You can save time and effort by monitoring the error out u t values from the File I/O functions. For common fil e I/O o erations. If the VI writes string data. you create a new file (or o en an exist ing one). write the data. while other forms of data roduce a binary file.Cha ter 6 Strings and File I/O File I/O Exam les You can use the following exam les to see how to use the File I/O functions com lete with ro er error checking and handling techniques: The Write to Text File VI (in exam les\file\sm lfile. while the ASCII file is com atible with other rograms and readable as text. it forms an ASCII file. See the following discussion on how to create and read binary data fil es. These functions are located in Functions»String. you o en an existing file.l lb) reads an ASCII text file that contains data values with time-stam s. and close the file.

arbitrary data ty e. A datalog file stores data as a sequence of records of a single.llb) reads a datalog file created by the Write to Datalog File exam le one record at a time. © National Instruments Cor oration 6-21 LabVIEW Tutorial Manual                                                           . you may not want to write da ta to ASCII files. T he Write to Datalog File VI (in exam les\file\datalog. such as a s reads heet rogram. If yo u are going to retrieve the data with a LabVIEW VI. To read a d atalog file.llb) creates a new datalog file and writes the s ecified number of records to the file. It als o sim lifies data retrieval. This a roach is common when creating files that other software ackages read. LabVIEW indexes data in a datalog file in terms of these records. called a datalog file. LabVIEW has another file format. making writing and reading much faster. For instance. If you do no t need to have the data stored in a format that other a lications can read. because you can read the original blocks of data ba ck as a log or record without having to know how many bytes of data the records contain. a number. that ty e can be com lex. While all the records in a datalog file must be of a single ty e. you must match the data ty e that was used to write to the file.Cha ter 6 Strings and File I/O Additional To ics Datalog Files The exam les shown in this cha ter illustrate sim le methods for dealing with fi les that contain data stored as a sequence of ASCII characters. converting a two-dimensional array to a string in a s readsh eet format with headers and time-stam s is a com licated o eration. Th e Read from Datalog File VI (in exam les\ file\datalog. because converting data to and from strings can be time consu ming. you may want to write data out as a datalog file. The record r ead consists of a cluster containing a string and an array of single recision n umbers. In this form. LabVIEW records the amount of data for each record of a datalog file. whic h you determine when you create the file. you can set each record so that the record contains a cluster with a string. For instance. and an array. writing data to a f ile requires little mani ulation. Each record is a c luster containing a string and an array of single recision numbers.

Error I/O in File I/O Functions File I/O functions also contain error I/O clusters. Read From I16 File. see Online Reference»Function and VI Reference»Error I/O in File I/O Functions. before writing an array of numeric data to a file. For more informatio n on error I/O. which consist of error in an d error out to check for errors. The B inary vs ASCII exam le in exam les\general\ strings. For in stance. and you want to retrieve the data in its original format. Refer to the file I/O Write To I16 Fil e. However. When an error occurs in a function. If the file contains a number of different com onents of data written i n binary format. Write To SGL File. With error I/O clusters you can string together several functions. the header informatio n tells you how much data you need to reconstruct the original com onents.llb shows the difference bet ween a binary string and an ASCII string. LabVIEW Tutorial Manual 6-22 © National Instruments Cor oration                       . this method is ty ically more com lica ted because you must carefully design the file format and reconstruct the origin al data. and Read From SGL File (Functions»File I /O»Binary File VIs) for exam les of writing to and reading from binary byte stream files. that function does not e xecute and then asses the error along to the next function.Cha ter 6 Strings and File I/O Binary Byte Stream Files Writing data to binary byte stream files can be faster and can use less disk s a ce than ASCII byte stream files. embed header information in the file that describes the structure of the data.

. © National Instruments Cor oration 7-1 LabVIEW Tutorial Manual                                       .. o tion..llb. o tion.. How to use the SubVI Node Setu . see exam les\general\ vio ts... 7 For exam les of custom VIs. Ho w to make custom controls and indicators. You access these o tions by o ing u on the icon ane in the u er right corner of the front anel and choosing VI Setu . VI Setu There are several ways you can set your VIs to execute..Cha ter Customizing VIs You Will Learn: • • • How to use the VI Setu .

click on the downward ointing arrow in th e menu bar. To switch from Execution O tions to Window O tions. Creating Po -U Panels and Setting Window Features. of the LabVIEW User Manual.Cha ter 7 Customizing VIs As the following illustration shows. a VI Setu dialog box a ears showing all s etu o tions. Setting Window O tions The Window O tions control the a earance of the VI when running. LabVIEW Tutorial Manual 7-2 © National Instruments Cor oration                                   .These o tions are described in detail in Cha ter 6.

Cha ter 7 Customizing VIs SubVI Node Setu There are several setu o tions on a subVI that you can modify. When the VI starts. © National Instruments Cor oration 7-3 LabVIEW Tutorial Manual                                                                           . You then will use this VI as a subVI in the block diagram of the main VI. the o tion a lies only to that articular node. If you select an o tion from the SubVI Node Se tu dialog box.. First. These o tions ar e available by o ing u on the subVI icon (in the block diagram of the calling VI).. Note: If you select an o tion from the VI Setu ... a subVI o ens a front anel and rom ts the user to enter a name and to verify the date and time. you must build a VI that o s o en its front anel. and choosing SubVI Node Setu .. and waits until the user clicks on a Boolean button. rom ts the user for information. The following illustration shows the Sub VI Node Setu dialog box. Using Setu O tions for a SubVI OBJECTIVE You will build a VI that simulates a testing a lication. The front anel remains o en until the user clicks on Continue. the o tion a l ies to every instance of that VI. dialog box of a VI.

Not function (Functions»Boolean). Block Diagram 1.) LabVIEW Tutorial Manual 7-4 © National Instruments Cor oration         O en a new front anel and build the front tion. (The default state of the button is FALSE. Build the block diagram shown in the receding illustration.         anel shown in the receding illustra   . In this exercise. the Not function inverts the v alue of the Continue button so that the While Loo executes re eatedly until you click on the Continue button.Cha ter 7 Customizing VIs Front Panel 1.

Build the con nector. 3. To access the Icon Editor. 4. return to the icon dis lay. and Time Answer indicators to the three connectors o n the right side of the icon.vi. o u o n the icon ane of the front anel and select Edit Icon. 5. © National Instruments Cor oration 7-5 LabVIEW Tutorial Manual                                                      . notice that the default connector ane is not what you see illustrated to the left.Cha ter 7 Customizing VIs 2. Date Answer. Switch to the connector ane by o ing u on the icon ane and selecting Show Connector. Choose the attern with two in uts and three out uts. Then choose Fli Horizontal. Create the icon for the VI as shown at left. To get the correct connector ane. Now you can connect the D ate and Time Controls to the two connectors on the left side of the icon. as illustrated by the following Hel window. cho ose Patterns from the o -u menu on the connector. When you build the connector. and th e Name Answer. Now you can customize the VI with the VI setu o tions to make it look like a dialog box. Save the VI as My Get O erator Info. After you create the connector.

6.Cha ter 7 Customizing VIs Configure the Execution O tions as shown in the revious illustration. Then chan ge to Window O tions and configure it as shown in the following illustration. After you finish with the VI Setu o tions. 7. You will use this VI as a subVI soon. resize the front anel as shown in t he following illustration so you do not see the three string indicators. Save the VI and close the VI. LabVIEW Tutorial Manual 7-6 © National Instruments Cor oration                 .

4. O en a new front anel. © National Instruments Cor oration 7-7 LabVIEW Tutorial Manual                                . so that its u er limit is set to 90. Place a Waveform Chart (Controls»Gra h) on the front anel and label it Tem erature Data.0 and its lower limit is set to 70. 3. Modify the scale of the chart. 2. 5.Cha ter 7 Customizing VIs Front Panel 1. The chart dis lays the tem erature as it is acquired. Po u on the rectangular st o button and select Mechanical Action»Latch When Released. Build the rest of the front anel as shown in the receding illustration.0.

Po u on the Sequence structure and select Add Frame After from the o -u menu. 7. The Get O erator Info VI (Functions»Select a VI. Build the block diagram as shown in the receding illustration. click on the constant with the O erating tool. To set this o tion to True. Add a Sequence s tructure and add the following to frame 0. Boolean c onstant (Functions»Boolean) controls whether the in ut date and time string are tr ue.. and the time. The Get Date/Time String function (Functions»Time & Dialog) out uts the current da te and time.. 8 . the date. LabVIEW Tutorial Manual 7-8 © National Instruments Cor oration                                         . 9.) o s o en its fro nt anel and rom ts the user to enter a name. Place a While Loo inside frame 1 of the Sequence structure.Cha ter 7 Customizing VIs Block Diagram 6.

vi. the date. 11. Returns one tem erature measureme nt from a simulated tem erature sensor or the My Thermometer VI (Functions»Select a VI…) you built in Cha ter 2. Name it My Po -u P anel Demo. Run the VI. Save the VI. dialog box. Add the objects shown in the following illustration to frame 1. 12. Numeric constant (Functions»Numeri c).5 seconds). and the time. The Digital Thermometer VI (Functions»Tutorial). Do not try to o en the front anel of the subVI from the block diagram of the My Po -u Panel Demo VI. The nume ric constant delays execution of the loo for 500 ms (0.. Wait Until Next ms Multi le function (Functions»Time & Dialog) causes the For Loo to execute in ms. Click on the Continu e button to return to the calling VI. You can also o u on the Wait Until Next Tick Multi le function and select Create Constant to automatically create and wire the numeric constant. Not function (Functions»Boolean) inverts the value of the Sto button so that the While Loo e xecutes re eatedly until you click on Sto . Close all windows. 13.Cha ter 7 Customizing VIs 10. Then tem erature data is acquired until yo u click on the STOP button. The front anel of the Get O erator Info VI o ens and rom ts you to enter your name.. Note: The front anel of the Get O erator Info VI o ens because of the o tions you selected from the VI Setu . © National Instruments Cor oration 7-9 LabVIEW Tutorial Manual                                                                   .

You can load an exam le of this control by o ing u in a fr ont anel.. or you close the window and select YES to the rom t concerning re lacing the original control.. LabVIEW Tutorial Manual 7-10 © National Instruments Cor oration                                                     . so that you can use it in other LabVIEW VIs. you can customize the control by coloring it. you can save it as a custom control by selecting File»Save. If you want to use the control in other VIs. select a control with the Positioning tool and then choose Edit»Edit Control..Cha ter 7 Customizing VIs Custom Controls and Indicators LabVIEW has a Control Editor that you can use to customize a front anel control . After yo u save the control. selecting the Controls»Select a Control. For exam le. o tion. Now. adding new elements to clusters. and o ening exam les \general\controls\ custom. changing its size. and so on.llb\box on belt. To invoke the Control Editor. assume you have a horizontal slide control and you want to make the slider look like a box and the housing look lik e a conveyor belt. You can also use the Control Editor to save a customized control.. When you edit a contr ol. These changes do not affect the original VI un til you select File»A ly Changes. you can lace it on other front anels using the Controls»Sele ct a Control.. a new window o ens with a co y of the control. You can also im ort ictures from draw or aint rograms into arts of a control or indicator.

Im ort the icture into the LabVIEW cli bo ard by selecting File»Im ort Picture. 5. Click on the wrench. In LabVIEW. 3...Cha ter 7 Customizing VIs 1. shown at left . 4. select the sim le horiz ontal slide from Controls»Numeric. © National Instruments Cor oration 7-11 LabVIEW Tutorial Manual                                . Use the Positioning tool to select the slide. (Windows and Macintosh) Use a gra hics rogram to draw a box and then im ort that image into LabVIEW through the cli board. The following Editing window a ears. 2. in the Editing window toolbar. Highlight the slide with the Positioning tool a nd select Edit»Edit Control.. (UNIX) Use a gra hics rogram to draw a box and then save the image as an xwd (X Window Dum ) file.

The box should re lace the slide as in the following exam le. See ste 1 for information on im orting a icture to the cli board.Cha ter 7 Customizing VIs 6. see Cha ter 23. Po u on the slider in the horizontal slide and choose Im ort Picture to aste the icture onto the slider. The icture must be on LabVIEW’s cli board to erform this ste . Custom Controls and Ty e Definitions. Return to th e Editing window and re eat ste s three through five. For exam les of custom controls. LabVIEW Tutorial Manual 7-12 © National Instruments Cor oration                                                   . For more information regarding the Control Editor. 7. see exam les\general\ contro l. You can save this slide for use in other VIs. The horizontal slide shoul d now look like the slide shown in the following illustration. Now draw the conveyor belt and im ort it into LabVIEW as in ste 1. in the La bVIEW User Manual.

you may want a control that behaves as both a control and an indicator. In some cas es. running the VI when loaded. Other nodes of the same VI are not affected. That is what the revious exam le did with the date and time strings. you can modify VI execution characteristics.Cha ter 7 Customizing VIs Summary With setu o tions. o ening fro nt anels when called. The My Po -U Panel VI served t his ur ose. Additional To ics Simulating a Control/Indicator In LabVIEW a front anel object is either a control or an indicator. You can modify o tions in two ways: using the VI Setu dialog box or using the SubVI Node Setu dialog box. You wanted to dis lay the current date and time. © National Instruments Cor oration 7-13 LabVIEW Tutorial Manual                                                                       . These modificat ions include hiding the toolbar buttons. Any execution char acteristic of a VI modified using the VI Setu dialog box affects every executio n of that VI as a main VI or as a subVI. and so on. In this case. The VI Setu dialog box also features o tions to hide the toolbar buttons. That way the user could modify the value and ass it out through an indicator and into the front anel. You can even im ort custom ictures into controls using the Control Editor. or building VIs for more com lex test systems. a control and an indicator are needed–an indicat or so that the block diagram can set the date and time. These o tions are useful when building VIs that oth er users o erate. You can design your own controls or indicators by using the Control Editor. Any execution characteristic of a VI mo dified using the SubVI Node Setu dialog box affects only that node. but sometimes the internal clock of the com u ter is not correct. and a control so that yo u can modify those values if they are incorrect. The indicator from the main rogram became the control for the o u front anel.

see the Ty e Definitions section in Cha t er 23. ocal Variables. variable. in the LabVIEW User Manual. in Cha ter 22. For more information on ty e definitions. see exam les\general\locals. because you can change a saved control in one VI and it automatically u dates in other VIs. The Control Editor is useful in large a lications. in the LabVIEW User Manual.Cha ter 7 Customizing VIs Another way you can make a control/indicator air is to use a local local variable acts as a multi le terminal to a front anel control . A or indicator les of how t information Global and L Using the Control Editor You can choose to save a custom control as a ty e definition or as a strict ty e definition. To see exam o use local variables. see the Local Variables section.llb. You can both read from and write to a local variable. Custom Controls and Ty e Definitions. For further on local variables. LabVIEW Tutorial Manual 7-14 © National Instruments Cor oration                                  .

Using LabVIEW to Acquire Data One of the most valuable features of LabVIEW is its ability to acquire data from almost any source. Macintosh. This tutorial concentrates on basic LabVIEW features and functions. About GPIB functions. Macintosh. How to use a frequency res onse test VI. and Sun). About using a serial ort to communicate with other serial orts. in the LabVIEW Analysis VI Reference Manual. About serial ort communic ation. Macintosh. What an instrument driver is.Data Acquisition and Instrument Control You Will Learn: • • • • • • • • Cha ter 8 About acquiring data with a lug-in data acquisition board (Windows. About u sing VXI for data acquisition (Windows. LabVIEW contains VIs for controlling the following: • • • • Plug-in data acquisition boards (Windows. © National Instruments Cor oration 8-1 LabVIEW Tutorial Manual                       . and Sun) These VIs use the National Instruments industry-standard driver-level software t o deliver com lete control of your data acquisition and instrument control hardw are. and Sun). Macintosh. and Sun) GPIB (IEEE 488) instrument s Serial ort instruments VXI instruments (Windows. About VISA functions. see Cha ter 1. Introduction to Analysis in LabVIEW. To lear n more about LabVIEW data analysis ca abilities.

Hard ware Ca abilities in LabVIEW. You can use front-end SCXI signal conditioning multi lexers to cost-effectively increase the number of analog in ut channels. These boards have various combinations of analog. erfo rm the instrument I/O activities in a generic manner. you can construct a single instrument dr iver VI. Installing and Configu ring Your Data Acquisition Hardware. For a descri tion o f the DAQ boards associated with various ty es of hardware. VXI. which outlines the rocedure for installing LabVIEW and configuring your sys tem. the VISA functions. and other ty es of instruments. digital. A string is assed to the VISA O en function in order to select which ty e of I/O to use to communicate with the instrument. resistance tem eratur e detectors (RTDs). About VISA VISA is a single interface library for controlling GPIB. and Sun) National Instruments manufactures all the com onents you need to build com lete data acquisition systems. and SPARCstatio n SBus com uters. To learn more about the LabVIEW DAQ library. see Cha ter 2. see exam les\daq. The LabVIEW Data Acquisition Basics Manual also includes information to hel you start building a data acquisition system with LabVIEW. and high current digital in uts and out uts com lete the acquisition hardware line. Using the VISA functions. IBM PS/2MicroChannel. Plug-in boards are available for the IBM PC/AT. The LabVIEW data acquisition (DAQ) VIs control all of the National Instruments data acquisition hardware. Thus. see A endix B. A wide variety of signal conditioning modules for thermocou les. Once the session with the instrument is o en. such as VISA Read and VISA Write. The LabVIEW Tutorial Manual 8-2 © National Instruments Cor oration                                                                    . EISA. the rogram is not t ied to any s ecific GPIB or VXI functions. and timing in uts and out uts. of the LabVIEW Data Acquisition VI Reference Manua l. Macintosh LC/LCII. Macintosh NuBus Series. which controls a articular instrument model across several different I /O media. Macintosh. of the LabVIEW Data Acquisition Basics Manu al. For exam les of DAQ VIs.Cha ter 8 Data Acquisition and Instrument Control About Plug-in Data Acquisition Boards (Windows. voltage and current in uts.

in Cha ter 1. This can o en more o ortunities for reusing the instrument driver with a number of rograms. National Instruments manufactures many roducts for controlling instruments wi th the GPIB. of the LabVIEW Instrument I/O VI Reference M anual.2 s ecifies and resemble the routines in National Instruments NI-488 . such as multimeters and oscillosco es .2 funct ions add IEEE 488. also called IEEE 488. Introduction. The GPIB 488.Cha ter 8 Data Acquisition and Instrument Control VISA instrument driver is considered to be interface inde endent and you can use in several different systems. These functions im lement calls th at IEEE 488. see exam les\instr. LabVIEW uses the National Instruments standard NI-488. is a method of c ommunicating with stand-alone instruments. © National Instruments Cor oration 8-3 LabVIEW Tutorial Manual                                          . The GPIB library (Functions»Instrument I/O) co ntains both traditional GPIB functions and 488. About GPIB The General Pur ose Interface Bus (GPIB).2 driver software t hat comes with your GPIB interface. is discussed in the GPIB Overview s ection. GPIB Instruments COM PUTER GPIB Interface GPIB Cable The LabVIEW GPIB functions control National Instruments GPIB interfaces.2 functions. For exam les of VISA functions. or IEEE 488. The most direct method is to install a lug-in GPIB board in your c om uter and connect your instrument directly to this board with a GPIB cable.2 com atibility to LabVIEW. A descr i tion and history of the GPIB.2 software. Instrument drivers that use the VISA functions. c a ture the activities s ecific to the instrument. not the communication medium.

ove r a single communication line to a receiver. you must also make certain that there are no in terru t conflicts. is that a serial ort can communicat e with only one device. LabVIE W contains five VIs for serial communication–Serial Port Init. This method of communication is com mon when transferring data at low rates or over long distances. or a rogrammable instrume nt. Serial Port Read. These functions a re described in Cha ter 8. Serial communication uses a transmitter to send data. you are now ready t o use the LabVIEW serial ort VIs located in Functions»Instrument I/O»Serial. A l imitation of serial communication. Note: If ossible. LabVIEW Tutorial Manual 8-4 © National Instruments Cor oration                                                                     . you shoul d use the VISA function rather than GPIB because of VISAs versatility. About Serial Ports Serial communication is a o ular means of transmitting data between a com uter and a eri heral device such as a rinter. For Windows. one bit at a time. see exam les\instr\ sm lserl. se rial data can be transferred via modems. over standard tele hone lines. however. Bytes at Serial Port. To accommodate several devices. Serial Port Write. Once you have established communication with an instrument. Serial c ommunication is o ular because most com uters have one or two serial orts. a lotter. and Serial Port Break. For exam les of serial ort VIs.llb . One way for Windows and Macintosh users to do this is to use a general terminal software rogram such as Microsoft Windows Terminal or ZTerm. see exam les\instr. Serial Port VIs of the LabVIEW Ins trument I/O VI Reference Manual. LabVIEW contains seria l ort VIs. you should first make certain that the instrument is connected correct ly to the com uter. Serial Port VIs. which are described in Cha ter 8. you must use a board wit h multi le serial orts or a serial ort multi lexer box. of the LabVIEW Instrument I/O VI Ref erence Manual. Before you begin using LabVIEW for serial commu nication.Cha ter 8 Data Acquisition and Instrument Control For exam les of GPIB functions. For instance.

you use the Serial Port Write VI to send the necessa ry commands to the instrument for the o eration you want it to erform. Usuall y.Cha ter 8 Data Acquisition and Instrument Control Using Serial Ports OBJECTIVE You will examine a serial ort exam le that you can use to communicate with any serial device. and other arameters necessary for serial communication. shown at left.vi in the ath exam les\ instr\sm lserl. Front Panel O en LabVIEW<->Serial. This VI sets the ort number to use. you use the Serial Port Read VI to actually acqu ire the data. Once you have the correct numb er of bytes at the serial ort. To read information from a serial instrument. first run the Bytes at Serial Port VI. you use this VI in a loo to wait for a s ecified number of bytes to accumula te in the buffer before you read the information. You will notice that serial communication is very simil ar to GPIB communication and frequently involves only writing and reading ASCII strings to and from a device. © National Instruments Cor oration 8-5 LabVIEW Tutorial Manual                                       . The general rocedure to follow for serial ort communication with LabVIEW starts with the Se rial Port Init VI. Next. Thi s VI checks how many bytes of information are waiting at the serial ort.llb. the baud rate. the number of data bits and sto bits.

LabVIEW Tutorial Manual 8-6 © National Instruments Cor oration                       . and observe the functions used to communicate via seria l ort in the method described reviously. s to bits. buffer size.Cha ter 8 Data Acquisition and Instrument Control Block Diagram 1. Serial Port Init function (Functions»Instrument I/O» Serial) initializes the selecte d serial ort to the s ecified settings for baud rate. Click on the arrows at the to of the structures to examine the entire block diagram. data bits. and arity. O en the block diagram of the LabVIEW<->Serial VI. some of which is shown in the receding illustration.

Cha ter 8 Data Acquisition and Instrument Control Serial Port Write function (Functions»Instrument I/O» Serial) writes a data string t o the indicated serial ort. see the LabVIEW Instrument I/O VI Reference Manual. About VXI for Windows. A serial command string usually consists of a grou of ASCII characters. and you can use multi le instrument sizes in the same mainframe . See th e discussion in the Additional To ics section. and identifies where it occurred. © National Instruments Cor oration 8-7 LabVIEW Tutorial Manual                                   .and low-level control of a VXI system. describes the error. VXI uses a ma inframe chassis with a maximum of thirteen slots to hold modular instruments on lug-in boards. You can control a VXI mainframe in several different ways. For more information on how to acquire data and control i nstruments with VXI. You may want to add a timeout to this loo in the case that the serial device n ever sends the requested number of bytes. You access these VIs from Func tions»Instrument I/O»VISA. A variety of instrument and mainframe sizes are available from n umerous vendors. Serial Port Read function (Functions»Ins trument I/O» Serial) reads the s ecified number of characters from the serial ort . for m ore information about error handling. at the end of this cha ter. and Sun The VXIbus is a fast-growing latform for instrumentation systems. Notice th at this VI waits in a loo until the requested number of bytes is in the buffer. LabVIEW has VXI VIs for high. Macintosh. Sim le Error Handler function (Functions»Time & Dialog) informs the user if an i n ut error exists. Bytes at Serial Port function (Functions»Instrument I/O» Seria l) returns the number of bytes in the in ut buffer of the serial ort.

LabVIEW is ideally suited for creating instrument drivers. f or a message-based instrument all drivers build a command string and send it to the instrument to erform the o eration that the simulated front anel s ecifies . When you finish building an instrument driver. A LabVIEW front anel can sim ulate the o eration of a front anel of an instrument. see Cha ter 3. of the LabVIEW Instrument I/O VI Reference Manual. you no longer need to remember the commands necessary to control the instrument. LabVIEW has a library of over 500 instrument drivers for GPIB. For more informa tion about instrument drivers. The command string consists of device-s ecific commands (usually in ASCII) tha t remotely control the instrument. CAMAC. it is im ossible to demonstr ate the techniques for creating drivers for all ty es of instruments. Bec ause there are many different ty es of instruments. The real value is that you can use the in strument driver as a subVI in conjunction with other subVIs in a larger VI to co ntrol an entire system. Develo ing a LabVIEW Instrument Dr iver. and Sun) instruments. however. Rather.Cha ter 8 Data Acquisition and Instrument Control About Instrument Drivers An instrument driver is software that controls a articular instrument. The block diagram can sen d the necessary commands to the instrument to erform the o eration the front a nel s ecifies. Macintosh. Therefore. There is little value in having a sof tware anel to control the instrument. LabVIEW Tutorial Manual 8-8 © National Instruments Cor oration                                                     . serial. instrument drivers contain more st ring mani ulation functions than s ecific interfacing commands. and VXI (for Windows. you need only s ecify the in ut on the front anel.

vi.llb. The front anel contains several controls for configuring the multimeter for dif ferent measurements. © National Instruments Cor oration 8-9 LabVIEW Tutorial Manual                            . Notice also that the E rror Out cluster describes any error that may have been generated by the VI duri ng execution. remembe r that the main com onent of an instrument driver is string mani ulation.Cha ter 8 Data Acquisition and Instrument Control Using Instrument Drivers OBJECTIVE You will examine the instrument driver for the Hewlett Packard 34401A Multimeter. located in labview\exam les\instr\h 34 401a. The VISA Session in ut identifies the device with which the VI communicates and asses all necessary configuration information required to erform I/O. You must run the HP34401A Initialize VI to establish communication with the instrument and to obtain the VISA Session value. Although this instrument driver is written for GPIB control. Front Panel 1. O en the HP34401A A lication Exam le.

Cha ter 8 Data Acquisition and Instrument Control Block Diagram 1. All the VIs were created in LabVIEW.vi. each VI should erform a s ecific task such as configuration. and the HP34401A Read Measurement subVI. or read ing a measurement. the HP34401A Config Trigger subVI. The ins trument drivers for LabVIEW consist of several VIs that you can use to control t he instrument and an exam le that shows how to use those VIs. Ty ically. triggering setu . LabVIEW Tutorial Manual 8-10 © National Instruments Cor oration                           . The block diagram calls three subVIs: the HP34401A Config Measurement subVI. so you can modify the co de for your a lication to combine several tasks or to take out some functionali ty for increased erformance. O en the block diagram of the HP34401A A lication Exam le.

Switch to the block diagram. Notice that the instrument driver mainly consists of string mani ulation functio ns for building the command strings for the instrument. O en the HP34401A Config Trigger subVI by double-clicking on it. and examine how the instrument driver was written. 3.Cha ter 8 Data Acquisition and Instrument Control 2. which sends the command string to GPIB or VXI message-based instruments. This exam le uses VISA W rite. © National Instruments Cor oration 8-11 LabVIEW Tutorial Manual           . T he following functions are commonly used to write instrument drivers.

False String True String String Out ut String DISPLAY ON OFF ON DISPLAY_ Selector Match Pattern function (Functions»String) searches a string for a s ecified ex res sion and returns the matched string. Notice that Line I ndex 1 chooses the second line. the function se lected the string VOLTS DC and a ended it to the string SET. see Cha ter 4. In the following exam le. in the LabVIEW Function Ref erence Manual. String Functions. for more informatio n on Match Pattern. the string before the match. _ re resen ts a s ace character _VOLTS AC Multi-line String _VOLTS DC _OHMS String SET 1 Ou t ut String SET VOLTS DC Line Index Select & A end function (Functions»String) chooses a string according to a Boolea n selector and a ends that string to the out ut string. the VI a ends the true string ON to the in ut string DISPLAY. In the following exam l e. and the string after the match. Match Pattern is a very owerful function. because the first line index is zero.Cha ter 8 Data Acquisition and Instrument Control Pick Line & A end function (Functions»String) chooses a line from a multiline str ing and a ends that line to a string. LabVIEW Tutorial Manual 8-12 © National Instruments Cor oration                                               .

instrument drivers like the one you examined in the last exam le are used for test and measurement a lications where several instruments are used. close the VI and do not save an y changes that you have made. © National Instruments Cor oration 8-13 LabVIEW Tutorial Manual                                            . If the instrument you ar e using does not have an instrument driver VI. OBJECTIVE You will use a VI that simulates using GPIB instruments to erform a frequency res onse test on a UUT as described in the receding aragra h. you can take an instrument driver that was written for a similar instrument or by the same instrument manufacture r and modify the command strings to match your articular instrument. Using a Frequency Res onse Test VI Ty ically. Y ou would then like to examine the resulting voltage res onse curve on an XY Gra h.Cha ter 8 Data Acquisition and Instrument Control 4. A large number of instrument drivers exist for LabVIEW. I magine an a lication that uses GPIB instruments to erform a frequency res onse test on a unit under test (UUT). When you finish examining the instrument driver. A function generator su lies a sinusoidal in ut to the UUT and a digital multimeter measures the out ut voltage of the UUT.

low frequency. LabVIEW Tutorial Manual 8-14 © National Instruments Cor oration                                . high frequency. The front anel contains several knobs for configuring the function generator. and an XY Gra h dis lays the frequency res onse lot.llb.Cha ter 8 Data Acquisition and Instrument Control Front Panel 1. and the number of frequ ency ste s to take. Y ou can set the am litude. located in exam les\ a s\freqres .vi. O en Frequency Res onse. A meter dis lays the current frequency of the function gener ator.

The loo executes N times s ecified by the Number Of Ste s knob. © National Instruments Cor oration 8-15 LabVIEW Tutorial Manual                                      . O en the block diagram of the Frequency Res onse VI. and Number Of Ste s knobs to calcul ate the ith frequency such that all N frequencies are equally s aced on a log ax is. It is built much like the Fluke 45 driver that you examined earlier. A Formula Node takes the values s e cified by the Low Frequency. High Frequency. the node asses th e frequency value and the value s ecified by the Am litude knob to a Sequence st ructure. The block diagram contains a For Loo at the highest level. Frame 1 contains the Demo Fluke8840A subVI. The driver default function (sine wave) and mode (continuous signal) are correct for this a lication and do not need to be changed. Frame 0 contains the Demo Tek FG 5010 subVI. The Demo Tek FG5010 subVI node needs only two in ut arameters: frequency and am litude. Once the Formula Node calculates the ith frequency value.Cha ter 8 Data Acquisition and Instrument Control Block Diagram 1.

O en the block diagram. an d examine how the instrument driver was written.eak voltage by multi lying it by the square root of 2. 3. Not ice that the front anel. Notice that it is almost identi cal to the instrument driver you examined before for the Fluke 45 multimeter.Cha ter 8 Data Acquisition and Instrument Control 2.20 log ( eak-to. art of which is shown in the following illustration. shown in the following illustration. 5. The DemoFluke8840A subVI returns an RMS voltage. was designed to l ook like the actual instrument.e ak voltage converts the UUT gain to dB). which is converted to a eak-to . O en the DemoFluke8840A VI by double-clicking on it with the O erating tool. When you finish examining the demo instrument driver. 4. LabVIEW Tutorial Manual 8-16 © National Instruments Cor oration                                 . close the VI and do not sa ve any changes you may have made. Finish examining the block diagram of the Freq uency Res onse VI. A Bode lot of the freq uency res onse lots the UUT gain in dB versus the frequency .

Oth erwise.vi. 7. A com lete testing rocedure for a UUT consists of a num ber of these tests executed sequentially. © National Instruments Cor oration 8-17 LabVIEW Tutorial Manual                                                 . Front Panel 1. Close the Frequency Res onse VI and do not save any changes. of this tutorial. 6.Cha ter 8 Data Acquisition and Instrument Control Each tunnel at the edge of the For Loo automatically assembles the values from each iteration into an array by using the auto-indexing feature described in Cha ter 4. Each test measures a articular characteristic of the unit under test (UUT) and com ares that measurem ent to an ex ected limit.llb. The following exam le shows how to bui ld a test sequencer. Return to th e front anel and run the VI. Arrays. If the value is within the limit. Clusters. located in exam les\a s\ testseq. Writing a Test Sequencer Many roduction and Automated Test Executive (ATE) a lications like the one you just examined require the automated sequencing of tests. and Gra hs. The rogram then uses a Bundle function to combine the x and y arrays into the gra h. the test asses. Change the knobs to see different frequency res on se lots. O en Test Sequencer. the test fails.

Cha ter 8 Data Acquisition and Instrument Control Block Diagram 1. Prom ting the o erator for a UUT serial number. The Current Test Number indicator sho ws the test number currently executing.                                                         receding illust   . The test sequence consists of a string that the VI ex ands into a numeric array of tests to run. Some other common extensions include: • • • Generating a text re ort of test resul ts. the loo sto s. LabVIEW Tutorial Manual 8-18 © National Instruments Cor oration             O en the block diagram of the Test Sequencer VI as shown in the ration. There are many extensions that you can make to this basic test sequencer. One common modification would be to store test seq uences in files rather than dis lay them in a front anel control. This array is assed to a While Loo that contains a Case struc ture. the test sequence dis lays the cumulat ive status in the Result indicator. The While Loo indexes through the array of test numbers. Each case contains a test VI that corres onds to a number in the test sequ ence string. each test asses out a B oolean value that indicates whether or not the test assed. selecting the a ro riate case index for each test. The o erator could then load the s ecific test sequence that is a ro riate for the current U UT. If a test fails and the o erator has set Sto on fail to TRUE. When the loo sto s executing. The Boolean is set t o TRUE if the test assed and FALSE if it fails. Loo ing a test on failure. In this exam le. The main test sequencer loo us es a shift register to kee a cumulative PASS/FAIL status for the entire testing sequence.

Several other GPIB functions erform less common o erations such as clearing a d evice.Cha ter 8 Data Acquisition and Instrument Control You can add all of these ca abilities to the basic test sequencer described in t his exam le. However. you may want to obtain the LabVIEW Test Executive Toolkit. (Windows. test sequencer that im lements not only the re viously mentioned extensions. and more. The GPIB Status VI returns the status of the GPIB when you execute the VI. If you have an instrument that is not on the list. (All Platforms) Just as the GPIB VIs eliminate the need to have an inde th knowledge of the IEEE 488 bu s. (Windows. VXI. you can find a similar instrument and modify that instrument driver for your instrument. but also test de endencies. waiting for a service request. VISA functions are the referred method for controlling instruments. and GPIB Status. force conditions. GPIB is a useful method for co mmunication with individual instruments. Macintosh. the VIs in the LabVIEW Instrument Driver library eliminate the need to have a n in-de th knowledge of a s ecific instrument. Serial ort communication is a useful m ethod for transferring data over long distances. The commonly u sed functions are GPIB Write. The GPIB Write functio n sends data to an instrument. Contact National Instruments for urchasing information regarding the LabV IEW Test Executive Toolkit. and Sun) You can learn more about using the data acquisition VIs for acquiring data with lug-in data acquisition boards from the LabVIEW Data Acquisition Basics Manual. There are over 300 instrument dri vers in the library. or olling a device. Macintosh. and Sun) You can use VIs to control lug-in data acquisitio n boards and VXI systems. VISA controlled instrument drivers are considered to be inte rface inde endent. Summary There are many ways to acquire data with LabVIEW. GPIB Read. such as GPI B. Because VISA functions concentrate on the activities s ecific to the instrument. and so on. triggering a device. The GPIB functions control GPIB communication. The GPIB Read function reads data from an instrum ent. © National Instruments Cor oration 8-19 LabVIEW Tutorial Manual                                         . which contains a full-featured.

If an error has occurred. (Windows. You can use the Test Sequencer exam le to build such a test suite. LabVIEW has many string functions ideally suited for instrumentation rogramming . In addition.Cha ter 8 Data Acquisition and Instrument Control You can control serial devices with the serial ort VIs. Additional To ics Error Handling You should use error checking whenever ossible when develo ing a lications wit h I/O o erations. but they also contain e rror messages for all the file I/O and analysis o erations. When acquiring data and controlling instruments. You can connect t hese VIs to error status terminals of other VIs to test whether an error has occ urred. LabVIEW Tutorial Manual 8-20 © National Instruments Cor oration                                                      . which are desc ribed in the LabVIEW User Manual. The LabVIEW Test Executive To olkit is available as an add-on ackage if you want to have full control of your ATE a lication. and the General Error Handler VI. or extr act numbers from strings. Macintosh. Contact National Instruments for more information on the LabVI EW Test Executive Toolkit. these VIs return a text-based descri tion of th e error. the Find First Error VI. you can use these VIs to dis lay a dialog box containing a descri tion of the error message. These functions hel you easily convert data from one ty e to another. Then. you m ay have a articular test suite that controls your a lication. and Sun) You can control VXI systems if you have the LabVIE W VXI Develo ment System. For more information refer to the LabVIEW VXI VI Refer ence Manual. To control a serial device you use the Serial Port Init VI to conf igure the communication ort. you read the data from the buffer with the Serial Port Read VI. You can wait until a set number of characters are in the buffer w ith the Bytes at Serial Port VI. Finally. These error handlers not only contain the err or messages from all the GPIB and serial ort functions. LabVIEW contains three error handler utilities. These VIs consist of the Sim le Error Handler VI. you use the Serial Port Write VI to send a c ommand string. There are only five ser ial ort VIs.

llb) to conver t an ASCII waveform into a numeric array. return a waveform as e ither an ASCII string or a binary string.096 ( 4 * 1. consider a waveform com osed of 1..}CR LF Header (6 bytes) Data Point (u to 4 bytes each) Trailer (2 bytes) You can use the Extract Numbers VI (from exam les\general\ string.024 oints. such as a comma). as the following illustration shows. Using ASCII encoding. such as oscillosco es and scanners. ASCII Waveform String © National Instruments Cor oration 8-21 LabVIEW Tutorial Manual                                   . The following illustration shows an exam le of this ASCII wavef orm string.. a binary s tring transfer would in most cases be faster and require less memory than an ASC II string transfer.1024 oints in total..63. Assuming the same waveform.28. each oint having a value between 0 and 255. ASCII Waveforms As an exam le.024) bytes lus any header and trailer bytes to re resent the waveform as an ASCII string. This is because binary encoding usually requires fewer bytes than ASCII encoding. CURVE {12. You would need a maximum of 4....Cha ter 8 Data Acquisition and Instrument Control Waveform Transfers Most GPIB digitizers. you would need a maximum of 4 by tes to re resent each oint (a maximum of 3 bytes for the value of the oint and 1 byte for the se arator.

} {Chk} CR LF Header (7 bytes) Count (4 bytes) DataPoint (1 byte each) Trailer (3 bytes) Converting the binary string to a numeric array is a little more com lex.02 be re resented as a binary string. Binary Waveform String (Without header or trailer) LabVIEW Tutorial Manual 8-22 © National Instruments Cor oration                   . Using byte to re resent the oint. You mu st convert the string to an integer array.. this information is also converted. You can do this by using the String T o Byte Array function found in Functions»String»Conversion. Otherwise. le of a binary waveform string.Cha ter 8 Data Acquisition and Instrument Control Binary Waveforms The same waveform using binary encoding 4) lus any header and trailer bytes to binary encoding.. would require only 1. you would need only 1 ch oint was an unsigned 8-bit integer..1024 bytes in total.. You must remove all head er and trailer information from the string before you can convert it to an array . assuming ea The following illustration shows an exam CURVE % {MSB}{LSB}{ÂÂ å.024 bytes (1 * 1.

you can choose File»Save. or ress <Ctrl-s> (W indows). Runs a VI. to save a VI. Toggles the Hel window on/off. <command-s> (Macintosh). Toggles between the front anel and block diagram. For exam le. <meta-s> (Sun).Programming Ti s and Debugging Techniques You Will Learn: • • Ti s for rogramming VIs. Ti 1 Frequently used menu o tions have equivalent command key sho rt cuts. Techniques for debugging VIs. Removes all bad wires. Ctrl-h command-h meta-h Alt-h Ctrl-b command-b meta-b Alt-b © National Instruments Cor oration 9-1 LabVIEW Tutorial Manual                               . Windows Ctrl-s Ctr l-r Ctrl-e Macintosh command-s command-r command-e Sun meta-s meta-r meta-e HP-U X Alt-s Alt-r Alt-e Action Saves a VI. Cha ter 9 Programming Ti s The following ti s contain hel ful suggestions and techniques for rogramming VI s in LabVIEW. or <Alt-s>.

ush in the thumb tack. On the block diagram. Ti 5 Ti 6 LabVIEW Tutorial Manual 9-2 © National Instruments Cor oration       Ti 4                      Action Lists all errors for a VI. To convert any Controls or Functions alettes or sub al ettes into floating alettes. Pressing the arrow keys moves a selected object one ixel in the direction of the arrow. To change the direction of a wire while wiring. res s the s acebar. ress <Tab> . This ti also works for selected wire segments.Cha ter 9 Programming Ti s and Debugging Techniques Windows Ctrl-l Macintosh command-l Sun meta-l HP-UX Alt-l Ctrl-w command-w meta-w Alt-w To rotate through the most commonly used tools in the Tools alette. located in the u er-left corner of the alette. ress the s acebar. Closes the active window. To toggle between the O erating and Positioning tools on the front anel. To move selected objects in the front anel and the block diagram. r ess the arrow keys. Use arrow keys to nudge selected objects. Ti                         2 Ti 3     . the s acebar toggles between the Positioni ng and the Wiring tools.

select the object using the Positioning tool. Ti 10 To limit an object to horizontal or vertical motion only. and drag the mouse. or <Shift-Enter> (HP-UX) after ty ing the item n ame. <Shift> + Place cursor before incrementing or decrementing To increment or decre ment faster To add items to ring controls. hold down <Shif t> and drag the object with the Positioning tool. hold down <Ctrl> (Windows). Ti 9 To du licate an object. or <Alt> (HP-UX). <Shift-Return> (Sun). <o tion> (Macintosh). <shift-return> (Ma cintosh).Cha ter 9 Programming Ti s and Debugging Techniques To increment or decrement faster. Press <Shift-Enter> after entering the item name. ress <Shift-Enter> (Windows). Pressing these keys acce ts the item and ositions the cursor to add the ne xt item. <meta> (Sun). © National Instruments Cor oration 9-3 LabVIEW Tutorial Manual                 Ti 8     Ti 7         . ress <Shift> while you click the increment or decrement button on digital controls.

<o tion> (Macintosh ). To f ix this roblem. Place the to ol over the object and ress and hold down <Ctrl> (Windows). This mistake returns the error message: Signal: has multi le sources.Cha ter 9 Programming Ti s and Debugging Techniques Ti 12 To ick a color from an object. Ti 13 One common error you should avoid is wiring together two controls or wiring two controls to an indic ator. LabVIEW Tutorial Manual 9-4 © National Instruments Cor oration                       Ti 11 To re lace nodes. Pick u the object color by clicking on the object. Release the key and color other objects by clicking on them using the Coloring tool. or <Alt> (HP-UX). o u enu. The tool changes to the Color Co y tool. first select the Color tool. o u on the control and select Change to Indicator. <meta> (Sun).                     on the node and choose Re lace from the o -u m       .

click on the ste over button. click on the broken run button. right-click the mouse button. To list the errors. subVI. and so on. or Create Indicator. shown at left. located in the toolbar. Cl ick on one of the errors listed to highlight the object or terminal that re orte d the error. Create Control. located in the toolbar. click on the ste into button. located in the tool bar. To enable the single ste mode. You can s ecify how far you want the VI to execute before ausing by clicki ng on the ste out button and holding the mouse button down. Ti 15 (Windows and UNIX) To delete a wire as you are wiring. a ears on the ru n button. subVI.) Single Ste ing Through a VI For debugging ur oses. To enable ste ing into a loo . and so on. To enable ste ing out of a loo . in the toolbar. VI. or indica tor ty e to an object. subVI. located in the tool bar. a broken arrow. Debugging Techniques Finding Errors When your VI is not executable.Cha ter 9 Programming Ti s and Debugging Techniques Ti 14 To automatically create and wire the correct constant. and so on. o u on the in ut or out ut of the object and select Cr eate Constant. (Overla ing or artially hidden nodes and terminals are exam les of warnings that may indicate the resen ce of a more serious design roblem in your VI. click on the ste out button. control. a lthough warnings do not cause the run arrow to break. This accesses a o -u menu. click on the ste over bu tton. To enable ste ing over a loo . © National Instruments Cor oration 9-5 LabVIEW Tutorial Manual                                                                                       . Note: The error list window also dis lays warnings if it is o en. you may want to execute a block diagram node-by-node.

O en the Se arate Array Values.. You can use execution highlighting with single ste ing to trace the flow of data in the block diagram. located in the toolbar.llb..vi by selecting File»O en.. The Positive Array and Negativ e Array indicators dis lay the result of the se aration. LabVIEW Tutorial Manual 9-6 © National Instruments Cor oration                                       .Cha ter 9 Programming Ti s and Debugging Techniques Execution Highlighting You can animate block diagram execution highlighting by clicking on the hilite e xecute button. the VI takes that number out of the array and laces it in another array. In other words. Front Panel 1. the VI se arates an in ut array of mixed ositive and negative numbers into an array of ositive numbers and an array of negative numbers. The VI is located in exam les\general\ arrays. The symbol changes to the symbol shown to the left. The array of digital controls su lies the in ut. If the number is negative. Debugging a VI OBJECTIVE You will o en a VI that checks each number in an array to see if it is negative.

T he For Loo continues to run until there are no more elements in the array.Cha ter 9 Programming Ti s and Debugging Techniques Block Diagram 1. © National Instruments Cor oration 9-7 LabVIEW Tutorial Manual                       . and that the in ut array is auto-indexed as it enters the For Loo . click on the arrows in the to border of the Case structure. To change cases. You can dis lay only one case at a time. O en and examine the block diagram. Notice that the count terminal of the For Loo does not have a s ecific value wi red to it.

which you can use to set break oints on node s. Enable the execution highlighting mode by c licking on the hilite execute button in the toolbar of the block diagram. block diagrams. Values from the In itialize array function ass through the shift registers and then ause at the C ase structure. so that the Less Than function asses a result of FALSE to the Case structure. Notice that the elements do not ass out of the For Loo to the indicators yet. The VI then asses the floating oint and integer values of the numeric constants to Initiali ze Array. LabVIEW Tutorial Manual 9-8 © National Instruments Cor oration                                                                                    . For this iteration. 6. the value is six. This initializes the shift regist ers. 3. and wires. is less than zero and then auses execution. loca ted in the toolbar. This executes the rest of the bloc k diagram as well as the subsequent iterations. The number of elements in the various arrays are noted and s ecific values a ear as the block diagram executes. Note: Red frames around nodes a nd diagrams and red dots on wires indicate set break oints. This is an im ortant conce t of dataflow rogramming–a loo does not begi n to execute until all the data going into it is available and data does not lea ve the loo until the loo finishes execution. Click on the ste over button to ass the TRUE or FALSE result of th e less than to the Case structure. The less than function determines whether the value from the in u t array. Click on the ste over button. Click on the ste into button to ste into the For loo . The bu tton changes from the symbol shown at the to -left to the symbol shown at the bo ttom-left. structure objects. Enable the single-ste mode by clicking on the ste over button. Note: Moving dots re resent the dataflow in the block diagram. the VI transfers the resulting ositive and negative arrays to the ind icators. for this iteration. The VI asses the In ut Array to the For Loo . When each iteration of the loo finishes. LabVIEW includes a Break oint tool. 2. the in ut value six is gr eater than zero.Cha ter 9 Programming Ti s and Debugging Techniques A good way to debug a VI is to single-ste through the VI and animate the flow o f data through the block diagram. 4. 7. Click on the ste out button. 5.

Note: Select the Break oint tool from the Tools alette. The button changes to the symbol shown to the lef t. Do not save changes to the VI. The run button of the subVI changes to indicate that the subVI is currently run ning. consisting of 6. and then run the main a lication. Place a robe on the wire connecting the In ut Array to the Case str ucture. 16. Close the VI by selecting File»Close. LabVIEW also contains a Probe tool. o s u and a yellow gly h with the num ber one a ears on the wire. if you have an a lication tha t contains a subVI to acquire data and then another subVI to analyze that data. Single-ste through the VI again. Select the Probe tool from the Tools alette. which you can use to view the data as it flows through a wire. A red frame a ears around th e Initialize Array node. 13. Make certain that the arrow on the Break oint cursor is ointing towards the str ucture or wire that you wish to set the break oint on. Click the Break oint cursor on the Initialize Array node to remo ve the break oint. The robe window dis lays the data value. The subVI controls and indicators change as © National Instruments Cor oration 9-9 LabVIEW Tutorial Manual                                                                                             .0 for this iteration. 9. A robe window. O ening the Front Panels of SubVIs Another debugging technique is to o en the front anels of subVIs to watch the d ata as it asses through each subVI. For exam le. You can then verify that the acquire subVI actually reads the correct data and whether the analysis subVI obtains that data and calculates the a ro riate out ut. The robe window a ears on both the front anel an d block diagram. 10. LabVIEW highlights the Initialize Array node and sto s execution right before the Initialize Array nod e executes. 12. labeled Probe 1. 14. you can o en the front anels of both subVIs. as it flows through that ortion of the wire’s segment. Turn off the execution highlighting by clicking on the hilite execute button. 11. 15. Single ste through t he VI by clicking on the ste into button in the toolbar. Place the Break oint cursor o n the Initialize Array node and click on the node.Cha ter 9 Programming Ti s and Debugging Techniques 8.

the ubVIs contain their default values and you do not see the current values. The Break oint tool is useful for debugging because you can use it to ause VI execution at a s ecific oint in the VI.Cha ter 9 Programming Ti s and Debugging Techniques current values ass into the subVI. Otherwise. The Probe tool is useful for debugging because it shows you the values in a wire as the VI runs. located in the toolbar. Clicking on the broken run button o ens an Error List dialog box that li sts the VI’s errors. Summary A broken arrow in the run button. You can turn on execution highlighting and ingle ste ing in the subVI if you see a otential roblem and wish to examine t closer. Execution highlighting and the single ste ing hel s you to d ebug your VIs easily by tracing the flow of data through the VI. If you want to examine the subVIs of an a lication. identifies nonexecutab le VIs. LabVIEW Tutorial Manual 9-10 © National Instruments Cor oration                                             s i t s   . o en its front anel before you run the main VI and watch which values a re assed to and from that subVI. be sure to o en he front anels of the subVIs before you start the a lication. If you feel a subVI is not working cor rectly.

Next. you need to a ly that knowledge t o develo your own a lications. How do you start? This cha ter attem ts to answ er that question by suggesting some techniques to use when creating rograms and offering rogramming style suggestions. LabVIEW has an a dvantage over other rogramming languages when it comes to to -down design becau se you can easily start with the final user interface and then animate it.Cha ter Program Design 10 Congratulations! You have com leted the tutorial. need for real-time analysis. if you are the user). Use To -Down Design When you have a large roject to manage. and so on. think to -down design. as necessary. Think about and dis cuss functions and features. You may need to do some low-level research at this early stage to be sure that you can meet s ecifications. create some dummy front anels that you can show to the ros ective users (or mani ulate yourself. Now. Use this interactive rocess to redesign the user i nterface. © National Instruments Cor oration 10-1 LabVIEW Tutorial Manual                                                           . such as data through ut. and are familiar with many as ects of the LabVIEW rogramming rocess. Make a List of User Requirements List ty es of I/O. data resentatio n. sam ling rates.

For each block.Cha ter 10 Program Design Design the VI hierarchy Break the task. Ask yourself whether any given block generates information that some subsequent VI needs. Give this stub VI an icon and create a front anel that con tains the necessary in uts and out uts. in some a lications you may not need to use any file I/O o erations. try to create a block diagram that uses those high-level b locks. such as blocks re resen ting user rom ts. For instance. see if this stub VI is a necessary art of your to level block diagram. MAIN CONFIG HDW SETUP FILE SETUP READ DATA PROCESS DATA SAVE DATA FILE I/O HANDLER HDW DRIVERS In some cases you may not need all of these blocks. in general terms. Instead. into manageable ieces. you may need additional blocks. at logical laces. and how that block rovides the desired results. After you determine the high-l evel blocks you need. there are several major blocks that you can ex ect to see in one fo rm or another on every data acquisition system. Alternatively. As the following flow chart shows. or you may need different bl ocks. You do not have to create a block diagra m for this VI yet. make sure that your to -level block diagra m sketch contains wires to ass the data between VIs. After you assemble a grou of these stub VIs. create a new stub VI (a nonfunctional rototy e re resent ing a future subVI). try to unders tand. the function of each block. If so. LabVIEW Tutorial Manual 10-2 © National Instruments Cor oration                                                . The main objective is to divide your rogramming task into th ese high-level blocks that you can easily manage.

© National Instruments Cor oration 10-3 LabVIEW Tutorial Manual                                                        . That way. it becomes difficult to debug if you de end u on global variables as your method for transferring information between VIs. Write the Program You are now ready to write the rogram in LabVIEW.Cha ter 10 Program Design Try to avoid using global variables. Plan Ahead with Connector Patterns If you think that you may need to add additional in uts or out uts later on. This may involve construction of higher-l evel test routines. you can add an in ut or out ut with minimal effect on your hierarchy. or the otential f or code reuse. As you consider the details of your stub subVIs. Using modular subVIs to accom lish s ecific tasks makes it easier to manage your rogram reorganizations. By adding extra. Te st your stub subVIs as you write them. You can leave these extra terminal s unconnected. sel ect a connector attern with extra terminals. You may have to reevaluate your to -lev el design at this oint. • • • Use a modular a roach by bui lding stub subVIs where there is a logical division of labor. but it is much easier to catch the bugs in one small module than in a hierarchy of 75 VIs. you may find that your initial design is incom lete. because they hide the data de endency betwe en VIs. Solve the more general roblems along with your s ecific ones. you do not have to change the connector attern for you r VI if you find you need another in ut or out ut later on. you may realize that you need to transfer mor e information from one subVI to another. unused term inals. For exam le. As your system gets larger. Changing atterns re quires re lacement of the subVI in all calling VIs.

Cha ter 10 Program Design When linking controls and indicators to the connector. and out uts on the right. lace in uts on the left. If you create a subVI that roduces an out ut that is used as the in ut to another subVI. This revents com licated. This makes it easier to remember where to locate each in ut without using the H el window. try to give the subVIs a consistent connector attern. LabVIEW Tutorial Manual 10-4 © National Instruments Cor oration                                                     . This sim li fies your wiring atterns. with common in uts in the same location. unclear wiring atterns in your VIs. BAD In ut Location GOOD In ut Location OK In ut Location BAD Out ut Location GOOD Out ut Location OK Out ut Location If you create a grou of subVIs that are commonly used together. try to align the in ut and out ut connections.

The following illustration dis lays the submenu o tions. From the submenu. Using subVIs he l s you to manage changes and to debug your diagrams quickly. o u on the connect                                    .Cha ter 10 Program Design SubVIs with Required In uts On the front anel. Good Diagram Style Avoid Oversized Diagrams In general. © National Instruments Cor oration 10-5 LabVIEW Tutorial Manual                     If you want to return to the icon or ane and select Show Icon. You can determine the function of a well-structured rogram after only a brief examination. With forethought and careful lanning. you should consider breaking you r diagram u into subVIs. If a diagram becomes very large. ane in the front anel. it is much easi er to design diagrams that use subVIs to erform s ecific tasks. avoid creating a block diagram that uses more than a age or two of screen s ace. on the u er-right side of the window and choosing Show Connector»This C onnection is. you can edit required in uts for subVIs by clicking on the i con ane. decide whether some com onents of your diagram could be reusable by other VIs. or whether a section of your diagr am fits together as a logical com onent. Recommended. or O t ional o tions. choose between the Required. If so.

where three similar o erations run inde endently. LabVIEW Tutorial Manual 10-6 © National Instruments Cor oration                                       . you may find that you erform a certain o eration f requently. which erforms the o eration three time s. An alternative to this design is a loo . De ending u on the situation. this may be a good lace to use subVIs or loo s to re etitively erform an action. You can build an array of the different arguments and use auto-indexing to se t the correct value for each iteration of the loo . consider the following diagram. For exam le.Cha ter 10 Program Design Watch for Common O erations As you design your rograms.

Make sure that you r rogram checks for errors and you handle them a ro riately. you can use an array constant instead of bui lding the array on the block diagram. LabVIEW does not handle errors automatically. broken. All elements of your rogram should be organized in this fashion.Cha ter 10 Program Design If the array elements are constant. The following list describes three situations in which errors frequently occur: • • • Inc orrect initialization of communication or data that has been im ro erly written to your external device Loss of ower. if an analog out ut o eration fails because you s ecify the wr ong device. An alternati ve a roach. and ut subsequent functions inside case structures. For instance. For exam le. when ossibl e. This can com licate your diagrams and ultimately hide the ur ose of your a lication. Almost all I/O functions return error information. One method for managing such a roblem is to test for errors after every fu nction. you may not want certain subsequent o erations to take la ce. you may not want LabVIEW to erform a subsequent analog in ut o erat ion. Check for Errors When you erform any kind of I/O. Each VI can have an error in ut and an error out ut. You can design the VI to check the error © National Instruments Cor oration 10-7 LabVIEW Tutorial Manual                                                                                         . you make error-handling decisions. In LabVIEW. is to incor orate error handling in the subVIs that erf orm I/O. you should consider the ossibility of errors occurring. you may or may not want your entire rogram to halt. which has been used successfully in a number of a lications and ma ny of the VI libraries. because users usually want very s ecific error-hand ling methods. Use Left-to-Right Layouts LabVIEW was designed to use a left-to-right (and sometimes to -to-bottom) layout . You also may want the VI to retry for a certain eriod of time. if an I/O VI in your block diagram times out. or im ro erly working external de vice Bugs in LabVIEW or other rograms that occur when you u grade LabVIEW or yo ur system o erating software When an error occurs.

The following illustration shows how you can use this in your own a lications. The error information is generally re resented using a cluster containing a numeric error code. and an error Boolean for qu ick testing. such as a Close o eration. the VI can execute the o eration and ass the result to th e error out ut. If there is an error. the VI c an be set u to halt execution and to ass the error in ut to the error out ut. If there is no error. Note: In some cases. Notice that the While Loo sto s if it detects an error. a string containin g the name of the function that generated the error.Cha ter 10 Program Design in ut to see if an error has reviously occurred. you can easily wire several VIs together. LabVIEW Tutorial Manual 10-8 © National Instruments Cor oration                                                                  . you can use the Sim le Error Handler VI to dis lay a dialog box if an error occurs. you can use this techniqu e to determine the order of several I/O o erations. you may want the VI to erform the o eration regardless of the error that is assed in to it. The Sim le Error Handler VI is located in Functions»Time & Dialog. One of the main advantages i n using the error in ut and out ut clusters is that you can use them to control the execution order of dissimilar o erations. At the e nd of series of VIs. connectin g error in uts and out uts to ro agate errors from one VI to the next. In addition to enca sulating error handling. Us ing the receding technique.

Cha ter 10 Program Design Watch Out for Missing De endencies Make sure that you have ex licitly defined the sequence of events, when necessar y. Do not assume left-to-right or to -to-bottom execution when no data de endenc y exists. In the following exam le, there is no de endency between the Read File and the Close File. More than likely, this rogram cannot work as ex ected. The following version of the block diagram establishes a de endency by wiring an out ut of the Read File to the Close File; the o eration cannot end until the C lose File receives the out ut of the Read File. Notice that the receding exam le still does not check for errors. For instance, if the file does not exist, the rogram does not dis lay a warning. The followi ng version of the block diagram illustrates one method for handling this roblem . In this exam le, the block diagram uses the error I/O in uts and out uts of th ese functions to ro agate any errors to the sim le error handler VI. © National Instruments Cor oration 10-9 LabVIEW Tutorial Manual

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

   

 

 

 

 

Cha ter 10 Program Design Avoid Overuse of Sequence Structures Because LabVIEW o erates with a great deal of inherent arallelism, avoid overus ing Sequence structures. Using a Sequence structure guarantees the order of exec ution, but rohibits arallel o erations. For instance, asynchronous tasks that use I/O devices (GPIB, serial orts, and data acquisition boards) can run concur rently with other o erations, if Sequence structures do not revent them from do ing so. Sequence structures tend to hide arts of the rogram and interru t the natural left-to-right flow of data. You ay no erformance enalty for using Seq uence structures; however, when you need to sequence o erations, you might want to consider using dataflow instead. For instance, in I/O o erations you might us e the error I/O technique described reviously to ensure that one I/O o eration occurs before the other. Study the Exam les For further information on rogram design, you can examine the many exam le bloc k diagrams included in LabVIEW. These sam le rograms can rovide you with insig hts into rogram style and building. To view these block diagrams, o en the read me VI located in the exam les directory. With this VI, you can access the numero us rogramming exam les. LabVIEW Tutorial Manual 10-10 © National Instruments Cor oration

 

 

 

 

 

 

 

 

 

 

 

 

 

   

 

 

 

 

 

 

 

 

 

 

 

 

 

 

   

Cha ter Where to Go from Here 11 The tutorial that you have just com leted should re are you to create LabVIEW a lications. Before you start, you may want to examine some additional resources . The exam les directory contains a number of useful exam les illustrating good rogramming techniques. At the to -level of the directory is a VI called readme. vi. With this VI, you can view the available exam les. When you select a VI, Lab VIEW dis lays the documentation for that VI (this information was reviously ent ered for the VI using the VI Information dialog box). To o en a VI, select File»O en.... (Windows, Macintosh, and Sun) The DAQ exam les directory (for Macintosh, located in the exam les\daq folder) contains a VI library called RUN_ME that has a Gett ing Started exam le VI for analog in ut, analog out ut, digital I/O, and counter /timers. The LabVIEW Data Acquisition Basics Manual contains information for the se functional areas that guides you through the RUN_ME exam le VI and ex lains h ow the data acquisition VIs work. For information on how to use the same exam le VIs with SCXI hardware, see Part 5, SCXI—Getting Your Signals in Great Condition, in the LabVIEW Data Acquisition Basics Manual. The RUN_ME exam les and the LabV IEW Data Acquisition Basics Manual rovide an excellent starting lace for infor mation on data acquisition rogramming.

Other Useful Documentation (Windows, Macintosh, and Sun) If you intend to use data acquisition in your rog ram, you should read Cha ter 3, Basic LabVIEW Data Acquisition Conce ts, of the LabVIEW Data Acquisition Basics Manual. This cha ter contains im ortant informat ion about using the data acquisition VIs with LabVIEW. © National Instruments Cor oration 11-1 LabVIEW Tutorial Manual

 

 

 

 

 

 

 

 

 

 

 

 

   

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

    

Cha ter 11 Where to Go from Here (All Platforms) The LabVIEW User Manual contains a number of cha ters that descr ibe advanced rogramming conce ts. These conce ts are not necessary for many a lications, but can be very hel ful if you lan to write large, LabVIEW a licati ons. These cha ters include discussions of custom controls and ty e definitions, erformance tuning, and ortability issues. The cha ters also contain informati on that hel s you to manage a lications and understand how LabVIEW executes VIs . In addition, there is a hel ful discussion about rinting and documentation. Cha ter 1 of the LabVIEW Communications VI Reference Manual, discusses the o tio ns for networking in LabVIEW (TCP/IP, DDE, A le Events, and PPC). The LabVIEW C ross Reference Manual contains a com rehensive index to all of the LabVIEW manua ls, a master glossary, and a com lete listing of error codes. For Information on Advanced To ics This tutorial attem ts to teach you the fundamentals of LabVIEW rogramming. Lab VIEW contains some advanced features that are either not discussed or only discu ssed in a limited fashion in this tutorial. You should be aware of these feature s so that you can a ly them as necessary in your a lications. The attribute no de is described briefly in this tutorial. With the attribute node, you can rogr ammatically manage settings related to controls and indicators. For exam le, you can change the visibility of controls using the attribute node. You can use the attribute node if you need to rogrammatically change the o tions in a ring or list control, clear the contents of a chart, or change the scales on a chart or gra h. Attribute nodes are discussed in detail in Cha ter 21, Attribute Nodes, i n the LabVIEW User Manual. This tutorial briefly discussed local variables. You can use local variables if you need to read from controls in multi le locations of your block diagram. They are also useful if you need to treat a front anel o bject as a control in some locations and an indicator in other locations, so tha t you can write to it and read from it on the block diagram. Local variables sho uld be used judiciously, because they hide the data flow of your diagrams, which makes it difficult to see the ur ose of your LabVIEW Tutorial Manual 11-2 © National Instruments Cor oration

  

 

 

 

  

 

 

 

 

 

 

 

 

  

 

 

  

 

 

   

 

 

   

    

 

 

 

  

 

 

 

 

     

 

Cha ter 11 Where to Go from Here rogram and to debug local variables. See Cha ter 22, Global and Local Variables , of the LabVIEW User Manual for a discussion of local variables. Notice that a lications that use local variables may make more co ies of data than a licatio ns that do not; for a discussion of this, see Cha ter 27, Performance Issues, al so in the LabVIEW User Manual. You can use global variables if you need to store data used by several of your VIs. Global variables should also be used judiciou sly, for the same reason as local variables. Global variables are necessary in s ome a lications. However, do not use them if you can structure your rogram so that you can use an alternate data flow method for transferring data. See Cha te r 22, Global and Local Variables, of the LabVIEW User Manual for details. You ca n create subVIs from a selection on the block diagram using Edit»Create SubVI from Selection. In addition, LabVIEW automatically wires the correct in uts and out uts to the subVI. In some instances, you cannot create a subVI from a VI. See Ch a ter 4, Creating SubVIs, of the LabVIEW User Manual for a detailed discussion o f this feature. You can use the VI rofile feature (Project»Show Profile Window) t o access detailed information about a VIs timing statistics and timing details. This feature should hel you to o timize the erformance of your VIs. See Cha te r 27, Performance Issues, of the LabVIEW User Manual for a detailed discussion o f the rofile feature. This tutorial briefly discussed the Control Editor. You c an use the Control Editor to customize the look of your controls. You can also u se the editor to save customized controls so that you can reuse them in other a lications. See Cha ter 23, Custom Controls and Ty e Definitions, of the LabVIEW User Manual for a detailed discussion of the Control Editor. The list and ring controls are useful if you need to resent the user with a list of o tions. See Cha ter 14, List and Ring Controls and Indicators, in the LabVIEW User Manual fo r a detailed discussion of these controls. © National Instruments Cor oration 11-3 LabVIEW Tutorial Manual

 

 

 

 

 

  

 

 

 

 

 

 

 

 

 

 

 

 

 

 

  

 

   

 

     

Cha ter 11 Where to Go from Here LabVIEW has a Call Library function that you can use to call a shared library or DLL. LabVIEW Tutorial Manual 11-4 © National Instruments Cor oration                 . you can create a calling interface in LabVIEW if you n eed to call an existing code or driver. tasks that you cannot erform directly from the block diagram. the call Library function is generally easier to use when calling source code than CINs. Calling Code from Other Languages. Calling Code from Other Languages. See Cha ter 24. You should use CINS when you need tighter integration with LabVIEW and the sourc e code. CINs are useful for tasks that conventional rogramming languages ca n erform more quickly than LabVIEW. and for linking existing code to LabVIEW. rogramming language from LabVIEW bloc k diagrams. See Cha ter 24. as an alternative method for calli ng source code written in a conventional. You can use code interface nodes (CIN). in the LabVIEW User M anual for a discussion of CINs. However. in the LabVIEW User Manual for a discussion of the Call Library funct ions. With this function.

1 sto bit. National Instruments has technical assistance through electronic. if your manual c ontains one.natinst. first try the e lectronic su ort systems. When you contact us. log on to our Internet host. 1 sto bit. 8 data bits. no arity FTP Su ort To access our FTP site. If the information available on these systems does no t answer your questions. You can ac cess these services at: United States: (512) 794-5422 or (800) 327-3077 U to 14 . © National Instruments Cor oration A-1 LabVIEW Tutorial Manual                                                                                        .600 baud. about your system configuration to answer your questions as quickly as ossible.400 baud. such as joesmith@anywhere. Our elec tronic services include a bulletin board service. as anonymo us and use your Internet address. u dates. If you have a hardware or software roblem. we offer fax and tele hone su ort through our technica l su ort centers. you can also download the latest instrument drivers. From these sites. no arity United Kingdom: 01635 551422 U to 9. this a endix contains forms to hel you gather the inform ation necessary to hel us solve your technical roblems and a form you can use to comment on the roduct documentation. The su ort files and documents are located in the /su ort directories. an FTP site. Electronic Services Bulletin Board Su ort National Instruments has BBS and FTP sites dedicated for 24-hour su ort with a collection of files and documents to answer most common customer questions. ft .com.60 0 baud. and tele hone systems to quickly rovide the information you need.com. 8 data bits. which are staffed by a lications engineers. 8 data bits. and exam le rograms. 1 sto bit. no arity France: 1 48 65 15 59 U to 9. as your asswor d. call (512) 795-6990. we need the inform ation on the Technical Su ort Form and the configuration form.A endix Customer Communication A For your convenience. a FaxBack system. For recorded instructions on how to use the bulletin board and FTP services and for BBS automated information. and e-mail su ort. fax.

com GPIB: g ib.com HiQ: hiq. address.su ort@nati nst.com DAQ: daq.su ort@natinst. You can access FaxBack from a touc h-tone tele hone at the following numbers: (512) 418-1111 or (800) 329-7177 E-Mail Su ort (currently U.com VXI: vxi.com VISA: visa. and hone number so we can contact you with solutions and suggestions.com Tele hone and Fax Su ort National Instruments has branch offices all over the world. Use the list below t o find the technical su ort number for your country. contact the source from which you urchased yo ur software to obtain su ort.su ort@natinst.K.su ort@natinst. only) You can submit technical su ort questions to the a ro riate a lications engin eering team through e-mail at the Internet addresses listed below.su ort@natinst. LabVIEW: lv.FaxBack Su ort FaxBack is a 24-hour information retrieval system containing a library of docume nts on a wide range of technical information.su ort@natinst.com LabWindows: lw.S. 03 9 879 9422 0662 45 79 90 0 02 757 00 20 519 62 2 9310 514 694 8521 45 76 26 00 90 527 2321 1 48 14 24 24 089 741 31 30 2645 318 6 02 48301892 03 5472 2970 02 596 7456 95 800 010 0793 0348 433466 32 84 84 00 2 265886 91 640 0085 08 730 49 70 056 200 51 51 02 377 1200 01635 523545 Fax 03 9 879 9179 0662 45 79 90 19 02 757 03 11 519 622 9311 514 694 4399 45 76 71 1 1 90 502 2930 1 48 14 24 14 089 714 60 35 2686 8505 02 48301915 03 5472 2977 02 596 7455 5 520 3282 0348 430673 32 84 86 00 2265887 91 640 0533 08 730 43 70 056 200 51 55 02 737 4644 01635 523154                                                                  . Tele hone Australia Austria Belgium Canada (Ontario) Canada (Quebec) Denmark Finland Franc e Germany Hong Kong Italy Ja an Korea Mexico Netherlands Norway Singa ore S ain Sweden Switzerland Taiwan U. If there is no National In struments office in your country.su ort@natinst. Remember to i nclude your name.

and use the com leted co y of this form as a reference for your curre nt configuration. Include additional ages if necessary. Name __________________ _______________________________________________________ Com any ________________ ______________________________________________________ Address _________________ ______________________________________________________ _________________________ _____________________________________________________ Fax (___ )________________ ___ Phone (___ ) ______________________________________ Com uter brand _________ _______ Model ________________ Processor __________________ O erating system (in clude version number) ___________________________________________ Clock s eed __ ____MHz RAM _____MB Mouse ___yes ___no Hard disk ca acity _____MB Dis lay ada te r _________________________ Other ada ters installed ___________________________ ___________ Brand ____________________________________________ Instruments used _______________________________________________________________ _ ______________________________________________________________________________ National Instruments hardware roduct model __________ Revision _______________ ________ Configuration__________________________________________________________ _________ National Instruments software roduct ___________________________ Vers ion _____________ Configuration_________________________________________________ __________________ The roblem is: _____________________________________________ ____________________ ___________________________________________________________ ___________________ ____________________________________________________________ __________________ _____________________________________________________________ _________________ List any error messages: _____________________________________ _____________________ __________________________________________________________ ____________________ ___________________________________________________________ ___________________ The following ste s re roduce the roblem: _________________ __________________________ _____________________________________________________ _________________________ ______________________________________________________ ________________________ _______________________________________________________ _______________________                                                        . If you are using any National Instruments hardware or so ftware roducts related to this roblem. include the configuration forms from th eir user manuals. Com leting this form accurately before contacting National Ins truments for technical su ort hel s our a lications engineers answer your ques tions more efficiently.Technical Su ort Form Photoco y this form and u date it each time you make changes to your software or hardware.

TX 78730-5039 Fax to: Technical Publications National Instruments Cor oration (512) 794-5678                          . lease record the age numbers and describe the errors . clarity. Title: LabVIEW Tutorial Manual November 1995 320998A-01 Edition Date: Part Number: Please comment on the com leteness. and organization of the manual. ___ ___________________________________________________________________________ ____ __________________________________________________________________________ _____ _________________________________________________________________________ ______ ________________________________________________________________________ _______ _______________________________________________________________________ If you f ind errors in the manual. Name ______________________________________________________ ___________________ Title ______________________________________________________ ____________________ Com any ___________________________________________________ ___________________ Address ____________________________________________________ ___________________ ____________________________________________________________ __________________ Phone ( ) ___________________________________________________ _________________ Mail to: Technical Publications National Instruments Cor oration 6504 Bridge Point Parkway Austin. This information hel s us rovide quality roducts to meet your needs. ______________________________________________________________________________ ______________________________________________________________________________ ______________________________________________________________________________ _ _____________________________________________________________________________ __ ____________________________________________________________________________ ___ ___________________________________________________________________________ Than k you for your hel .Documentation Comment Form National Instruments encourages you to comment on the documentation su lied wit h our roducts.

Window that is currentl y set to acce t user in ut. American Standard Code for Information Interchange. or by selecting it from the Windows menu. one rocess executes whil e others wait for interru ts during device I/O or while waiting for a clock tick . ANSI array array shell ASCII asynchronous execution © National Instruments Cor oration G-1 LabVIEW Tutorial Manual                                       . indexed set of data eleme nts of the same ty e. You make a window active by clicking on it. It can acce t vario us data ty es. Ordered.Glossary Prefix mµnMeaning millimicronanoValue 10-3 10-6 10-9 A absolute ath active window Relative file or directory ath that describes the l ocation relative to the to of level of the file system. the win dow is located on the deskto . usually the frontmost window. For exam le. The title bar of an active window is highlighted. For Macintosh. and an o tional label. American National Standards Institute. Mode in which multi le rocesses share rocessor time. It consists of an index dis lay. a data object window. Front anel object that houses an array.

Tool used to set a break oint on a VI. VI that cannot be com iled or run. A ause in e xecution. Boolean controls and indicators break oint Break oint tool broken VI Bundle node byte stream file C case Case Structure One subdiagram of a Case Structure.Glossary auto-indexing Ca ability of loo structures to disassemble and assemble arrays at their border s. and swee chart. this feature determines maximum and minimum scale values. and so on. which executes one and only one of its subdiagrams based on its in ut. The block diagram resides in the block diagram window of the VI. as well. is the source code for the VI. the loo automatically disassembles it with scalars extracted from one-dimensional arrays. which consists of executable icons called nodes and wires that carry data between the nodes. File that stores data as a seque nce of ASCII characters or bytes. Automatic res izing of labels to accommodate text that you enter. It is the combination of the IF. Several styles are available. the block diagram. such as switches. ELSE. Function that c reates clusters from various ty es of elements. signified by a broken arrow in the run button. As an array enters a loo with auto-indexing enabled. Front anel objects used to mani ulate and dis lay or in ut and out ut Boolean (TRUE or FALSE) data . chart LabVIEW Tutorial Manual G-2 © National Instruments Cor oration                                                         . THEN. Loo s assemble data into arrays as they exit the loo according to the reverse of the same rocedur e. node or wire. autoscaling autosizing B block diagram Pictorial descri tion or re resentation of a rogram or algorithm. See sco e chart. stri chart. and CASE statements in cont rol flow languages. Ability of scales to adjust to the range of lotted values. one-dimensio nal arrays extracted from two-dimensional arrays. On gra h scales. Conditional branching co ntrol structure. In LabVIEW. buttons and LEDs.

Execution mode in which a VI is run re eatedly until the o erator sto s it. unindexed data elements of any data ty e including numeric. The elements must be all controls or all indic ators. Tool used to co y colors for asting with the Color tool. Region in the u er right corner of a front anel that dis lays the VI termi nal attern. Y ou enable it by clicking on the continuous run button. text-based code to a VI. cluster A set of ordered. Gly h on a node or terminal indicating that the numeric re res entation of the data element changes at that oint. <o tion> (Ma cintosh). Part of the VI or function node that conta ins its in ut and out ut terminals. <meta> (Sun). or cluster. Front anel object for en tering data to a VI interactively or to a subVI rogrammatically. The automatic conversion LabVIEW erforms to change the numeric re resentation o f a data element. array. string. Tool used to color objects a nd backgrounds. Proces s that converts high-level code to machine-executable code. It underlies the icon ane. or <Alt> (HP-UX) key and dragging the co y to its new lo cation. See universal and user-defined constant s. S ecial block diagram node through which you can link conventional. cluster shell Code Interface Node coercion coercion dot Color tool Color Co y to ol com ile © National Instruments Cor oration G-3 LabVIEW Tutorial Manual   conditional terminal connector connector ane constant continuous run control                                                                      . (Sun and HP-UX) You can also clone an object by clicking on the object w ith the middle mouse button and then dragging the co y to its new location. The terminal of a While Loo that contains a Boolean value that determines wheth er the VI erforms another iteration. Bo olean.Glossary CIN cloning See Code Interface Node. LabVIEW automaticall y com iles VIs before they run for the first time after creation or alteration. Front anel object that contains the elements of a cluster. through which data asses to and from the no de. To make a co y of a control or some other LabVIEW objec t by clicking the mouse button while ressing the <Ctrl> (Windows).

Palette containing front anel control s and indicators. LabVIEW file I/O functions can log data. used in data storage and re resen tation. Generally. Pasca l. The terminal of a For Loo whose value determines the number of times the For Loo executes its subdiagra m. The arrangement and re resentation of data stor ed in memory. VI whose front anel. ty ically from A/D o r digital in ut lug-in boards. a number. arbitrary da ta ty e that you s ecify when you create the file. data flow data logging data storage formats data ty e descri tor datalog file Descri tion box LabVIEW Tutorial Manual G-4 © National Instruments Cor oration                                                                    . Controls and indicators whose arts can be re laced by gra hics you su ly. While all the records in a da talog file must be of a single ty e. to acquire data and simultaneously store it in a disk file.Glossary control flow Programming system in which the sequential order of instructions determines exec ution order. block diagram. Code that identifies data ty es. Condition in a dataflow rogramming language in which a node cannot execute until it receives data from another node. you can s ecify that each record is a cluster containing a string. Programming system consisting of executable nodes in which nodes execute only when they have received all required in ut data and ro duce out ut automatically when they have executed. File that stores data as a sequence of records of a single. Online documentation for a LabVIEW object. Changing the ty e of a data element. Controls alette conversion count terminal CPU current VI custom PICT controls a nd indicators D data acquisition data de endency Process of acquiring data. LabVIEW is a dataflow system. such as C. or icon editor window is the active window. and an array. for instance. and BASIC. that ty e can be com lex. See also a rtificial data de endency. are control flow languages. Central Processing Unit. Most conventional textbased rogramming languages.

Subdiagram of a Sequence Structure. End-of-File. E em ty array Array that has zero elements.. Iterative loo structure that executes its subdiagram a set number of times. Data of any ty e that has been converted to a string . EOF execution highlighting external routine F file refnum An identifier that LabVIEW associates with a file when you o en it. but has a defined data ty e. usually. an array that has a numeric control in its data dis lay window but has no de fined values for any element is an em ty numeric array. Feature that animates VI execution to illustrate the data flow in the VI. or delet e objects. To drag the mouse cursor on the screen to select. An interactive screen with rom ts in which you s ecify addit ional information needed to com lete a command. Size and structure attribute of an array. Label on the front anel or block diagram th at does not belong to any other object. for writing it to a file. move. Equivalent to conventional code: For i=0 to n1. For exam le.. co y. You use the file refnum to s ecify that you want a function or VI to erform an o eration on the o en file. Es ecially usefu l for lengthy formulas that would be cumbersome to build in block diagram form. . Node that executes formulas that you enter as text. Character o ffset of the end of file relative to the beginning of the file (that is. do . See shared external routine.Glossary destination terminal dialog box dimension drag See sink terminal. flattened data For Loo Formula Node frame free label © National Instruments Cor oration G-5 LabVIEW Tutorial Manual                                           . the EOF is the size of the file).

An array of strings is a handle to a block of memory containing handles to strings. Modeled from the front anel of hysical instruments. Palette con taining block diagram structures. com arabl e to an o erator. the inventor of the bus. constants.Glossary front anel The interactive user interface of a VI. communication features. slides.2-1987. or statement in a conventional language. Hexadecimal. A base-16 number sy stem. Built-in execution element. The memory of co ies of these subVIs is shared and t hus can be used to ass global data between them. LEDs.1-1987 and ANSI/IEEE Standard 488. handles reference arrays and s trings. gly h GPIB gra h control H handle Pointer to a ointer to a block of memory. the descri tion of controls and indicators. gra hs. S ecial window that dis lays the names and locations of the terminal s for a function or subVI. Gener al Pur ose Interface Bus is the common name for the communications interface sys tem defined in ANSI/IEEE Standard 488. Palette that contains alettes and sub alettes. function. Hel window LabVIEW Tutorial Manual G-6 © National Instruments Cor oration     hex hierarchical alette                                                         . A small icture or icon. calls it the HP-IB. gauges . and other controls and indicators. The window also accesses the online reference. Non-reentrant subV I with local memory that uses an uninitialized shift register to store data from one execution to the next. and descri tions and data ty es of control attributes. and VIs. the value s of universal constants. charts. it is com osed of switches. function Functions alette G G global variable The LabVIEW gra hical rogramming language. meters. Front anel object that dis lays data in a Cartesian lane. Hewlett-Packard.

oint re resentation of infinity. Tool used to create la bels and enter text into text windows. Light-emitting diode. Front anel object that dis lays out ut. © National Instruments Cor oration G-7 LabVIEW Tutorial Manual                                                                        . and/ or data acquisition and control interfaces. Interface similar t o that of a aint rogram for creating VI icons. Laboratory Virtual Instrument Engineering Workbench. The terminal of a For Loo or While Loo th at contains the current number of com leted iterations. Ability of a function or VI to reuse memory instead of allocating more. iteration terminal L label Labeling tool LabVIEW LED legend Text object used to name or describe othe r objects or regions on the front anel or block diagram. VI that controls a rogrammable instrument. Di gital dis lay value for a floating. Nonmoving art of front anel controls and indicators that contains sliders and scales. I icon Icon Editor icon ane IEEE indicator Inf in lace execution instrument drive r I/O Gra hical re resentation of a node on a block diagram. The transfer of data to or from a com ute r system involving communications channels. Region in the u er right corne r of the front anel and block diagram that dis lays the VI icon. Institute for Electrical and Electronic Engineers. In ut/Out ut. o erator in ut devices.Glossary Hierarchy window housing Window that gra hically dis lays the hierarchy of VIs and subVIs. Object owned by a chart or gra h that dis lay the names and lot styles of lots on that chart or gra h.

tab. and subVIs. Two-dimensional array. nodes. ASCII cha racters that cannot be dis layed. A redefined value for the ath control that means the ath is invalid. Resembles a ointing finger. Tool used to enter data into co ntrols as well as o erate them. A redefined value th at means the refnum is invalid.oint re resentation of not a number. wires. structures. dashed border that surrounds selected objec ts. such as log(-1). N NaN Digital dis lay value for a floating. Megabytes of memory.ath not-a-refnum numeric controls and ind icators O object Object o -u menu tool O erating tool Generic term for any item on the f ront anel or block diagram.Glossary M marquee matrix MB menu bar A moving. Horizontal bar that contains nam es of main menus. including controls. Execution elemen ts of a block diagram consisting of functions. such as newline. Front anel objects used to mani ulate and dis l ay or in ut and out ut numeric data. LabVIEW Tutorial Manual G-8 © National Instruments Cor oration                                                             . and im orted ict ures. and so on. Tool used to access an object’s o -u menu. nodes nondis layable characters not-a. t y ically the result of an undefined o eration.

of which there are signed and unsigned byte. Pull-down menu o tions are usually general in nature. Tool used to move. as well as single-. Sun. Ability of a node to automatically adjust to data of different re resentation. resizing handles ring control © National Instruments Cor oration G-9 LabVIEW Tutorial Manual                                                                                                 . A gra hical re resentation of an arra y of data shown either on a gra h or a chart. Angled handles on the corner of objects that indicate resizing oints. usually on an object. both real and com lex. ty e. and resize objects. S ecial numeric control that associates 32-bit intege rs.o int numbers. Com uter and o erating system. Subty e of the numeric data ty e. and HP-UX) or while holding down the command key (on the Macintosh).recision floating. word. To call u a s ecial menu by clicking (usually on an object) with the right mouse button (on Wi ndow. select. Automatic rinting of a VI front anel after execution. Menus accessed by command-clicking. and extended.Glossary P alette latform lot olymor hism o u Menu of ictures that re resent ossib le o tions. with a series of text labels or g ra hics. Menus access ed from a menu bar. starting at 0 and increasing sequentially. Menu o tions ertain t o that object s ecifically. Debug ging feature for checking intermediate values in a VI. Tool used to create robe s on wires. or structure. an d long integers. double-. o -u menus Positioning tool robe Probe tool rogrammatic rinting ull-down m enus R reentrant execution re resentation Mode in which calls to multi le instances of a subVI can execute in arallel with distinct and se arate data storage.

Commonly used to force nodes that are not datade endent to execute in a desired order. or While Loo . O tional mechanism in loo structures used to as s the value of a variable from one iteration of a loo to a subsequent iteration . Also called a destination terminal. and clusters are ex licitly s ingular instances of their res ective data ty es. A single value as o osed to an array. Numeric indicator modeled on the o eration of an oscillosco e. Part of mechanical-action.Glossary S scalar Number ca able of being re resented by a oint on a scale. strings. Block diagram within the border of a structure. A nonfunctional rototy e of a subVI that is created by the user. Terminal that emits data. Scalar Booleans. It is used during early lanning stages of VI desi gn as a lace holder for future VI develo ment. Moveable art of slide controls and indicators. Case. cha rt. Program control structure that executes its subdiagrams in numeric order. It has in uts an d out uts. Terminal that asses data between the frames of a Sequence Structure. For Loo . Tool used to scroll windows. which scrolls as it lots data . but is incom lete. Subroutine that can be shared by several CIN code resources. scale sco e chart Scroll tool sequence local Sequence Structure shared external routine shift register sink terminal slider source terminal stri ng controls and indicators stri chart structure stub VI subdiagram LabVIEW Tutorial Manual G-10 © National Instruments Cor oration                                                                                    . Terminal that absorbs data. Program control element. A numeric lotting indi cator modeled after a a er stri chart recorder. and gra h controls and indicators that contains a series of marks or oints at known intervals to denote units of measure. Front anel objects used to mani ulate and dis lay or in ut and out ut text. such as a Sequence.

i. This term distinguishes the VI from its subVI s. are s ecified Se quences as arrays of case numbers. T table-driven execution A method of execution in which individual tasks are se ar ate cases in a Case Structure that is embedded in a While Loo . for exam le. exce t a line swee s across the dis lay to se arate old data fro m new data. terminal tool toolbar Tools alette to -level VI tunnel ty e descri tor U universal constant user-defined constant Uneditable block diagram object that em its a articular ASCII character or standard numeric constant. Bar containing command buttons that you can use to run and debug VIs. Object or region on a node through which data asses. com arable to a subroutine. See data ty e descri tor. V V VI Volts. S ecial LabVIEW cursor you can use to erform s ecific o erations. See virtual instrument. Block diagram object that emits a value you set. VI at the to of the VI hierarchy. Similar to sco e chart.Glossary subVI swee chart VI used in the block diagram of another VI. © National Instruments Cor oration G-11 LabVIEW Tutorial Manual                                                       . Data entry or exit terminal on a structure. Palette contai ning tools you can use to edit and debug front anel and block diagram objects.

so called because it models the a earance and function of a hysica l instrument.Glossary VI library virtual instrument S ecial file that contains a collection of related VIs for a s ecific use. wire Wiring tool LabVIEW Tutorial Manual G-12 © National Instruments Cor oration                                  . Tool used to define data aths between source and sink terminals. Data ath between nodes. W While Loo Loo structure that re eats a section of code until a condition is me t. LabVI EW rogram. Com arable to a Do loo or a Re eat-Until loo in conventional rogramming la nguages.

4-11 to 4-12 initializing. 4-2 Array Size function. 7-10 array controls. 4-1 lacing in array. 3-15 Add function olymor hism exam les. 9-2 artificial data de endency. 1-8 Add Element o tion. 3-14 Alignment ring. 4-8 to 4-9 shift register exam le. 4-23 finding size of. 6-15 to 6-16 front anel. File Menu . 4-14 array shell creating a rray controls and indicators. Ver tical Centers axis. 4-1 8 Array Subset function. 4-1 efficient memory usage. 4-11 to 4-12 in ut arrays . 4-1 Array Max & Min function. 4-25 Index Array function. 4-2 to 4-9 block diagram. 4-1 to 4-25 Array Subset function. 4-25 definition. double recision. 3-17 Add In ut o tion. 6-9 ASCII waveforms. 4-13 gra h exam les.Index A Acquisition switch for sto ing VIs. 6-14 A ly Changes o tion. 4-25 one-dimensional (illustration). 5-17 ASCII byte stream file format. 4-2 to 4-9 © National Instruments Cor oration Index-1 LabVIEW Tutorial Manual                                                                                . 11-2 auto-indexing array rocessing. 4-16 to 4-18 creating and initializing. 4-10 to 4-11 Build Array function. 4-9 to 4-12 creating array with auto-indexing. 4-15 intensity lots. 4-19 to 4-22 indexes one -dimensional (illustration). 4-14 analysis VIs array exam le. 4-7 to 4-8 customizing gra hs. 4-8 to 4-9 single. 4-1 olymor hism. 4-12 a ending data to file. 4-16 to 4-18 creating with auto-indexing. 4-12 to 4-14 block diagram. 8-21 Attribute Node. 4-9 to 4-12 setting For Loo count. 4-1 Initialize Array function. 5-11 Add Out ut o tion. 4-18 to 4-19 auto-indexing Initialize Array function. 1-17 Analysis alette. 4-18 to 4-19 arrays. 4-23 slicin g off dimensions. 4-1 range for. 4-4 to 4-7 front anel.recision vs. 4-1 arrow keys for nudging objects . 4-20 to 4-22 ty es allowed. 4-23 data ac quisition arrays. 4-12 to 4-14 exam les in analysis directory. 4-15 using Build Array function. 4-18 gra h and analysis VIs. 5-11 Add Shift Register o tion. 6-14 to 616 block diagram. 4-13 to 4-14 front anel. 4 -2 to 4-3 multi lot waveform gra hs.

Bundle function array created wi th auto-indexing. 6-17 to 6-18 Sequence structure. 3-20 modifying text format (note). 4-3 autoscaling of gra h in ut default action. 6-22 definition. 8-6 to 8-7 shift register. 4-3 axes customizing Y axis. 5-15 to 5-16 freque ncy res onse test VI. 2-8 debugging techniques. 6-12 to 6-13 block diagram window. 4-11 setting For Loo count. 6-9 exam le in strings. 1-9 to 1-11 definition. 2-8 numeric constant . 3-21 B bad wires. 4-4 enabling and disabling (note). 3-6 t o 3-7 ur ose and use. 1-24 to 1-31 activating Hel window. 1-29 wiring techniqu es. 10-5 building. 3-2 broken run button. nudging objects in. 3-13 to 3-14 Formula node. 4-4 gra h and analysis VI exam le. 1-30 Divide function. 4-10 to 4-11 Autoscale Y submenu. 4-16 array exam le. 6-15 to 6-16 array created with auto-indexing. 2-7 to 2-12 wire stretching. 1-20 Boolean alette. 2-9 to 2-12 deletin g wires. 5-16 illustration. 9-5 Build Ar ray function adding and removing in uts. 6-3 to 6-6 de bugging VIs. 9-7 to 9-9 For Loo . 8-18 to 8-19 True and Fals e cases. 1-30 broken wires (note). 2-8 subVIs. 3-3 to 3-9 writing to s readsheet file. 4-13 to 4-14 reading d ata from file. 6-13 Boolean controls and indicators mechanical actions. 4-16 to 4-18 building VIs. 2-8 selecting wires. 4-9 to 4-10 While Loo . 1-27 com onent arts. 2-8 Multi ly function. 1-10 avoiding oversized diagrams. 8-22 block diagram. 4-16 ur ose an d use. 1-9 to 1-11 analogous to rograms. 4-16 Formula node exam le. 5-2 to 5-3 Boolean constant a ending data to file exam le. 1-13 block diagram exam les LabVIEW Tutorial Manual Index-2 a ending data to file.llb. 9-2 Boolean Case structure. 1-24. 3-22 rescaling. 4-4 to 49 Case structure.Index definition. 1-26 ba d wires. 3-17 to 3-23 subsetting strings. 1-29 showing terminals. 5-2 to 5-4 converting and concatenating strings. 1-24. 6-8 to 6-9 su bVI Node Setu o tions. 4-8 creating and in itializing arrays. 8-15 to 8-17 gra h and analysis VI. binary byte stream file format advant ages and disadvantages. 7-3 to 7-9 test sequencer VI. See also wiring block diagrams. 1-28 string constant. 1-10 subVI diagra m (illustration). 4-14 © National Instruments Cor oration                                                                         . 5-8 to 5-10 serial ort communic ation. See also VIs. 6-16 writing to s readsh eet file exam le. 1-25 Subtract function. 4-3 disabling. 1-3 o ening. 6-22 binary waveforms.

5-2 to 5-4 Boolean by default. 8-7. connecting subVIs to block diagrams. 4-25 legends. checking data ty es for inclusion. 3-11 Color tool. 3-19 resizing icon. 4-4 shift register exam le. 1-12 to 1 -13 creating. 5-4 Change to Array o tion. 4-13 waveform chart us ed with While Loo . 3-2 c olors charts. 4-4 coercion dot. 5-1 to 5-4 block diagram. 3-21 modi fying axis text format (note). 3-5 colors. 7-5 continuo us run button running VIs. 3-2 Com arison alette. 3-24 intensity lots. 3-21 com ared with gra hs. 3-22 modifying while running. 1-11 testing While Loo s before executio n. 3-24 tem erature waveform chart. Dat a O erations o -u menu. 3-16 to 3-22 sta cked vs. 1-11 ur ose and use. 3-22 sco e chart. 4-2 customi zing. 3-21 shift register exam le. 1-17 Bytes at Serial Port VI. 3-21 oint style. 5-2 to 5-3 defining out ut tunnel for each case (note). 3-21 icking color from object.Index order of in uts (note). 3-19 to 3-20 order of lots determined by Bundle function in uts. 9-4 round LED. 7-10 Index-3 LabVIEW Tutorial Manual                                                                                                         . 1-17 trans arent bo rder for free label. 1-31 using loo ing structure instead of (note). 5-1 location i nside While Loo . 8-4. See also gra hs. 3-1 to 3-5 Y axis. 3-23 stri chart. 3-21 e xam les. 4-4 array created with auto -indexing. 3-24 to 3-25 VI logic. 3-19 overl aid lots. 4-17 Change to Indicator o tion. 2-4 to 2-5 rogramming considerations. 1-13 Cluster alette. 3-1 faster chart u dates. 3-23 sw ee chart. 9-4 chart modes illustration. 10-3 to 10-5 s ecifying in uts and out uts to VI (note). aligning. 8-20 C Case structure. 3-5 Close o tion File menu. 3-19 but ton switches. 1-17. See also icons. 3-19 clusters analogous to Pascal records and C structs. 3-4 conne ctors. 5-4 front anel. 3-20 to 3-22 effect of chart size on dis lay of axis scales (note). 5-3 conditional terminal. 4-5 clearing chart in While Loo . 3-23 charts. 3-20 Clear Chart o tion. 2-5 subVI Node Setu o tions exam le. 3-21 multi lot char ts. terminals. 4-4 to 4-5 definition. 3-20 © National Instruments Cor oration lot line style. overlaid lots. 1-31 Control Editor invoking. customizing.

7-10 saving as ty e definition or strict ty e definition. 7-10 saving. 1-32 to 1-34 digital control illustration. 8-15 Demo Voltage Read VI. 1-21. 1-19 label for. 9-5 Demo Fluke 8840A subVI. See also VI Setu o tions. 10-9 LabVIEW Tutorial Manual Index-4 order of subVI node execution. 9-6 execution highlighting. 3-2 digital indicator creating ow ned label. 7-14 customer communication. 6-9. 5-7 data ty es. 8-2 data de endency artificial. xxi. 4-5 datalog file format. 1-29. 4-14. 9-6 subVI exam le. 1-24. setting. 3-18 documentat ion © National Instruments Cor oration                                                                                                         . 2-10 to 2-11 missing de endencies. 1-26 Descri tion o tion.Index ur ose and use. 7-9 Disable Ind exing o tion. 6-1 count terminal. 8-2 latforms su orted. 9-1 to 95 exam le block diagram. 7-13 to 7-14 using as in uts (note). Show o -u menu. 5-7 data range. 5-10 shift register exam le. 1-17 Divide function adding to block diagr am. 9-5 subVI exam le. 7-14 controls automatic creation of terminal. 11-3 saving custom control as ty e definition or strict ty e de finition. 2-5 Controls alette Numeric alette. 1-19 simulating control/indicator . 2-8 Sequence structure exam le. 2-7 Boolean controls and indicators. 9-5 o ening front anels of subVIs. 1-2 3 Select a Control O tion. xxi customizing VIs. 6-21 debugging VIs develo ment ti s. 1-20 fixing incorrectly wired controls. 6-21 definition. 9-4 numeric controls and indicators. 9-7 to 9-9 front anel. 7-10 String & Table alette. 5-1 7 missing. 1-15 Digital Dis lay o tion. 5-17 controlling execution with Sequence structure. 1-20 configuring using o -u menus. A-1 cus tomer education. 7-10 to 7-12 invoking Control Editor. 2-11 Data Range o tion. 1-17 Digital Thermometer VI. 6-21 advantages. 8-15 Demo Te k FG 5010 subVI. 4-20 Distribution ring. 4-25 data acquisition boards available data acquisition VIs. 9-9 to 9-10 single ste ing through VIs. checking for inclusion in gra hs. 8-2 features. in rogram structure. 9-1 custom controls im orting ictures. 1-16 illustration. 3-10 Ctrl key equivalents for menu o tions. 9-3 deleting wires. 1-15 re ositioning. 2-9 to 2-12 decreme nting faster. D data acquisition arrays. For Loo . 10-9 data flow rogramming artificial data de e ndency. 2-10 to 2-11 finding errors. 5-9 debugging with e xecution highlighting.

2-10 to 2-11 VI exam le. 6-10 Write To S readsheet File VI. xvii to xix other useful documentation. 6-9. 1-13 Save o tion. 8-20 error handling.Index advanced to ics. 6-21 exam les i n sm lefile.recision. 6-10 Read From S readsheet File VI. 6-19 s ecifying files. 6-17 to 6-18 front anel. 7-10 Close o tion. 7-5 floating. 6-14 to 6-16 block diagram. 6-9. 6-15 to 6-16 front anel. 1-32 to 1-34 using Show VI Info o tion. 1-35 Index-5 LabVIEW Tutorial Manual                                                                                         . 3-11 flow o f data. 9-3 E Edit Control o tion. 1-14 to 1-18 efficient memory usage with arrays. 614 ASCII byte stream format. 10-7 to 10-8 exam le files exam les directory. 8-21 reading data from file exam le. 6-10 W rite Characters To File VI. as default re resentation. 6-18 to 6-19 writing to s readsheet file. 6-19 reading data from file. 6-22 datalog format. 6-10 File I/O al ette. 4-23 Em ty Path constant. 1 -34 file utility functions Read Characters From File VI. 6-18 F file I/O © National Instruments Cor oration a ending data to file. 6-17 refnums. 6-13 binary byte stream format. 8-20 Sim le Error Handler. 6-18 files for LabVIEW. 6-12 file I/O functions Read Characters From F ile VI. 6-9 File menu A ly Changes o tion.oint number s double. xx documenting VIs. 7-11 Remove Bad Wires o tion.llb. xix to xx organization of manual. 6-10 Read Lines From File VI. 6-16 to 6-18 block diagram. 1-32 viewing object descri tions. 7-5 to 7-6 Extract Numbers VI converting ASCII waveforms. 9-7 to 99 Execution O tions subVI Node Setu o tions exam le. 8-7. 1-8 error handler VIs Find First Error. 4-20 enter button. 6-10 aths. 6-12 to 6-13 front anel. 9-6 subVI exam le. Edit menu. 3-10 rounding (note). 11-2 to 11-4 conventions used in manual. 6-20 file utility functions. 11-1 execution highlighting for debugging VIs buttons for. 11-1 to 11-2 related documen tation. 7-11 Edit Icon o tion. 1-4 where to find. 8-20 Fli Horizontal o tion. 6-9 avoiding writing data to VI libraries (caution) . 1-30 editing VIs. 1-32 to 1-34 du licating objects. See also data flow rogramming. 6-11 to 6-13 block d iagram. folders for VIs stored in VI libraries ( illustration). 8-20 General Error Handler. 2-2 Edit menu Edit Contro l o tion. 6-15 Enable Indexing o tion . 1-4 Find First Error VI.

3-9 to 3-14 auto-indexing arr ay rocessing. block diagram. 3-13 to 3-14 count terminal. 6-14 array cre ated with auto-indexing. 4-4 setting count for For Loo . 3-10 equi valent seudocode. 5-12 creating in ut and out ut terminals. 8-15 to 8-17 front anel. 6-8 front anel. 1-16 For Loo . 5-5 to 5-7 serial ort communication. 5-11 semicolon (. 1-23 definition. 1-5 to 1-9. 1-16 frequency res onse test VI. 1-16 du licating. 4-2 to 4-9 defini tion.) terminating for mula statements. 1-7 to 1-8 fro nt anel window. G G rogramming language. 3-2 to 3-3 writing to s readsheet file. 4-10 to 4-11 avoiding continuous u dating of indicators (note). nudging objects in. 5-15 variable names (note). 2-6. 4-10 to 4-12 creating array with auto-indexing. 1-7 to 1-8 front anel exam les a ending data to file. 6-1 0 Instrument I/O alette. 1-3 o ening. 1-3 Index-6 © National Instruments Cor oration LabVIEW Tutorial Manual                                                                                                           . changing size of. 5-14 Hel window for dis laying o erators and functions. 2-7 String alette. 3-9 rogramming considerations. 6-12 Front Panel toolbar. 9-6 For Loo . 6-15 string concatenation exam le. See also test sequencer VI. 5-11 frequency res onse test VI. 3-10 location inside While Loo . 8-15 to 8-17 front anel. 5-11 definition. 2-6 to 2-7 VIs. 3-10 frequency res onse test VI. 8-13 to 8-17. 5-11. 312 iteration terminal. 8-3 Select a VI o tion. 9-2 Functions alette File I/O alette. 3-10 to 3-11 lacing on block diagram. 6-3 Formula node. 5-15 ur ose and use.Index fonts for labels. 5-1 converting and concatena ting strings. 1-6 to 1-7 toolbar. 5-15 free labels changing fon t size. 5-15 to 5-16 conditional assignment (exam le). 3-12 Formula Node. 5-11. 6-2 f unctions. 8-5 subsetting strings. See also s ecific functions. building subVIs. 10-6 to 10-7 Format & Precision o tion. 8-15 to 8-17 front anel. See also front anel exa m les. 3-14 block diagram. 8-17 While Loo . 5 -12 illustration. 8-14 From Ex on ential/Fract/Eng function. 6-2 to 6-3 debugging VIs. 4-2 to 4-3 Case structure. 6-17 Sequence structure. 5-14 fr equency res onse test VI. 5-5 Format Into String function a ending data t o file exam le. 1-11 numeric conversion. 6-7 subVI Node Setu o tions. 5-11 to 5-1 6 block diagram. 4-13 reading data from fil e. 7-4 test sequencer VI. 8-14 gra h and analysis VI.

Gen erate Waveform VI. 2-1 illustration. 2-2 to 2-3 grou ing into lower level VI. 11-3 GPIB definition. 1-12 subVI Node Setu o tions exam le. Show Hel o tion. 8-9 © National Instruments Cor oration                                                                                             . 4-19 to 4 -22 rules governing slicing of arrays. 1-12 rogr amming considerations. 8-4 GPIB Read fun ction. 9-3 hot s ot of Wiring tool. 4-1 range for. 9-3 Index Array function illustration. 1-3 gra hs. 4-23 ty es of gra hs. autoscaling of in ut. 8-19 GPIB Status function. 8-10 I Icon Editor buttons. 8-10 HP34401A Config Trigger VI. 5-3 hierarchy of VIs definition. 8-19 gra h cursors.Index General Error Handler VI. 4-25 intensity lots. 2-3 invoking. 1-27 HP34401A Config Measurement VI. 4-24 gra h indicators. 4-1 i ndicators automatic creation of terminal. 2-2 tools. 5-12 online hel for subVI nodes. limiting objects to. 1-26 Formula node o er ators and functions. See also GPIB. 4-21 to 4-22 slicing dimensions from mult i-dimensional arrays. 5-10 incrementin g faster. 1-17 horizontal motion. 4-2 Greater Or Equal to 0? function. 10-3 ur ose and use. 8-4 using VISA rather than (note). 4-20. 4-2 to 4-3 Get Date/Time String VI. 8-10 to 8-13 front anel. dis laying. 2-7 Index-7 LabVIEW Tutorial Manual H Hel menu. 4-2. 4-23 e xam les in gra hs directory. 1-26 Hel window activating. 4 -7 to 4-8 showing or hiding o tional arts. 7-5 IEEE 488. disabling and enabling one-dimensional (illustration). 4-20 to 4-22 indexes for arrays. 4-12 to 4-14 gra hical rogr amming language (G). 2-2 to 2-3 icons. 7-11 Increment function. 7-8 global variables disadvantages. 2-1 re resenting VIs in block diagram of other VIs. 1-11. 4-5 com ared with charts. Im ort Picture o tion. 8-3 exam les of functions. See also charts. 2-15 Hewlett Packard 34401A Multimeter instrument driver exam le block diagram. 8-10 HP34 401A Read Measurement VI. 4-19 ur ose and use. See also connect ors. See also auto-index ing. 10-2 to 10-3 Horizontal Centers distribution Distribution ring. 4-2 gra h VIs array exam le. 8-20 General Pur ose Interface Bus. 4-3 chec king data ty es for inclusion. 1-3 descri tion. See also GPIB. 7-8 Get O erator Info VI. 4-25 multi lot gra hs. creating. 8-19 GPIB Write function. 4-2 customizing.

8-3 Serial alette. 8-9 ur ose and use. 8-8 to 8-13 available library of drivers. 8-8 using as subVIs. See also VI libraries. 1-16 clicking outsi de text box (note). 3-7 Latch When Pressed action. Match Pattern function. 9-1 rotating through tools in Tools alette. 3-2 entering or chan ging text in string controls. 1-16 creating free label. See also documentation. 1-1 Latch Until Released action. 8-8 Instrument I/O alette G PIB functions. 8-8 Hewlet t Packard 34401A Multimeter exam le. 8-4 intensity gra hs. 3-3 du licating free labels. 1-15 to 1-16 scale for knob. 5-14 leg ends for charts creating for gra h. 3-7 left terminal. 4-14 mechanical actions of Boolean controls. 1-15 re os itioning. 3-14 Boolean controls and indic ators. 5-16 K knob control. 1-4 overview. 1-20 configuring. 5-14 ositioning and modifying. when to use. 4-23 menus for LabVIEW Ctrl key equivalents for menu o tions. While Loo . 11-3 local variables acti ng as multi le terminal to front anel control or indicator. 7-14 disadvantages. 3-4 For Loo . adding to front anel for While Loo . 1-16 LabVIEW Tutorial Manual Index-8 M manual. 9-4 numeric con trols and indicators. 8-9 to 8-13 block diagram. 1-20 fixing incorrectly wired controls. 1-23 owned labels. See also For Loo . 3-3 vertical switch (exam le). 3-21 librari es. © National Instruments Cor oration                                                                       . 8-10 to 8-13 fro nt anel. 1-19 simulating control/indicator. 3-6 to 3-7 memory. 3-14 Legend o tion. Show o -u menu. 7-13 to 7-14 using as o ut uts (note). 1-23 creating owned label for digital indicator. 4-25 iteration ter minal definition. 1-2 training cou rses. L Labeling tool changing font size. 2-5 Initialize Array function.Index avoiding continuous u dating in For Loo (note). 3-14 Mean VI. e fficient usage with arrays. 1-4 how LabVIEW works. 3-15 ur ose. 3-2 LabVIE W files. list controls. shift registers accessing values from revious iterations. 3-10 Formula node exam le. 4-2. 6-1 labels changing font size. 1-3 installation. 3-7 Latch When Released action. 11-2 to 11-3 loo s. 4-11 to 4-12 installation of LabVI EW. 8-12 Max & Min function. 1-4 instrument drivers. 1-16 front anel objects.

1-24. 3-9 numeric controls and indi cators default re resentation. 2-8 Numeric alette. Controls alette. 61 mani ulating slide controls. 1-24. 3-10 modifying numeric format. 7-5 Pi constant. 4-7 to 4-8 While Loo exam le. slicing dimensions from. 8-12 ictures. 3-10 to 3-11 Numeri c alette. 1-23 Positioning tool enlarging string cont rols. 2-8 array created with auto-indexing. 6-7 ath control. 4-5 to 4-6 Case structure exam le. 5-3 O erating tool entering or changing text in string controls. 1-13. 9-3 nudging with arrow keys. 7-10 to 7-12 lots. in tensity lots. 3-24 oint style for charts. 3-16 to 3-22 stack ed vs. 1-8 ur ose and use. 6-1 moving objects in front anel. re lacing. 9-2 icking color from. 3-9 motion. 4-8 Pick Line & A end function. 4-20 t o 4-22 multi lot gra hs array exam le. 3-19 overlaid lots. 6-19 ath. 1-16 P Parse String VI. 4-8 to 49 o -u menus configuring controls and indicators. 1-16 robe debugging subVIs. 6-19 ath indicator. 1-8 owned labels characteris tics.Index 9-2 modular rogramming. 3-13 Formula node exam le. 4-8 Sequen ce structure exam le. 3-19 to 320 Multi ly function adding to block diagram. 7-4 numeric consta nts adding to block diagram. 3-10 to 3-11 ur ose and use. 1-19 numeric conversion. 4-25 line style for charts. 1-24. 1 -23 O objects limiting to horizontal or vertical © National Instruments Cor oration                                                                                                                    . 2-8 olymor hism. 6-19 Patterns o tion. 5-9 While Loo . 5-3 For Loo exam le. 5-5 numeric conver sion. overlaid lots. definition of . 9-4 One Button Dial og function. See also rogram design. mouse button for activating o -u menus. 2-8 Functions alette. See also charts. 3-21 olymor hism. 5-1 5 shift register exam le. 3-18 While Loo exam le. 1-23 multi-dimensional arrays. 1-15 creating for digital indicator. 3-20 shift register exam le. 3-21 order determined by Bundle funct ion in uts. 9-4 Not Equal? function. 1-20 righ t mouse button for activating. im orting into custom controls. 1-20 illustration. 2-9 to 2-1 0 Index-9 LabVIEW Tutorial Manual N nodes. 1-13. 5-10 Not function.

10-1 diagramming style. File menu. 10-2 to 10-3 modular rogramming. 5-7 R ead Characters From File VI ur ose. 1-34 to 1-35 rocedure for. 3 -10 to 3-11 resizing of round LED. See also data flow rogramming. file. 10-3 hierarchical nature o f VIs and. 9-4 re resentation of numeric values default re resentation. 6-10 reading data from file exam le. 1-3 lanning ahead with connector atterns. 10-1 to 10-3 writing the rogram. 2-7 semicolon (. Show o -u menu. 5-5 numeric conversion. 10-5 avoiding Sequence structure overuse. 10-7 to 10-8 left-to-right layouts. 3-5 minimizing s ace required for st ring controls. 1-17 illustration. 1-17 right mouse button for activating o -u menus. 6-2 Select & A end function. 6-18 R ead from Datalog File VI. 1-34 saving VIs libraries for storing VIs. 1-17 Round to Nearest fun ction.) terminating formula statements. 1-30 Rem ove Dimension o tion.. 9-3 when to use. debugging VIs. 9-9 rogram design. 8-12 Select a Control o tion. 7-10 Select a VI o tion. 6-10 Read Lines Fr om File VI. 1-17 resizing. 3-5 scrollbars adding to While Loo . 4-12 Re lace o tion. 10-1 to 10-10. 1-31 S Save o tion. 6-17 to 6-1 8 front anel. 3-4 range error symbol. shift registers. 6-16 to 6-18 block diagram. 1-13. 11-3 rotating through tools in Tools alette. 9-6 Index-10 © National Instruments Cor oration R Random Number (0–1) function For Loo exam le.Index debugging VIs (exam le). 10-10 che cking for errors. 3-14 ring controls adding it ems to. Contr ols alette. 9-1 to 9-5. avoiding global variables. 3-13 Sequence structure exam le. 10-6 to 10-7 studying exam les. 6-19 Remove Bad Wires o tion. 2-6. 5-11 Se arate Array Values VI. Functions alette. 10-1 0 hierarchy design.vi. 59 shift register exam le. Edit menu. 10-7 missing de endencies. 1-23 right terminal. 9-2 round LED changing color. 9-1 rogram design. 6-21 Read From S readsheet File VI. 10-3 creating stub VIs. 10-9 utting common o erations into loo s. 4-9. 3-10 modifying numeric format. 6-10 reading data from file. readme. 3-11 run button. 3-17 While Loo exam le. 10 -2 to 10-3 determining user requirements. See also data flow rogramming. 10-3 rogram design. 10-3 to 10-5 to -down des ign. 10-5 to 10-10 avoiding overlarge diagrams. 11-1 refnums. 5-10 rounding to nearest integer. 3-23 Scrollbar o tion. 1-34 to 1-35 sco e chart mode. 6-17 LabVIEW Tutorial Manual                                                                                                            .

10-10 setting data range. 6-11 to 6-13 block dia gram. 3-14 location on While Loo . 8-6 to 8 -7 front anel. 1-9 strict ty e definition. 1-28 Show VI Info o tion for documenting VIs. re ositioning. 8-20 error checking. 5-5 rogramming considerations. 1-13. 3-20 to 3-22 different chart modes. 3-13 Initialize Array function. 1-16 s readsheet files Read From S readsheet Fil e VI. 6-10 Write To S readsheet File VI. 6-15 to 6-16 front anel. 1-26 Show Icon o tion. Hel Menu. 8-4 serial ort VIs available for seria l communication. 8-5. 1-12. 1-9 without interru ting I/O (note). 8-20 Serial Port Init VI . 4-8 single ste ing through VIs. 9-5 Sto button. 1-8 slide switches. 3-15 adding to For Loo . 3-1 8 For Loo exam le. uses for. 5-9 illustration. 8-4 to 8-7 communication exam le. 9-5. 3-14 to 3-23 ada tation to data ty e of first object. 9-8 to 9-9 slicing dimensio ns from multi-dimensional arrays. saving custom control as. 8-4. 3-15 right terminal. 9-5 ste out button. 1-9 sto ing V Is Acquisition switch. 7-8 to 7-9 timing. 6-10 writing to. Windows menu . 3-22 to 3 -23 multi lot charts. 2-4 Show Diagram o tion. 8-7 Sine function. 8-7 se rial orts. mani ulating.Index sequence local variable creating. 5-17 Serial alette. 1-10 remembering values from reviou s iterations. 3-17 to 3-23 customizing charts. 3-26 to 3-27 Show Connector o tion. 5-7 subVI Node Setu o tions exam le. 5-9 modifying numeric format. 7-14 String & Table alette. 8-5. 8-4 Bytes at Serial Port VI. 5-8 to 5-10 controlling execution order of nodes. 9-5 ste over button. 8-5 to 8-7 block diagram. 3-19 to 3-20 creating. 6-14 Square Root function. 3-14 to 3-15 definition. 3-16 to 3-17 initializing avoiding incor oration of old data (note). 4-11 to 4-12 left terminal. 1-7. 1-32 Sim le Err or Handler VI. 3-14 uninitialized shift registers. 6-1 string constants © National Instruments Cor oration Index-11 LabVIEW Tutorial Manual                                                                                                   . 4-20 to 4-22 slide controls. 1-24 Show Hel o tion. 8-5 serial communication. 5-5 to 5-7 illustration. 5-9 fro nt anel. 1-10. 1-13 Show Terminals o tion. 5-5 to 5-10 block diagram. 8-5. 8-7 Serial Port Write VI. 3-13 block diagram . 8-20 serial ort communication exam le. 5-9 Sequence structure. 8-7. 5-3 ste into button. 8-20 Serial Port Read VI. 8-6. 8-4 shift registers. 1-9 Sto button. 3-14 front anel.

1-25 a ending data to file exam le. 2-6 changing. 2-1. exam les. 2-15 order of execution in data flow rogramming. 9-9 to 9-10 o erating. 7-1 to 7-9 block diagram. 2-6 to 2-7 icon. 3-4 rogramming considerations. 2-12 creati ng. 6-16 Case structur e exam le. 2-4 to 2-5 debugging techni ques. 1-12 to 1-13 itera tion terminal. 3-23 structures. 2-15 o ening. 3-6 Switch When Released action. 2 -11 subVIs. 5-3 string controls and indicators creating. 6-2 String Subset function. 6-1 minimizing s ace. 6-2 to 6-3 subsetting strings. See also VI Setu o tions. 5-10 subVI Node Setu o tions. A-1 Tem erature Status subVI. Se quence structure. See also Case structure. creating string controls and indicators. 1-11. 6-1 stri chart mode. 7-8 to 7-9 front anel. 6-8 String To Byte Array VI. 1-12 assigning to subVI. 2-8 Sequence structure exam le. 2-7 conditional terminal. 3-4 connecting subVIs to other VIs. 7-3 subVI exam le. 3-1 ty es of. See also string function exam les. 2-2 to 2-3 grou ing icons into l ower level VI. 2-12 o ening front anels for debugging. 10-2 to 10-3 Subtract function adding to block diagram. While Loo . 3-6 T technical su ort. 2-1 to 2-17 analogous to subroutines. 6-3 String alette. 6-7 to 6-9 blo ck diagram. 6-3 String Subset. 2-9 to 2-12 front anel. 2-1 hierarchical nature of. 8-22 strings. 3-1 stub VIs. 2-12 u sing VIs as subVIs. 6-2 to 6-3 bloc k diagram. 10-3 to 10-4 shift registers.Index adding to block diagram. 2-6 to 2-16 swee chart mode. 6-8 String Length function. 2-6 online hel for subVI nodes. 2-1 online hel for subVI nodes. 1-12 Tem erature System Demo VI . 6-7 string functions Scan From String. 3-6 Switch When Pressed action. 7 -7 subVI nodes analogous to subroutine call. 2-1 to 2-5 block diagram. 6-8 to 6-9 front anel. 6-8 S tring Length. 6-3 to 6-6 front anel. 2-4 to 2-5 automatic creation for controls and indicators. restricted to one node onl y (note). 2-7 to 2-12 connector. 62 string function exam les converting and concatenating strings. For Loo . 6-1 definiti on. 3-23 Switch Until Releas ed action. 3-1 4 to 3-15 showing while wiring block Index-12 © National Instruments Cor oration LabVIEW Tutorial Manual                                                                             . 1-6 to 1-9 terminals analogous to arameters in subroutines or functions.

block diagram. 8-18 to 8-19 front anel. 1-30 block diagram. 1-24 to 1-31 deleting wires. VIs.lib directory. 1-21 t o 1-35 bad wires. 7-2. 1-4 ty e definition. 1-9 to 1-11 building. 8-17 to 8-19. analogous to functions in rogramming langua ges. training for LabVIEW. 3-8 timing Sequence structure. 1-29 showing terminals. 1-17 Distribution ring. 1-28 wire stretching. 322 U date Period slide control. 8-17 Thermometer indicator. 5-17 While Loo . Execution O tions. 1-31 saving. See also subVIs. 1-34 to 1-35 sto ing. U date Mode submenu. 5-9. limit ing objects to. 8-3 Index-13 LabVIEW Tutorial Manual                                                                     . rotating through tools in. 1-5 to 1-9 hierarchical struct ure definition. See also subVI Node S etu o tions. 1-3 working with. 5-15 Vertical Centers alignment. 1-4 to 1-13. 5-10 Time & Dialog alette. 7-6 global a lication of (note). 1-27 editing. 1-9 VISA exam les of functions.vi exam le. 4-21 Tick Count (ms) function. 7-3 Window O tions. See also shift registers.. 7-6 vi. 1-4 virtual instruments. 2-7 t hree-dimensional array. 1-23 selecting wires. 1-11 to 1-12 icon/connector. 7-1 to 7-2. 5-17 toolbar Alignment ring. 1-20 VI libraries storing VIs in. slicing. 1-3 running. 1-3 block diagram definition. 1-32 to 1-34 front anel. 5-15 length considerations (not e). 1-29 wiring techniques. 1-3 descri tion.Index diagrams. Alignment ring. 1-8 V variable names in Formula node case sensitivity. 1-28 test sequencer VI. VIs. See also frequency res onse tes t VI. 1-12 to 1-13 modul ar nature of. 7-1 VI Setu o tions. 1-1 7 Tools alette. 1-14 to 1-18 featur es. 7-14 U uninitialized shift registers. 1-34 to 1-35 VI Setu o tion. 3-2 illustration. 4-14 tutorial . 5-4 Tutorial alette. 5-4 wiring to out ut tunnel (note). 1-29 document ing VIs. 9-2 to -down design. See also subVIs. 1-1 tunnels defining out ut tunnel for each case (note). saving custom control as. 1-3 descri tion. 1-17 vertical motion.Tem late. 9-3 vertical switch © National Instruments Cor oration adding to front anel. 3-7 to 3-9 Timi ng.llb library. 1-3 front anel definition. See also rogra m design.

9-5 selecti ng wires. 4-2 Y Y button for rescaling Y axis. 8-2 W Wait Until Next ms Multi le function gra h and analysis VI exam le. 1-11 clearing dis lay buffer. 6-16 ur ose. 5-14 tem eratur e waveform chart. adding knob control to front anel. 9-2 dashed wires vs. 4-2 to 4-3. 3-18 subVI Node Setu o tions exam le. 1-29 wiring block diagrams. 3-24 to 3 -25 waveform chart used with. 7-2 setting. 3-1 to 3-5 waveform transfers. 3-3 adding timing. 3-9 waveform gra hs as ty e of gra h. 9-2 segments. 3-1 to 3-5 Window O tions dialog box. 1-30 junction. See als o shift registers. 1-27 bending wires. 4-5 to 4-6 multi lot gra hs. 1-29 tacking wires. 1-11 location in block diagram. 6-10 Write to Datalog File VI. 1-30 deleting wires. 8-22 While Loo . 1-29 LabVIEW Tutorial Manual Index-14 dashed wires vs. 1 0-5 to 10-7 shift registers located on. 1-29. 1-27 to 1-31 bad wires. 3-21 XY gra hs. dotted wires (note). 3-3 to 3-9 Case structure in.Index VISA functions. 3-4 For Loo in. dotted wires (note). 1-29 showing terminals. 7-6 Windows menu. 3-21 © National Instruments Cor oration                                                                                    . 4-13 using in array. 4-14 shift r egister exam le. 8-21 binary waveforms. 1-29 nudging with arrow key s. 3-5 equivalent seudocode. 1-30 basic techniques. 3-7 to 3-9 block diagram. 3-1 to 3-9. 6-10 X X button for rescaling X axis. 7-9 While Loo exam le. 1-10 mechanical action of Boolean switches. 4-2 Formula node. 3-6 to 3-7 rogramming considerations. 1-10 Show VI Info. 1-2 7 Wiring tool hot s ot. 1-27 changing direction of wire with s ace bar. exam le. 1-27 Write Characters to File VI a ending data to file exam le. exam le. 1-28 stretching wires. 8-21 to 8 -22 ASCII waveforms. 6-21 Write to S readsheet File VI exam le. 6-13 ur ose. 1-10 testing before execution. 4-7 to 4-8 While Loo exam le. 1-32 wires branches. 7-2 subVI Node Setu o tions exam le.

Sign up to vote on this title
UsefulNot useful