Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS320n –Visual Programming More LabVIEW Foundations.

Similar presentations


Presentation on theme: "CS320n –Visual Programming More LabVIEW Foundations."— Presentation transcript:

1 CS320n –Visual Programming More LabVIEW Foundations

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

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

4 Visual ProgrammingLabVIEW Foundations4 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 Visual ProgrammingLabVIEW Foundations5 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 Visual ProgrammingLabVIEW Foundations6 Broken Programs Clicking on the broken arrow brings up a list of errors Clicking on an error displays more information about the error

7 Visual ProgrammingLabVIEW Foundations7 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 Visual ProgrammingLabVIEW Foundations8 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 Visual ProgrammingLabVIEW Foundations9 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 Visual ProgrammingLabVIEW Foundations10 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 Visual ProgrammingLabVIEW Foundations11 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 Visual ProgrammingLabVIEW Foundations12 C to F Create icon –right click on icon in upper right corner and select “Edit Icon”

13 Visual ProgrammingLabVIEW Foundations13 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


Download ppt "CS320n –Visual Programming More LabVIEW Foundations."

Similar presentations


Ads by Google