Virtual Instrumentation With Labview
Virtual Instrumentation With Labview
Course Goals
Understand the components of a Virtual Instrument Introduce LabVIEW and common LabVIEW functions Build a simple data acquisition application Create a subroutine in LabVIEW
Section I
LabVIEW terms Components of a LabVIEW application LabVIEW programming tools Creating an application in LabVIEW
VI Front Panel
Panel Toolbar
Boolean Control
Double Indicator
Waveform Graph
VI Block Diagram
Numeric Constant
While Loop
Functions Palette
(Diagram Window)
Graphical, floating palettes Used to place controls & indicators on the front panel, or to build the block diagram
Tools Palette
Floating Palette Used to operate and modify front panel and block diagram objects.
Automatic Selection Tool Operating Tool Positioning/Resizing Tool Labeling Tool Wiring Tool Shortcut Menu Tool Scrolling Tool Breakpoint Tool Probe Tool Color Copy Tool Coloring Tool
Status Toolbar
Run Button Continuous Run Button Abort Execution Pause/Continue Button Text Settings Align Objects Distribute Objects Reorder Execution Highlighting Button Step Into Button Step Over Button Additional Buttons on the Diagram Toolbar
Creating a VI
Front Panel Window
Control Terminals
Indicator Terminals
Dataflow Programming
Block diagram does NOT execute left to right
Node executes when data is available to ALL input terminals Nodes supply data to all output terminals when done
Exercise 1 - Convert C to F
Section II SubVIs
What is a subVI? Making an icon and connector for a subVI Using a VI as a subVI
SubVIs
A SubVI is a VI that can be used within another VI Advantages
Modular Easier to debug Dont have to recreate code Require less memory
Icon Terminals
An icon represents a VI in other block diagrams A connector shows available terminals for data transfer
Connector
SubVIs
SubVIs
Assign Terminals
Save The VI
Choose an Easy to Remember Location Organize by Functionality
Save Similar VIs into one directory (e.g. Math Utilities)
Organize by Application
Save all VIs Used for a Specific Application into one directory or library file (e.g. Lab 1 Frequency Response)
Library Files (.llbs) combine many VIs into a single file, ideal for transferring entire applications across computers
Tab Key Toggle Through Tools on Toolbar Tools Options Set Preferences in LabVIEW VI Properties Configure VI Appearance, Documentation, etc.
Computer
Hardware Connections
BNC-2120 SC-2075
SCB-68
Loops
While Loops
Have Iteration Terminal Always Run Once Run According to Continue Terminal
For Loops
Have Iteration Terminal Run According to input N
Loops (cont.)
1. Select the loop 2. Enclose Code to Repeat
For Loop
Charts
Waveform chart special numeric indicator that can display a history of values Controls >> Graphs >> Waveform Chart
Exercise 3
Students build Temperature Monitor.vi.
Creating 2D Arrays
File I/O
File I/O passing data to and from files - Files can be binary, text, or spreadsheet Write to a spreadsheet file Read from a spreadsheet file
File I/O
Easy File I/O VIs