Implementing LabVIEW in an Intermediate Physics Laboratory Steven Sahyun Physics Department,...

10
Implementing LabVIEW in an Intermediate Physics Laboratory Steven Sahyun Physics Department, University of Wisconsin - Whitewater, Whitewater, Wisconsin 53190 [email protected] AAPT Greensboro August 1, 2007 FH03 Title slide Supported in part by a National Instruments equipment

Transcript of Implementing LabVIEW in an Intermediate Physics Laboratory Steven Sahyun Physics Department,...

Page 1: Implementing LabVIEW in an Intermediate Physics Laboratory Steven Sahyun Physics Department, University of Wisconsin - Whitewater, Whitewater, Wisconsin.

Implementing LabVIEW in an Intermediate Physics Laboratory

Steven SahyunPhysics Department,

University of Wisconsin - Whitewater, Whitewater, Wisconsin 53190

[email protected]

AAPT GreensboroAugust 1, 2007FH03

Title slide

Supported in part by a National Instruments equipment grant.

Page 2: Implementing LabVIEW in an Intermediate Physics Laboratory Steven Sahyun Physics Department, University of Wisconsin - Whitewater, Whitewater, Wisconsin.

EquipmentStudents worked in pairs for three weeks at a computer workstation equipped with a computer and a National Instruments NI-6009 USB interface unit. Each computer had LabVIEW 8.2 installed.

A department site license was acquired through a National Instruments grant. University (College Dean) provided funds to purchase NI-6009 USB interface units for the laboratories. Small supplementary items (LEDs, photocells, motors) were

purchased from Radio Shack with instructional funds. NI USB-600914-Bit, 48 kS/s Multifunction Data for USBAnalog: 8 input, 2 output channels, Digital: 4 input, 8 output. ($243/ea)

Page 3: Implementing LabVIEW in an Intermediate Physics Laboratory Steven Sahyun Physics Department, University of Wisconsin - Whitewater, Whitewater, Wisconsin.

Lab Station 2: Electron properties.(2 Weeks)

•Helmholtz coil field mapping.•e/m ratio•Millikan Oil Drop

Lab Station 3: Magnetism(2 Weeks)Magnetic dipole moment and torque experiments and a brief introduction to vacuum systems.

Lab Station 1: Computer Interfacing. (3 Weeks)Students learn basics of LabVIEW programming to acquire data and control devices.

Lab Station 4:Material Properties.(2 Weeks)• Using a spectrophotometer with LabVIEW for data collection.• Scanning Tunneling Microscope.

Synchrotron Radiation Center Experience: (3 Weeks)

Students visit and use the SRC for photoemission studies of materials of their own choosing. SRC instrumentation and data collection is controlled remotely by LabVIEW via a Web interface.

Student groups then rotate through the following lab stations

Earth’s Field NMR Lab (2 Weeks)

Sophomore Level Intermediate Laboratory course: 2 cr.; 4 hr/week

Page 4: Implementing LabVIEW in an Intermediate Physics Laboratory Steven Sahyun Physics Department, University of Wisconsin - Whitewater, Whitewater, Wisconsin.

Lab 1: Guided Exercises: 2 Lab periods (4 hrs)Topic Exercise

Creating a Virtual Instrument Exercise 0 - Perform a mathematical function on two numbers.

Working with Loops Exercise 2 - Add a loop structure to convert the temperature from degrees Celsius to Fahrenheit so that it will run until stopped.

Controls and data Types Exercise 3 - Switches, lights, Boolean and conversion.

Using Charts Exercise 4 – Build a vi to display a simulated “noisy” sine signal.

DAQ – Data Acquisition with the 6009 Exercise 5: Acquire and graph an input signal from a function generator. Start with InputStarter.vi

Recording and Saving Data Exercise 6 – Create a vi that will record a graph’s data using the “Write to Measurement File” subVI.

Page 5: Implementing LabVIEW in an Intermediate Physics Laboratory Steven Sahyun Physics Department, University of Wisconsin - Whitewater, Whitewater, Wisconsin.

Exercise 2 sample:

The “Front Panel” containsControls and Indicators

The “Block Diagram” contains the program of components wired together.

Page 6: Implementing LabVIEW in an Intermediate Physics Laboratory Steven Sahyun Physics Department, University of Wisconsin - Whitewater, Whitewater, Wisconsin.

Lab 1: Assigned tasks: 4 Lab periods (8 hrs)

Physics 221: Intermediate LaboratoryStation 1 Assignment: Computer Interfacing

Objectives:

You will learn basic functions and methods for transferring data from devices to computers and use computers to generate signals to remote devices. You will become acquainted with a digital storage oscilloscope as well as the LabVIEW program.

1. Complete the Introduction to LabVIEW exercises.2. Complete a LabVIEW program to graph and save data3. Complete a LabVIEW program to create a Decimal to Binary converter; use two LED lights connected

to the NI-6009 interface to display the result.4. Use the NI-6009 interface to turn on a LED diode when triggered by a signal from a photocell.• Use the NI-6009 interface to run a small motor when triggered by a signal from a photocell. This will

require the use of a “Darlington” circuit.• Create a LabVIEW program to acquire and save to a file the waveform produced by a function

generator. Extra credit: Pass the LabVIEW fundamentals exam at http://www.ni.com/training/labview_exam.htmSupplemental LabVIEW material available on request.

Progress and programs will be kept track of in your Laboratory Notebook. At the end of the Lab Station, you will turn in your notebook as well as a lab report detailing your activities. Grading will follow guidelines of the rubrics handed out in the course syllabus.

Assignment example:

Page 7: Implementing LabVIEW in an Intermediate Physics Laboratory Steven Sahyun Physics Department, University of Wisconsin - Whitewater, Whitewater, Wisconsin.

Result for Task 5: Run a small motor with LabVIEW.

Photocell uncovered,Motor is off.

Photocell covered,Motor is on.

Circuit to increase the current to the motor

LabVIEW front panel.

LabVIEW block diagram controlling the motor.

Page 8: Implementing LabVIEW in an Intermediate Physics Laboratory Steven Sahyun Physics Department, University of Wisconsin - Whitewater, Whitewater, Wisconsin.

Lab Station 4: Spectrophotometer

A LabVIEW virtual instrument is used to collect spectrophotometer data. This VI is similar to one the students created earlier in the semester.

Page 9: Implementing LabVIEW in an Intermediate Physics Laboratory Steven Sahyun Physics Department, University of Wisconsin - Whitewater, Whitewater, Wisconsin.

Synchrotron Radiation Center SPECTRA:Photoemission experiment

LabVIEW is used at the SRC to remotely control the instrument and collect data.