• No results found

Saving and Loading VIs

In document LabVIEW Tutorial Manual (Page 49-53)

As with other applications, you can save your VI to a file in a regular directory. With LabVIEW, you can also save multiple VIs in a single file called a VI library. The tutorial.llb library is an example of a VI library.

If you are using Windows 3.1, you should save your VIs into VI libraries because you can use long file names (up to 255 characters) with mixed cases.

Otherwise, you should not use VI libraries unless you need to transfer your VIs to Windows 3.1. Saving VIs as individual files is more effective because you can copy, rename, and delete files more easily than if you are using a VI library. For a list of the advantages and disadvantages of using VI libraries and individual files, see the Saving VIs section in Chapter 2, Creating VIs, of the LabVIEW User Manual.

Even though you may not save your own VIs in VI libraries, you should be familiar with how they work. For that reason, you should save all VIs that you create during this tutorial into VI libraries to become familiar with using these libraries.

Save your VI in a VI library.

1. Select File»Save As.... If you are using UNIX, specify a location in the file system where you have write privileges. For example, you might select your home directory.

2. Do not save your files in the examples directory. Instead, create your own directory and label it Tutorial VIs.

3. Create the VI library.

(Windows) Select New... or the New VI Library button to create the VI Library.

(Macintosh) If you use the native file dialog box, Edit»

Preferences...,select Use LLBs to access LabVIEW’s file dialog box. To create the VI library, click on Save»New....

(UNIX) Select Save»New....

01Intro Page 34 Thursday, August 24, 2000 10:04 AM

Chapter 1 Introduction to LabVIEW

© National Instruments Corporation 1-35 LabVIEW Tutorial Manual

4. Enter mywork as the name of the new library in the dialog box and click on the VI Library button. The library name must be followed by an .llb extension. For Windows 3.1, you must limit your library names to eight characters or less. LabVIEW appends the .llb extension if you do not include it.

VI libraries have the same load, save, and open capabilities as directories. VI libraries, however, are not hierarchical. That is, you cannot create a VI library inside of another VI library. You cannot create a new directory inside a VI library, either. There is no way to list the VIs in a VI library outside of the LabVIEW

environment.

After you create a VI library, it appears in LabVIEW’s file dialog box as a folder with VI on the folder icon. Regular directories appear as a folder without the VI label.

5. Name the VI and save it in your new library. Look at the name in the ring control at the top of the dialog box. Make sure it is mywork.llb. If it is not, click on mywork.llb in the directory list to make sure you save your VI in the right place.

a. Type My Thermometer.vi in the dialog box.

b. Click on OK.

6. Close the VI by selecting File»Close.

Directory VI Library file VI

01Intro Page 35 Thursday, August 24, 2000 10:04 AM

Chapter 1 Introduction to LabVIEW

LabVIEW Tutorial Manual 1-36 © National Instruments Corporation

Summary

Virtual instruments (VIs) have three main parts: the front panel, the block diagram, and the icon/connector. The front panel specifies the inputs and outputs of the VI. The block diagram consists of the executable code that you create using nodes, terminals, and wires. With the icon/connector, you can use a VI as a subVI in the block diagram of another VI.

The Tools palette consists of a graphical, floating palette. On the front panel and block diagram, you use tools from the Tools palette to build, edit, and debug VIs. You use the <Tab> key to tab through the commonly used tools on the palette. The most commonly used tools are:

You use the Operating tool to manipulate front panel controls and indicators. You use the Positioning tool to position, resize, and select objects. You use the Labeling tool to create free labels and to enter text in labels. You use the Wiring tool to wire objects together in the block diagram. You use the Color tool to set the foreground and background color of windows, controls, indicators, and so on.

The front panel and block diagram contain toolbars, which display the run button along with other buttons that control the execution of the VI.

In the front panel, you place controls and indicators to denote the inputs and outputs of the VI. You use the Controls palette to add controls and indicators to the front panel. The Controls palette automatically pops up on the front panel when you launch LabVIEW.

You can also access the Controls palette by selecting Windows»Show Controls Palette. Controls and indicators have different options that are configured from their pop-up menus. See the LabVIEW User Manual for more information regarding front panel controls and indicators.

01Intro Page 36 Thursday, August 24, 2000 10:04 AM

Chapter 1 Introduction to LabVIEW

© National Instruments Corporation 1-37 LabVIEW Tutorial Manual

The block diagram contains buttons, which also include features that you can use for execution debugging and single-stepping through VIs.

On the block diagram, you develop your source diagram by connecting nodes and terminals using the Wiring tool. You use the Functions palette to place nodes (structures, functions, and subVIs) on the block diagram. The Functions palette automatically pops up on the block diagram when you open the block diagram. You can also open the Functions palette by selecting Windows»Show Functions Palette.

LabVIEW automatically places terminals, which are associated with the front panel controls and indicators on the block diagram. See the LabVIEW User Manual for more information concerning block diagram programming.

You can modify nearly all LabVIEW objects through their own pop-up menus. You access the pop-up menu by popping up on the object or by using the Object pop-up menu tool.

Popping up on individual components of an object accesses their own pop-up menus. So remember—when in doubt, pop up!

01Intro Page 37 Thursday, August 24, 2000 10:04 AM

© National Instruments Corporation 2-1 LabVIEW Tutorial Manual

In document LabVIEW Tutorial Manual (Page 49-53)

Related documents