LabVIEW Intro

LabVIEW Intro - ž LabView 8.0 ) ß ( e Interactive guide...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ž LabView 8.0 ) ß ( e Interactive guide to LabView N > Iß l 1 ! "# # $$*+ , #$$ $ # %& ! ' ( ) -' . .! / 0 1 2 ". - ' ., ., .! . + 1 3' 2 / ! 8 . . ' ./ 0 1 2 . . .. . . 4' ..' ' . ./ 0 1 5. . 6 7. ' 7. . ' .8 .( .! ' . .3 .8 ' .0 1 . . .2 . . . .0 ' .1 ' ./ 0 1 2 . ' . 2 ., ' ' . ' . ' . 2 / / 01 2 . . . ./ 01 2 . .. 01 2 . . . ./ 0 1 2 3 ! 9 . '. ' . .: ' . .. . . .. ' . . 4' . . ' .; .1 ' .. .. 4' . . ' . .. .. . ' .-. - . 4' . .& 7. . .- .. . .' .. ' ' .; . . . . 6. . . 6. . ' ' . 7. 7. .; .3 7. . .. . . . . ' . ' .. ' . . .. . 5. . . . . ' ..: ' . . . 6. . . .: 7. ' .; . . .9 7. ' .. ' .: ' . . ' . .< .. . .3 '. ' .. .. . 4' 7. . . . . . ' ... . .. ..: ' ' . .. ., 4 ' . .1 ' 9 < / .' .. . . 7. . .6 ' . . . 6. . . . 5.. . 7. ' . . ' . 01 2 . .. . . .: 7. 6. ' 6. . . .' .. ' .. ' .. . 6 .: . . . . 6. . .1 .6 '.. ' . . 6. . . . .1 .6 ' . . 7.6 ' . . . ' . .. . . ' . .'.. 6. . . .. 5.. 6. .. . . ' 6 . .' '. 6. . ... . .. . . . . 5. . . .. . 6. .. ' . . . . .9 ./ 0 1 2 . .2 . .. .. 6. . . ' . ' . .8 . .= ' 6 .9 .< ' . .! 6 . > ' 4 ./ 0 1 2 6 .9 . ' ' @. . .' . 6 .. . .? . .' '. .. . ' . 7. . .... . . .. . 7. . .' . .. .. .9 . ' . . . . ." . @. . . .?9 .# .0 1. . . ' .5 . .: '. ' .?0 1@7. . . A . . .' . .? ' .9 . . .. ' . .' ' . . . . . . .'. .. . ... '.. . . . ' .; .9 . . : 7. . . : . . . .? .$ . 6 . 6. . . . ' ' @.9 . .:.. .. . . . .. . . 5. . 5. .. . @. . ' .; .. .8 . . .9 A< ' .= ' .8 ! Front Panel " % & • Controls = Inputs • Indicators = Outputs Block Diagram • Accompanying “program” for front panel • Components “wired” together 5 ' .8 9 3 . ! 1 B / 2B 8 / , / () 3 ! 9 5. . Nodes Nodes !' ,' 01 B 9 2 ! . 2 ./ ,'' <' . 9 ' . 3 9 . . 6 () 3 ! 9 5. . wires wires !' ,' 01 B 9 2 ! . 2 ./ ,'' <' . 9 ' . 3 9 . . ) * 7 () Control Control terminals terminals Terminals: links between block erminals: diagram and the front panel diagram Indicator Indicator terminals terminals Front Panel Window Terminals: links between block erminals: diagram and the front panel diagram Block Diagram Window Control Control terminals terminals Indicator Indicator terminals terminals 8 + .0 1 . , .0 1 . ' ' / 0 1 2 D. . : , ' - .0 1 . . ' C .0 1 . ' . . . . . 5. ' C . . 6. .. . Function Express VI Express Standard VI ' Controls Palette (Front Panel Window) ! Functions Palette (Block Diagram Window) 9 ! • 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 Run Button Continuous Run Button Abort Execution Pause/Continue Button Text Settings Align Objects Distribute Objects Reorder Resize front panel objects Additional Buttons on the Diagram Toolbar Execution Highlighting Button Step Into Button Step Over Button Step Out Button 10 - . Example finder Front Panel Window Block Diagram Window Control Terminals Indicator Terminals 11 / () / Wiring “Hot Spot” () Click To Select Wires Use Automatic Wire Routing Clean Up Wiring 12 ) 3 5. ! .: ' . . . . .. 5. . .< & 9 . : ' . .. .: < .' . . . . //. 6. . ' . '. .. D. < . . .' '. 0 • • • • Context Help Online help Lock help Simple/Complex Diagram help Ctrl + H Online reference • All menus online • Pop up on functions in diagram to access online info directly 13 + 12 C ' C ) • Finding Errors 3 Click on broken Run button Window showing error appears • Execution Highlighting Click on Execution Highlighting button; data flow is animated I Section using bubbles. Values are displayed on wires. • Probe Right-click on wire to display probe and it shows data as it flows through wire segment You can also select Probe tool from Tools palette and click on wire 14 / 2 . . . ' 0 1% =5 .. . . . . .' 01 + . .0 1. . . ' 0 1 15 () 1 4 .< : .< . ............................... : .B , .0 17.E .. 3' . . ' .0 1 . . .. . .: . 6 .0 1 .0 1 • A SubVI is a VI that can be used within another VI • Similar to a subroutine • Advantages – Modular – Easier to debug – Don’t have to recreate code – Require less memory 16 Icon Terminals " " ( Connector Sub VIs Sub 17 . .1 .. .9 , - . .0 1 1 . .0 1. . .9 ./ - .0 1 • Right-click on the icon in the block diagram or front panel 18 Right click on the icon pane (front panel only) " 19 • 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 VI’s into a single file, ideal for transferring entire applications across computers Accessing user-made subVIs Or Drag icon onto target diagram Functions >>All Functions >> Select a VI 20 ( • Keystroke Shortcuts – <Ctrl-H> – Activate/Deactivate Context Help Window – <Ctrl-B> – Remove Broken Wires From Block Diagram – <Ctrl-E> – Toggle Between Front Panel and Block Diagram – <Ctrl-Z> – Undo (Also in Edit Menu) • Tools » Options… – Set Preferences in LabVIEW • VI Properties – Configure VI Appearance, Documentation, etc. 21 / • For Loop • While Loop • Charts • Multiplots • While Loops – Have Iteration Terminal – Always Run at least Once – Run According to Conditional Terminal • For Loops – Have Iteration Terminal – Run According to input N of Count Terminal 22 % ., . . 5& . . .. . ; .! .. . . . . . Shift Registers in Loops Use shift registers with For Loops and While Loops to transfer values from one loop iteration to the next. Shift registers are similar to static variables in text-based programming languages. 23 Waveform chart – special numeric indicator that can display a history of values Controls >> Graph Indicators >> Waveform Chart ) Single Plot Charts Multiplot Charts 24 + 6 /7 Students build Use a loop.vi. " * ' 8- 25 /" * 9' 8- • Build arrays manually • Have LabVIEW build arrays automatically • Write to a spreadsheet file • Read from a spreadsheet file " " * ' ! From the Controls >> All Controls >> Array and Cluster subpalette, select the Array Shell Drop it on the screen. 26 " " *% 5& Place data object into shell (i.e. Numeric Control) " * • Loops accumulate arrays at their boundaries 27 :) " * ' 8- File I/O – passing data to and from files - Files can be binary, text, or spreadsheet - Write/Read LabVIEW Measurements file (*.lvm) Writing to LVM file Reading from LVM file 28 ; 1 F = 6 ' . . . ., . . 7. . .' .6 7. . . .' . . . .. . ' . .. . .' .. . . . . . + < /" *= ) Students build Temperature Logger.vi 29 " *' 9 /" *' 9 • Basic Array Functions • Use graphs • Create multiplots with graphs 30 " *' / Functions >> All functions>> Array Functions " *' / " * 31 • Selected from the Graph palette of Controls menu Controls>>All Controls>>Graphs Waveform Graph – Plot an array of Plot numbers against their indices numbers Express XY Graph – Plot one array Plot against another against Digital Waveform Graph – Plot bits Plot from binary data from Right-Click on the Graph and choose Properties to Interactively Customize 32 + > /7 , 9 0 33 / , ,9 0 ' 8- . = 1& , + . . . 4' .. .? , 11@ 6 .' .G 6. . ... 6 7. . .. ' ?+ . 6 7. . . . 34 • Data structure that groups data together • Data may be of different types • Analogous to struct in C • Elements must be either all controls or all indicators • Thought of as wires bundled into a cable , .. @@ " @@ " .8 *9 .H . . . 35 ' • In the Cluster subpalette of the Functions>>All functions palette • Can also be accessed by right-clicking on the cluster terminal (Terminal labels reflect data type) Bundle Bundle By Name ' Unbundle Unbundle By Name Unbundled cluster in the diagram 36 • Error cluster contains the following information: –Boolean to report whether error occurred –Integer to report a specific error code –String to give information about the error 0 3 • Error information is passed from one subVI to the next • If an error occurs in one subVI, all subsequent subVIs are not executed in the usual manner • Error Clusters contain all error conditions • Automatic Error Handling error clusters 37 9 ' 3 4 • In the Structures subpalette of Functions palette • Enclose nodes or drag them inside the structure • Stacked like a deck of cards, only one case visible Functions >> Execution control 38 + A/ 90 3 • In the Execution Control subpalette of Functions palette • Executes diagrams sequentially • Right-click to add new frame 39 ' 4 • In the Structures subpalette • Implement complicated equations • Variables created at border • Variable names are case sensitive • Each statement must terminate with a semicolon (;) • Context Help Window shows available functions Note semicolon ! 9) 40 /! 8 8 ! 3 . ' . 5 .! . .= 9) .9 : . .1 .! .8 .( . ' . .8 7.F 9 = / 7.> 6 .8 .B .. .8 .0 1 . .0 1.8 .I ! ' .+ . ./ .. ! ' G 1 ' ?! JB - .= 6 .8 .8 6 7.3 .& 5 .! 7.0 1.F 6 7. . .8 .1 7. ., ' 0 1 7.0 1.F 8 G' .8 - ?8 ?" ' ?" 6 .8 .> .? ' .. ?- .8 ?. @. @ B .( .8 41 ) 0 1.8 G8 5. . .! .I ! .I > .3 ' . .F .1 . . .0 1 0 1.8 G9 .F .0 6 . . .0 1 1 G> -'. . 5 . .8 - .I ! .! . . ' . .9 J .9 ., + ! ./ .9 . .! .8 .( .3 5. # ! " 42 #/ , B , .0 1. .0 1. .= . ' ' ! " ' " ' .0 1. . ' .' G < .K L .K L G, ' ... 7. ' : . - .... .' 43 " 9 .= G, ' G= . G, ' ., ; G G .. 6. . " . 6. . 6. . ' ... . . 6. '. . . ! G . . States: 0: Startup 1: Idle 2: Event 1 3: Event 2 4: Shutdown 44 + B/ ; # ) "3 45 ; " * ) 46 ) "3 DAQ Device • Data acquisition (DAQ) basics • Connecting Signals • Simple DAQ application Sensors Cable Terminal Block Computer ; 47 ) 5 5. 48 " 2 ) "C ) "3 , 4 2) "C .0 1 . . .1 ' .& ' ' .1 & . ! ' 4 2) "C + < :. .-. 01. . .. 5 & . . .0 1 . . . ' .6 49 ) . G/ "3 A! . .3 .= .> ' . . = .8 * .F ' .8 .> . ., . ., .= 6 .! .0 . . G, A= . '. = .= : ' ' .0 .> A > .. ., . .3 . .. 50 7 ) "C ) * ( 51 * (% & " 3 52 !* * ( ! -D *5 53 USB 6009 USB is a low cost device cost "* ) "C 54 ) "C , E 7 AFFG ) "C 55 " 8 ) 8 # . ' ! 56 # /. 0 .( . 3 > 4' .. > . =' . ' ' & 6. . ./ ' 01 2 . ! .8 . . .2 . . . 6 . .K - L .- . . . . . . . .' . . . .. . ! ! •Tools » Web Publishing Tool… •Click Save to Disk and VI is embedded into an HTML file •After file is saved, it can be reopened and customized in any HTML editor 57 . < 1.! ?C G, 8 G9' G1 1 8 . ' .M @ . .> ! . . . . . 2. .( .1 ' . .! .. .2 . . .> . # /" 8 / B ! 3 6 .< .0 .0 ,5 6 . .1 & 58 ) : / 2 . ' .?F @ 0 I .? H .: J@ @ 0 1 2 ., ' . . ' .? G < 1.! .M .?C G .< . G1 A - . ' .? G1 ' .! - ./ 6 .? @ A @ @ 59 ...
View Full Document

Ask a homework question - tutors are online