Presentation is loading. Please wait.

Presentation is loading. Please wait.

EET 2259 Unit 2 Virtual Instruments

Similar presentations


Presentation on theme: "EET 2259 Unit 2 Virtual Instruments"— Presentation transcript:

1 EET 2259 Unit 2 Virtual Instruments
Read Bishop, Chapter 2. Lab #2 and Homework #2 due next week. Quiz #1 next week. -Any problems with website or installing LabVIEW?

2 Virtual Instruments Remember, LabVIEW programs are called virtual instruments, or VIs for short. Recall that every VI has a front panel (user interface) and a block diagram (program code).

3 Items on Front Panel The front panel contains controls and indicators.
Controls are inputs that let the user enter data, such as switches, knobs. Indicators are outputs that display data to the user, such as graphs, numeric displays. (Bishop, p. 62) -Have them use Example Finder on start-up screen to search for “tanks” and open Tank Simulation.vi. Note many numeric controls on left, and chart indicators on right. -Note that this example is a simulation, but could be adapted to control a real industrial process.

4 Controls Palette Use the controls palette to place controls or indicators on the front panel. (Open palette by View > Controls Palette or by right-clicking a blank area on front panel.) (Bishop, p. 62) -Open a blank vi and demonstrate. -Show how to pin down the palette if you want it to stay. -Note that it’s called “Controls Palette” but it also contains indicators. -All items except Decorations have corresponding terminals on block diagram.

5 Finding Controls & Indicators
On the controls palette, under Modern, the most commonly used controls and indicators are grouped into three categories: Numeric, Boolean, and String & Path. Our next three labs will concentrate on these three “data types.” -Look in each one. -Note that there’s some duplication; some controls and indicators can be found in two (or more) places on the palettes. -A big part of learning LabVIEW is knowing which controls & indicators are available, and being able to find them.

6 Search Button on Controls Palette
The Search button lets you find controls or indicators by name. (Bishop, p. 64) Demonstrate. (Use “knob” for search term.)

7 Items on Block Diagram The block diagram contains items connected by wires. Most items on the block diagram fall into one of four categories: Built-in functions (such as multiplication) SubVIs (A subVI is a smaller program contained within a bigger program.) Express VIs (a special type of subVI) Terminals representing front-panel controls or indicators, or constant values (Bishop, pp ) Point out these four categories on block diagram for Tank Simulation.vi. Good programming practice is to build a complex program in independent parts, which are subVIs. (We’ll study subVIs in detail in Chapter 4.)

8 Distinguishing Functions from SubVIs (Part 1)
On block diagrams, built-in functions have a pale yellow background By default, subVIs have a white background (except for Express VIs, which have a blue background). (Bishop, p. 70) -Demo on block diagram for Tank Simulation.vi. Also show that the name of a subVI ends in “.vi” in the context help window when you roll mouse over it. -For examples of some Express VIs, open Lab1Lissajous.vi.

9 Distinguishing Functions from SubVIs (Part 2)
When you double-click a function, nothing happens. When you double-click a standard subVI, the front panel for the subVI opens. (Remember, a subVI is a complete program with its own front panel and block diagram.) When you double-click an Express VI, a dialog box opens to let you configure it. (Bishop, p. 70) Demo on block diagrams for Tank Simulation.vi and Lab1Lissajous.vi.

10 Functions, SubVIs, and Express VIs
Functions: Can’t be customized. Standard subVIs: You can rewire the block diagram to customize. Express VIs: You use dialog box to customize.

11 Icons vs. Expandable Nodes
Standard subVIs and Express VIs can be displayed either as icons or as expandable nodes. To change display, right-click and select (or deselect) “View As Icon.” See examples on next slide. (Bishop, p. 70) -Example on next slide.

12 Example: Icons vs. Expandable Nodes
Same VI, viewed three different ways. Icon Expandable Node Expanded Node -Obviously, icons take up the least space, but expanded nodes give more info. -Demo on block diagrams for Tank Simulation.vi and Lab1Lissajous.vi.

13 Colors for Data Types Terminals and wires are color-coded to show what type of data they carry: Blue = integer Orange = floating point number Green = Boolean (true/false) Pink = String (text) Blue & White Dashed = Dynamic (for Express VIs) Usually two terminals can be connected together by a wire only if they’re the same data type. (Bishop, p. 72) -Example: On a blank VI, try to wire a numeric control to a Boolean indicator; you’ll get broken wire. -For more complete list and info on data types, go to Help > Search the LabVIEW Help… and then look for “data types” in index.

14 Terminals A terminal on a block diagram is a connection point for a wire. There are several kinds of terminals, including: Constants Control terminals for inputs from front panel Indicator terminals for outputs to front panel Node terminals on functions or subVIs (Bishop, p. 71) Next few slides go through these types.

15 Control Terminals A control terminal has an arrow pointing out to the right. There’s a control terminal on the block diagram for each control on the front panel. On front panel, can right-click and choose “Find Terminal.” On block diagram, can right-click and choose “Find Control.” (Bishop, p. 72) Demo on block diagram for Tank Simulation.vi.

16 Indicator Terminals An indicator terminal has an arrow pointing in from the left. There’s an indicator terminal on the block diagram for each indicator on the front panel. On front panel, can right-click and choose “Find Terminal.” On block diagram, can right-click and choose “Find Indicator.” (Bishop, p. 72) Demo on block diagram for Tank Simulation.vi.

17 Icons vs. Data Type Terminals
On the block diagram, control terminals and indicator terminals can be displayed either as icons or as data type terminals. To change display, right-click and select (or deselect) “View As Icon.” (Bishop, p. 72) Obviously, icon is more informative but takes up more space. Icon Data Type Terminal

18 Terminals on Functions or SubVIs (Part 1)
Functions and subVIs also have terminals where wires can connect to them. By convention, inputs are placed on the left and outputs are on the right.

19 Terminals on Functions or SubVIs (Part 2)
To show terminals more clearly, right-click and select “Visible Items” > “Terminals” Note thin border for input terminals, thick border for output terminals.

20 Dataflow Programming In traditional text-based programming languages, the order of the statements determines the order in which they’re executed. In LabVIEW’s graphical language, the layout on the page does not tell you the order of execution. Rather, a node executes whenever all of its inputs are available. (Bishop, pp )

21 Highlight Execution Button
To watch the order in which nodes are executed in the block diagram, click the Highlight Execution button on block diagram’s toolbar and then run the VI. (Bishop, p. 84) Demo on block diagram for Tank Simulation.vi. Click on Highlight Execution button; data flow is animated using bubbles. Values are displayed on wires.


Download ppt "EET 2259 Unit 2 Virtual Instruments"

Similar presentations


Ads by Google