Presentation on theme: "Lesson 2 Navigating LabVIEW"— Presentation transcript:
1Lesson 2 Navigating LabVIEW Virtual InstrumentsParts of a VIStarting a VIProject ExplorerFront PanelBlock DiagramSearching PalettesSelecting a ToolDataflowBuilding a Simple VI
2A. Virtual Instruments (VIs) LabVIEW programs are called virtual instruments, or VIsAppearance and operation imitate physical instruments, such as oscilloscopes and digital multimeters
3B. Parts of a VILabVIEW VIs contain three main components: 1. Front Panel 2. Block Diagram 3. Icon/Connector Pane
4B. Parts of a VI – Front Panel User interface for the VIYou build the front panel with controls (inputs) and indicators (outputs)
5B. Parts of a VI – Block Diagram Contains the graphical source codeFront panel objects appear as terminals on the block diagram
6B. Parts of a VI – Icon/Connector Pane Icon: graphical representation of a VIConnector Pane: map of the inputs and outputs of a VIIcons and connector panes are necessary to use a VI as a subVIA subVI is a VI that is inside of another VISimilar to a function in a text-based programming languageIcon Connector Pane
7Demonstration Starting A VI Demonstrate using the Getting Started dialog box and the New dialog box to start a VI.
8D. Project Explorer group together LabVIEW files and non-LabVIEW files Use LabVIEW Projects to:group together LabVIEW files and non-LabVIEW filescreate build specificationsdeploy or download files to targets
9Demonstration Project Explorer Demonstrate creating a project, adding files, and removing files.Demonstration should take ~ 5 minutes. Open the Course project solution file to use for this demonstration. Add a blank VI, an existing VI, a text file, and remove as well. Be sure to demonstrate that changes made to the project in the Items page do not reflect how the files are saved on disk. Also, demo the difference between adding/creating virtual folders and adding an auto-populating folder (see manual description). Demo the difference between the Items page and the Files page (The Files page displays the location of project folders on disk. Project operations on the Files page both update and reflect the contents of the folder on disk). Do not save the project so that you do not affect your project solution.
13E. Front Panel – Controls & Indicators Knobs, push buttons, dials, and other input devicesSimulate instrument input devices and supply data to the block diagram of the VIIndicatorsGraphs, LEDs, and other displaysSimulate instrument output devices and display data the block diagram acquires or generates
14E. Front Panel – Numeric Controls/Indicators The numeric data type can represent numbers of various types, such as integer or realNumeric ControlIncrement/Decrement ButtonsNumeric Indicator
15E. Front Panel – Boolean Controls/Indicators The Boolean data type represents data that only has two parts, such as True and False or On and OffUse Boolean controls and indicators to enter and display Boolean (True or False) valuesBoolean objects simulate switches, push buttons, and LEDsBooleanControlBooleanIndicator
16E. Front Panel – StringsThe string data type is a sequence of ASCII charactersUse string controls to receive text from the user such as a password or user nameUse string indicators to display text to the user
17E. Front Panel – Shortcut Menus All LabVIEW objects have associated shortcut menusAs you create a VI, use the shortcut menu items to change the look or behavior of front panel and block diagram objectsTo access the shortcut menu, right-click the object
18E. Front Panel – Property Dialog Box Right-click a front panel object and select Properties to displayThe options available on the property dialog box are similar to the options available on the shortcut menu for that object
19F. Block Diagram Block diagram objects include the following: TerminalsSubVIsFunctionsConstantsStructuresWires
20F. Block Diagram – Functions Palette Contains the VIs, functions, and constants you use to create the block diagram
21F. Block Diagram – Block Diagram Toolbar Be sure to mention the new Block Diagram Cleanup button.
22F. Block Diagram – Terminals Terminals are:Block diagram appearance of front panel objectsEntry and exit ports that exchange information between the front panel and block diagramAnalogous to parameters and constants in text-based programming languagesChange the view type of a terminal by toggling the View as Icon selection from the context menu
24F. Block Diagram – Nodes Nodes Objects on the block diagram that have inputs and/or outputs and perform operations when a VI runsAnalogous to statements, operators, functions, and subroutines in text-based programming languagesNodes can be functions, subVIs, or structuresNodes
25F. Block Diagram – Function Nodes Fundamental operating elements of LabVIEWDo not have front panels or block diagrams, but do have connector panesDouble-clicking a function only selects the function – does not open it like a VIHas a pale yellow background on its icon
26F. Block Diagram – SubVI Nodes SubVI: VIs that you build to use inside of another VIAny VI has the potential to be used as a subVIWhen you double-click a subVI on the block diagram, you can view the front panel and block diagram of the subVIThe upper right corner of the front panel and block diagram displays the icon for the current VIThis is the icon that appears when you place the VI on a block diagram as a subVI
27F. Block Diagram – SubVI Nodes Express VIs are a special type of subVIRequire minimal wiring because you configure them with dialog boxesSave the configuration of an Express VI as a subVIIcons for Express VIs appear on the block diagram as icons surrounded by a blue field
29F. Block Diagram – Wires DBL Numeric Integer Numeric String Scalar Transfer data between block diagram objects through wiresWires are different colors, styles, and thicknesses, depending on their data typesA broken wire appears as a dashed black line with a red X in the middleDBL Numeric Integer Numeric StringScalar1D Array2D Array
30F. Block Diagram – Wiring Tips Press <Ctrl>-B to delete all broken wiresRight-click and select Clean Up Wire to reroute the wire
31Exercise 2-1: Exploring a VI Concept Exercise Identify the parts of an existing VI.
32G. Searching for Controls, VIs & Functions Find controls, functions, and VIs using the Search button on the Controls and Functions palette.You can also use <ctrl + spacebar> to launch the search feature.
33Exercise 2-2: Navigating Palettes Concept Exercise Learn to use the palettes and search for controls, functions and VIs.
34H. Selecting A ToolCreate, modify, and debug VIs using the tools provided by LabVIEWA tool is a special operating mode of the mouse cursorThe operating mode of the cursor corresponds to the icon of the tool selectedWhen using the Automatic Tool Selection, LabVIEW chooses which tool to select based on the current location of the mouse
35Exercise 2-3: Selecting A Tool Concept Exercise Gain experience using the Automatic Tool Selection to select which tool to use.
36I. Dataflow LabVIEW follows a dataflow model for running VIs A node executes only when data are available at all of its input terminalsA node supplies data to the output terminals only when the node finishes execution
37I. Dataflow – Quiz Which node executes first? Add Subtract Random NumberDivideSine
38I. Dataflow – Quiz Answers NO CORRECT ANSWERWhich node executes first?Add – possiblySubtract – definitely notRandom Number – possiblyDivide – possiblySine – definitely not
39Exercise 2-4: DataflowConcept Exercise Understand how dataflow determines the execution order in a VI.
41J. Building a Simple VI – Acquire Acquire Express VIs:DAQ Assistant Express VIInstrument I/O Assistant Express VISimulate Signal Express VIRead from Measurement File Express VI
42J. Building a Simple VI – Analyze Analyze Express VIs:Amplitude and Level Measurements Express VIStatistics Express VISpectral Measurements Express VITone Measurements Express VIFilter Express VI
43J. Building a Simple VI – Present Present tasks are Express VIs that perform a function or indicators that present data on the front panel of the VIIndicators include the Waveform Chart, the Waveform Graph, and the XY GraphExpress VIs include the Write to Measurement File Express VI, Build Text Express VI, DAQ Assistant Express VI, and the Instrument I/O Assistant Express VI
44J. Building A Simple VI – Running Place Express VI on the block diagramConfigure the dialog box that opensWire Express VIs togetherSave and run the VIThe Run button appears broken when the VI you are creating or editing contains errors
45Demonstration DAQ Signal Accessory Demonstrate the different aspects of the DAQ Signal Accessory.
46Exercise 2-5: Simple Acquire, Analyze, and Present VI Create a simple VI that acquires data, analyzes data, and presents the results.
47Summary—Quiz Which function executes first: Add or Subtract? UnknownWhich function executes first: Sine or Divide?SineDivide
48Summary—Quiz Answers Which function executes first: Add or Subtract? UnknownWhich function executes first: Sine or Divide?SineDivide
49Summary—Quiz Which of the following functions executes first? Random NumberDivideAddUnknownWhich of the following functions execute last?Subtract
50Summary—Quiz Answers Which of the following functions executes first? Random NumberDivideAddUnknownWhich of the following functions execute last?Subtract
51Summary—Quiz What are the three parts of a VI? Front Panel Block DiagramProjectIcon/Connector Pane
52Summary—Quiz Answer What are the three parts of a VI? Front Panel Block DiagramProjectIcon/Connector Pane