CS320n - PowerPoint PPT Presentation

About This Presentation
Title:

CS320n

Description:

CS320n Visual Programming More LabVIEW Foundations – PowerPoint PPT presentation

Number of Views:73
Avg rating:3.0/5.0
Slides: 14
Provided by: ScottM161
Category:

less

Transcript and Presenter's Notes

Title: CS320n


1
CS320n Visual Programming
  • More LabVIEW Foundations

2
What We Will Do Today
  • Look at some more features of LabVIEW
  • Work on exercises involving debugging and
    creating sub VIs

3
VI Libraries
  • VIs can be saved as individual programs
  • A group of VIs can be saved together as a VI
    library
  • creating -gt an option in the save window
  • opening -gt open as regular file, then select
    which VI to open from library

4
From Last Time
  • Some functions have a variable number of inputs
  • The string concatenation function
  • When opened notice blue dots on top and bottom
  • function can be expanded for more inputs
  • note visual cue on order of inputs in result for
    three input function

5
Debugging
  • VIs that are broken cannot be run
  • analogous to syntax error in text based
    programming languages
  • Most common mistakes
  • required input missing on function terminals (for
    example, add)
  • type mismatch on data (wire double when integer
    was expected
  • loose, unconnected wires
  • sub VI is broken
  • multiple inputs into a single indicator

6
Broken Programs
  • Clicking on the broken arrow brings up a list of
    errors
  • Clicking on an error displays more information
    about the error

7
Stepping Through a Program
  • Sometimes you want to observe a program step by
    step, not all at once
  • Click on the single set button instead of the run
    button
  • Press the single step button to see the flow of
    the program

8
Execution Highlighting
  • Another excellent debugging tool is Execution
    Highlighting
  • aside why no debugging tools in Alice?
  • Select Highlight Execution and data values and
    movement shown as program runs. Very useful
  • Can be used as program runs or combined with
    stepping through program

9
Probes
  • To view the value on a wire or result of a
    function you can either set up an indicator or
    use a probe
  • With a running program, probe is auto selected
    when putting the cursor near a wire
  • When the program is not running probes can be
    added.
  • choose the Window menu
  • select Show Tools Palette
  • click on the probe tool to add probes
  • be sure to change Tool back to auto select when
    finished

probe
10
Breakpoints
  • Suppose you want to stop the program at a single
    point, deep into the execution
  • using the step by step control is a pain
  • set a breakpoint
  • right click or use breakpoint tool
  • program will run normally until it hits that
    point

break point on wire and function
11
Creating sub VIs
  • If you create a program and want to use that in
    other program you can create a Sub VIs
  • steps in creating a sub VI
  • assign VI controls and indicators to wire
    terminals on its connector pane so that data can
    be passed into and out of the VI
  • create an icon for the VI

12
C to F
  • Create icon
  • right click on icon in upper right corner and
    select Edit Icon

13
Assign Connectors
  • Defining parameters
  • like in Alice
  • Right click icon on the front panel. (Not the
    block diagram.)
  • Select Show Connector
  • two terminals
  • input / control on left
  • output / indicator on right
  • click in left hand terminal / box on icon and
    select front panel control to set
  • repeat for right hand side terminal
Write a Comment
User Comments (0)
About PowerShow.com