Summary
- Virtual instruments (VIs) contain three main components-the front panel, the block diagram, and the icon and connector pane.
- The front panel is the user interface of a VI and specifies the inputs and displays the outputs of the VI.
- The block diagram contains the graphical source code composed of nodes, terminals, and wires.
- Use the
Toolspalette to create, modify, and debug VIs. Press theShiftkey and right-click to display a temporary version of theToolspalette at the location of the cursor. - Use the
Controlspalette to place controls and indicators on the front panel. Right-click an open space on the front panel to display theControlspalette. - Use the
Functionspalette to place VIs and functions on the block diagram. Right-click an open space on the block diagram to display theFunctionspalette. - Use the
Searchbutton on theControlsandFunctionspalettes to search for controls, VIs, and functions. - All LabVIEW objects and empty space on the front panel and block diagram have associated shortcut menus, which you access by right-clicking an object, the front panel, or the block diagram.
- Use the
Helpmenu to display theContext Helpwindow and the LabVIEW Help, which describes most palettes, menus, tools, VIs, functions, and features. - Select
Help>>Search the LabVIEW Bookshelfto display the LabVIEW Bookshelf, which you can use to search PDF versions of all the LabVIEW manuals and Application Notes. - You build the front panel with controls and indicators, which are the interactive input and output terminals of the VI, respectively.
- Control terminals have a thicker border than indicator terminals. To change a control to an indicator or to change an indicator to a control, right-click the object and select
Change to IndicatororChange to Controlfrom the shortcut menu. - The block diagram is composed of nodes, terminals, and wires.
- The broken
Runbutton appears on the toolbar to indicate the VI is broken. Click the brokenRunbutton to display theError listwindow, which lists all the errors. - Use execution highlighting, single-stepping, probes, and breakpoints to debug VIs by animating the flow of data through the block diagram.
Tips and Tricks
Operating
- Frequently used menu options have equivalent keyboard shortcuts. For example, to save a VI, you can select
File>>Saveor press theCtrl-Skeys. Common keyboard shortcuts include the following:
- Ctrl-R: Runs a VI.
- Ctrl-E: Toggles between the front panel and block diagram.
- Ctrl-H: Toggles display of the
Context Helpwindow. - Ctrl-B: Removes all broken wires.
- Ctrl-F: Finds VIs, globals, functions, text, or other objects loaded in memory or in a specified list of VIs.
- To increment or decrement numeric controls faster, use the
OperatingorLabelingtools to place the cursor in the control and press theShiftkey while pressing the up or down arrow keys. - You can disable the debugging tools to reduce memory requirements and to increase performance slightly. Select
File>>VI Properties, selectExecutionfrom the top pull-down menu, and remove the checkmark from theAllow Debuggingcheckbox.
Wiring
- Click the
Show Context Help Windowbutton on the toolbar to display theContext Helpwindow. Use theContext Helpwindow to determine which terminals are required. Required terminals are bold, recommended connections are plain text, and optional connections are dimmed. - Press the spacebar to toggle the wire direction.
- To move objects one pixel, press the arrow keys. To move objects several pixels, press the
Shiftkey while you press the arrow keys. - To cancel a wire you started, press the
Esckey, right-click, or click the terminal where you started the wire. - Use the tip strips that appear as you move the
Wiringtool over terminals. - Display the connector pane by right-clicking the node and selecting
Visible Items>>Terminalsfrom the shortcut menu. - You can bend a wire by clicking to tack the wire down and moving the cursor in a perpendicular direction. To tack down a wire and break it, double-click.
Editing
- Use the following shortcuts to create constants, controls, and indicators:
- Right-click a function terminal and select
Create>>Constant,Create>>Control, orCreate>>Indicatorfrom the shortcut menu. - Drag controls and indicators from the front panel to the block diagram to create a constant.
- Drag constants from the block diagram to the front panel to create a control.
- Right-click a function terminal and select
- To duplicate an object, press the
Ctrlkey while using the Positioning tool to click and drag a selection. - To restrict an object's direction of movement horizontally or vertically, use the
Positioningtool to select the object and press theShiftkey while you move the object. - To keep an object proportional to its original size as you resize it, press the
Shiftkey while you drag the resizing handles or circles. - To resize an object as you place it on the front panel, press the
Ctrlkey while you click to place the object and drag the resizing handles or circles. - To replace nodes, right-click the node and select
Replacefrom the shortcut menu. - To display the block diagram of a subVI from the calling VI, press the
Ctrlkey and use theOperatingorPositioningtool to double-click the subVI on the block diagram. - To display the front panel of a subVI from the calling VI, use the
Operating or Positioningtool to double-click the subVI on the block diagram. You also can selectBrowse>>This VI's SubVIs. - After you type a label, press the
Enterkey to end text entry. - To add items quickly to ring controls and
Casestructures, press theShift-Enterkeys after each item. PressingShift-Enteraccepts the item and positions the cursor to add the next item. Refer to Making Decisions in a VI for more information aboutCasestructures. - To copy the color of one object and transfer it to a second object without using a color picker, use the
Color Copytool to click the object whose color you want to copy. Use theColoringtool to click the object to which you want to apply the color. You also can copy the color of one object by using theColoringtool and pressing theCtrlkey. - Select
Edit>>Undoif you make a mistake. - To create more blank space on the block diagram, press the
Ctrlkey while you use thePositioningtool to draw a rectangle on the block diagram.
Debugging
- When single-stepping, use the following keyboard shortcuts:
- Ctrl-down arrow: Steps into a node.
- Ctrl-right arrow: Steps over a node.
- Ctrl-up arrow: Steps out of a node
0 comments:
Post a Comment