Computer Control of Experiments

via LabView


This lab is an introduction to controlling your experiment via computer, using the “LabView” program from National Instruments as a useful tool. While not a universal standard, LabView is pretty common, so knowing it is a useful skill – but our main goal is to get set up to take data via computer.


Why computerized data acquisition (“DAQ”). Aside from the nifty factor, it allows the taking of large quantities of data with comparatively little effort (once you get things set up). We have seen how larger statistics help you get a better answer. Of course, that's only part of the total error analysis you want to do, the systematic errors are the hard part. Computerized DAQ helps on this front too, as the computer always does the same thing every time, and that thing is exactly what you tell it to. So, if you tell it to do the right thing, the data it records is less prone to human error or bias, making it easier for you to reliably estimate what systematic biases there still are. Be aware, though, as the problems and difficulties are the same here as they are with any computer task – the machine happily does exactly what you tell it do whether or not what you said is wrong or right.


We will start by controlling the existing lab equipment via computer. One of LabView's nicest features is that someone out there somewhere has probably made a “Virtual Instrument” (VI) for any given expensive toy you might want to plug in. You might need to search around on the net to find any given VI, but National Instruments maintains a big download area full of goodies. The (old) standard interface for lab equipment is the GPIB or IEE-488 bus, as discussed in class. Newer machines are moving to ethernet control, but we don't have new toys here to play with.


Controlling Existing Machines


  1. There are two new copies of the book “Labview for Everyone” in the lab, sitting on top of the tinkertoy models of crystal structure. There is one old one as well and another old one in the library. The difference between old and new is that the new is updated for the current version of Labview, but if you're happy with the tutorials having the wrong menu layout it won't matter much. To get familiar with the Labview interface and how you monkey with a VI, read through Chapter 1, following along with the examples (a CD is in the book with the example VIs on it).

  2. Hook up the oscilloscope to the computers, use the pre-existing VI (which you might have to download) control the scope from the computer. Add the code you'll need to save the waveforms to disk. Can you also get this set up to spool a continuous stream of data to disk, so you could get a waveform much longer in time than the width of the screen? This will require tinkering with the insides of the 'scope VI.

  3. Add a function generator to the GPIB bus, so you can control both the signal generation and recording from the comfort of your console. What are the limits of resolution in time of the signals you can read back with the scope? Do they differ from what you could do manually with the same instrument?

  4. Add a DVM to the mix (not the yellow Flukes, but some of the older bulky ones up on the shelves have GPIB interfaces) and acquire some data with it. Can you get this set up so you can hit a button (a physical button or a software one) to indicate when you want to take a data point?



Lower Level Control


As the experiment gets more complicated, it often pays to have a lower level control available. Sometimes this means some serious custom electronics, as is the case with MINOS and Super-K. However, even in those cases using off-the-shelf components for parts of the system saves a lot of work (and time and money). Here, we'll use the “USB-6211” USB device from National Instruments. The manuals for these cards are in the brown Natl. Inst. boxes next to each computer. Read them. Make note of its capabilities. Put a copy of the pinout from this card into your lab notebook for reference. If the stickers with the pinouts aren't yet on the device itself, please stick them on.


Now, some exercises to explore this card's capabilities:


  1. Use the onboard DAC to write out some voltages. Make a bipolar +/-15V output (yes, this exceeds the board's specs, you'll need some breadboarding).

  2. Use the onboard ADC to read this voltage back in. Also read this in with your GPIB controlled DVM. Have your VI compare these two numbers.

  3. If you write out a square wave using the DAC, how good a square wave do you get and what's the maximum frequency you can make? (compare to the external function generator's capabilities). If you use the external function generator to make a square wave, how well can you read it in using the ADC, and what's the frequency limit there? (compare to the oscilloscope).

  4. Use the USB-6211 to write out an 8-bit binary number you type in from the keyboard. Light this number up in LED's on the breadboard. Put a DAC0808 chip (see Physics 3061 Lab #14) on the breadboard, generate a +/-15V signal with it using this number, and read it back in in the same was as in step #2.

  5. Set up a 4-bit ripple counter using JK flip flops as in Physics 3061 Lab#13 step #2. Use the digital lines on the USB-6211 to read out the output of this counter. Use this card to generate the stop and start signals for the counter, and to program the function generator to supply the clock signal for the counter.


Now, also build a 4-bit synchronous counter with JK flip flops (see Horowitz and Hill for the two flavors of simple counters). The lab#13 exercise asks you to try and time the delay between the 16th input pulse and the time when the counter actually rolls over. Do this for both the ripple and synchronous counters you've built, but use computer control for the measurement. Note that last semester many of you timed the wrong thing in this lab and came up with bogus numbers for the time it takes your circuit to work. You're trying to see how long it takes for the last pulse which makes the thing go from “1111” to “0000” to propagate all the way through.