The Toolbar


The Toolbar, located at the top of LabVIEW windows, contains buttons you will use to control the execution of your VI, as well as text configuration options and commands to control the alignment and distribution of objects (see Figure 3.59). You'll notice that the Toolbar has a few more options in the block diagram than in the front panel, and that a few editing-related options disappear when you run your VI. If you're not sure what a button does, hold the cursor over it until a tip strip appears, describing its function.

Figure 3.59. Toolbar


Run Button

Run Button (Active)

Run Button (Broken)

The Run button, which looks like an arrow, starts VI execution when you click on it. It changes appearance to active when a VI is actually running. When a VI won't compile, the run button appears broken.

Continuous Run Button

The Continuous Run button causes the VI to execute over and over until you hit the stop button. It's kind of like a GOTO statement (sort of a "programming no-no"), so use it sparingly.

Abort Button

The Abort button, easily recognizable because it looks like a tiny stop sign, becomes active when a VI begins to execute; otherwise, the Abort button is grayed out. You can click on this button to halt the VI.

Using the Abort button is like pulling the power cord on your computer. Your program will stop immediately rather than coming to a graceful end, and data integrity can be lost this way. You should always code a more appropriate stopping mechanism into your program, as we will demonstrate later.


Pause Button

The Pause button pauses the VI so that you can use single-step debugging options such as step into, step over, and step out. Hit the Pause button again to continue execution.

Step Into Button

Step Over Button

Step Out Button

The single-step buttonsStep Into, Step Over, and Step Outforce your VI to execute one step at a time so you can troubleshoot. We'll talk more about how to use them in Chapter 5, "Yet More Foundations."

Execution Highlight Button

The Execution Highlight button causes the VI to highlight the flow of data as it passes through the diagram. When execution highlight is on, you can see intermediate data values in your block diagram that would not otherwise appear.

Retain Wire Values

The Retain Wire Values button causes the VI's wires to store the value that flowed through them the last time the VI executed. This is very useful for debugging. You can view the value stored in a wire by placing a probe on the wire. The probe value will be set to the value stored in the wire.

Warning Button

The Warning button appears if you have configured your VI to show warnings and you have any warnings outstanding. You can list the warnings by clicking on the button. A warning is not an error; it just alerts you that you are doing something you may not have intended (for example, if there are objects on the block diagram that are hidden behind other objects and cannot be seen).

You can change the font, size, style, justification, and color of LabVIEW text from the Text Settings button on the Toolbar (see Figure 3.60).

Figure 3.60. Text Settings button


LabVIEW has an automatic alignment mechanism to help you line up and evenly space your icons. Select the objects you want to align by dragging around them with the Positioning tool, then go to the Align Objects button on the Toolbar and choose how you want to align them (top edges flush, left edges flush, vertical centers, etc.). If you want to set uniform spacing between objects, use the Distribute Objects button in a similar fashion (see Figure 3.61).

Figure 3.61. The Align Objects and Distribute Objects buttons


For resizing multiple objects to the same size, use the Resize Objects button (see Figure 3.62). You can resize to the maximum height and/or width, the minimum height and/or width, or you can explicitly set the width and height values using the Set Width and Height option (not shown in Figure 3.62) of the Resize Objects submenu.

Figure 3.62. Resize Objects button


In a similar fashion, LabVIEW lets you group objects together to treat them as one control for graphical editing purposes, as well as set the depth order (often called the Z-order) of objects, so that you can specify what objects should go in front of or behind others. You can do this with the Reorder Objects button (see Figure 3.63).

Figure 3.63. Reorder Objects button


Run Mode and Edit Mode

When you open a VI, it opens in edit mode so you can make changes to it. When you run a VI, it automatically goes into run mode and you can no longer edit. Only the Operating tool is available on the front panel when the VI is in run mode. When your VI completes execution, your VI reverts to edit mode (unless you manually switched it to run mode before you ran itthen it stays in run mode). You can switch to run mode by selecting Change to Run Mode from the Operate menu; switch to edit mode by choosing Change to Edit Mode. To draw a parallel with text-based languages, if a VI is in run mode, it has been successfully compiled and awaits your command to execute. Most of the time, you will not need to concern yourself with run and edit modes. But if you accidentally find that you suddenly have only the Operating tool, and you can't make any changes, at least now you'll know why.

If you prefer to open VIs in run mode (perhaps so uninvited users can't make changes), select Options. . . from the Tool menu. Go to the Miscellaneous options and choose "Open VIs in Run Mode."





LabVIEW for Everyone. Graphical Programming Made Easy and Fun
LabVIEW for Everyone: Graphical Programming Made Easy and Fun (3rd Edition)
ISBN: 0131856723
EAN: 2147483647
Year: 2006
Pages: 294

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net