Get Real About Teaching with LabVIEW and myDAQ STEM Education Science, Technology, Engineering and Math Education Prepares students to pursue careers in engineering, science or technology-related fields National Instruments Confidential 2 Needs in STEM Education • Integrate theory with hands-on, experiential learning • Collaborative, project-based learning • Strong social relevance • Design, creativity and innovation National Instruments Confidential 3 Where is the engineer of 2020? In 4th Grade 10 year olds! National Instruments Confidential 4 Tech Savvy Generation 5 Years Old Music with iPod > 22 Years Old Unmanned Vehicles 8 Years Old LEGO® 12 Years Old Gaming Consoles 18 Years Old Segway Clone National Instruments Confidential 5 LabVIEW: K to Rocket Science! CERN Large Hadron Collider “the most powerful Instrument on earth” LEGO® MINDSTORMS® NXT “the smartest, coolest toy of the year” National Instruments Confidential 6 What is LabVIEW? Graphical programming language & Data flow • LabVIEW relies on graphical symbols rather than textual language to describe programming actions • The principle of dataflow, in which functions execute only after receiving the necessary data, governs execution in a straightforward manner National Instruments Confidential 7 Science Math Engineering Technology What is MyDAQ • • • General Purpose Data Acquisition Device Multimeter, Oscillocope, Function Generator, Spectrometer and much more $200 = $50-$200 + $300-$10,000 + $300-$5,000 + much more How does LabVIEW work? • LabVIEW programs are called: Virtual Instruments (VIs) because their appearance and operation imitate actual instruments. • However, they are analogous to main programs, functions and subroutines from popular language like C, Fortran, Pascal, … National Instruments Confidential 9 LabVIEW Programs Are Called Virtual Instruments (VIs) Front Panel • Controls = Inputs • Indicators = Outputs Block Diagram • Accompanying “program” for front panel • Components “wired” together National Instruments Confidential 10 LabVIEW Introduction • Two “sets” for development Front Panel Block Diagram • Wiring connections • LabVIEW Conventions • Running LabVIEW programs National Instruments Confidential 11 LabVIEW Front Panel • All user interface goes here! • Used to display Controls or Indicators • Highly customizable National Instruments Confidential 12 LabVIEW Block Diagram • Actual program • Invisible to user • Read left to right, like a book • Where the MAGIC happens! National Instruments Confidential 13 Terminals When you place a control (or indicator) on the FRONT PANEL LabVIEW automatically creates a corresponding control (or indicator) terminal on the BLOCK DIAGRAM National Instruments Confidential 14 Control? or Indicator? Controls = Inputs from the user = Source Terminals Indicators = Outputs to the user = Destinations National Instruments Confidential 15 Manipulating Controls and Indicators • Right click on an indicator to Change to control Change format or precision • Right click on a control to Change to indicator Change mechanical action (whether to latch open or closed, and what to use as default…) National Instruments Confidential 16 Wiring Connections • Wires transport data through the block diagram • Wire color indicates variable type • A red “X” means something is wrong! National Instruments Confidential 17 Wires A LabVIEW VI is held together by wires connecting nodes and terminals; they deliver data from one source terminal to one or more destination terminals. National Instruments Confidential 18 Examples National Instruments Confidential 19 Creating a VI Front Panel Window Block Diagram Window Control Terminals National Instruments Confidential Indicator Terminals 20 Example 1: Craps • • • • National Instruments Confidential From the functions – numeric panel insert a pair of dice From the Controls panel insert a numeric digital indicator (on the front panel) Use the wiring tool to connect the two (in the wiring diagram) and click the “run” button repeatedly. Numbers from 0.00 to 1.00 should be displayed in the front panel 21 Example 1: Craps (continued) This wiring diagram simulates the rolling of 2 dice and their addition to form a number from 2 through 12. • Delete the wire • Add a multiplication node and a numeric constant to allow multiplication by 5 • Add an addition node and numeric constant to allow addition of 1 • Add a mathematical “Round to Nearest” node. • Make a second copy of this structure to represent a second die and wire them together through an addition node with an output to a numeric constant National Instruments Confidential 22 MyDAQ National Instruments Confidential 23 • MyDAQ - Designed for hands-on experimentation. NI MyDAQ combines portability with a comprehensive set of features. NI MyDAQ allows for real engineering and, when combined with NI LabView and Multisim, gives students the power to prototype systems and analyze circuits in or outside of the classroom. • NI MyDAQ hardware integrates with NI Labview graphical development software, giving the students hands-on interaction with real analogue circuits, sensor measurements, and signal processing. It bridges the gap between theory and real-world practice by providing students with eight Labview software-based instruments including a digital multimeter (DMM), oscilloscope, function generator, bode analyzer, dynamic signal analyzer, arbitrary waveform generator, digital reader and digital writer. • NI MyDAQ is compact enough to fit in a student's pocket, and is powered by a USB connection. National Instruments Confidential 24 National Instruments Confidential 25 Digital Multimeter (DMM) National Instruments Confidential 26 Measuring Resistance Across 1000Ω National Instruments Confidential 27 New 2009 FIRST Robotics Controller NI CompactRIO, the industry’s most compact, powerful embedded controller powered by NI LabVIEW Flexible Inputs & Outputs (I/O) •More sensor choices •More I/O lines •Customizable I/O for future years Superior Performance •32 bit real time processor •802.11 Wireless Ethernet •FPGA I/O control Advanced Control •Intelligent Robotics Algorithms •Real-Time Vision Processing Rugged design •50G shock rating •Easier connectivity National Instruments Confidential Easy to Program •Programmable in C and LabVIEW, the world’s leading graphical language •Wireless debugging •Laptop dashboard 28 Build an Audio Equalizer Using NI myDAQ and LabVIEW National Instruments Confidential 29 LabVIEW for LEGO® MINDSTORMS® environment You can sent your environment via the tools pull down Before you start to program in LabVIEW, you first need to create a robot project. With a robot project, you can keep all the files relevant to your robot together. Let’s Build a simple Program National Instruments Confidential 30 Curriculum Resources Break down the walls of the traditional lab and lecture by giving your students the ability to perform short lab experiments anywhere, anytime. http://www.ni.com/mydaq/curriculum.htm http://zone.ni.com/devzone/cda/tut/p/id/11213 http://www.k12lab.com/ National Instruments Confidential 31 Questions?