LabView: A Data-Acquisition Package
( Project Lab Writeups |Computer Programs |sample graph )
This page gives details of how to use LabView in the integrated lab. Some general instructions are given, and specific instructions for several experiments are also given. Starter programs for several exjperiments are given.
When the computer boots up, a window entitled "NI-488-2 Getting Started Wizard" may come up. If it does, click on "Verifying your hardware and your software installation." the "488" referes to the IEEE-488 (or GPIB) instrument bus. This aplet will check for a GPIB card on the computer and see if it is working. It also tells you the name given to this interface for programming purposes, probably GPIB0.
When you get back to the Getting Started Wizard, connect the meter or whatever GPIB instrument you plan to use to the interface card via a GPIB cable. Then click on "Communicate with your istrument." Follow the instructions. Under "Devices and Interfaces" you should see "GPIB0 (PCI-GPIB)." If your computer has the National I/O board installed too, you should see "PCI-MIO-16De=4 (Device 1)" too.
Now (following instructions) scan for instruments on the GPIB bus. This may be more or less successful. For instance, with the KiethelKiethley 197 DVM, the presence of thsan instrument and its address were recognied, but an identification string was not successfully received.
Next try to "Communicate with the Instrument." The bvarious tools available for setting up GPIB instruments are to be found with the Windows Explorer at c:\Program files\National Instruments\NI488-2\Bin.
  1. Belly up to a computer .
  2. Make yourself a directory in your name, where you can store data, programs, etc.:
    	c:\usr\schmuck
    
    or
    	d:\usr\hero
    
    
    
  3. Make a sub-directory, named "gaussian."
  4. Enter
    	MINSQ
    
    or, from Windows, double-click on the MINSQ icon.

    The fitting program will load and execute. The following instructions are for MINSQ version 4.02. There is a later version, much more menu driven and mouse oriented. It is harder to use, though.

  5. Go through "Utilities" to "Misc," and set "default directory" to where you want your files to be stored, e.g., c:\usr\noah\gaussian\ . Otherwise when you save data, parameters, etc., you will have a terrible time finding them afterwards.
  6. "Get model," "define model." This defines the formula that will be fit to your data. (When you have a model file saved, you can use "retrieve model" instead.) Names are given to the variables and parameters. Here is what you should enter:
            independent variables:        FK
            dependent variables:          FN
    	parameters:                   FNTOT, X, SIGMA	
    	equations:
            	pi = 3.14159
    		fnwide = 1.	Width of the bins of your histogram.
    		fact1 = 1./(sqrt(2.*pi)*sigma)
    		fact2 = exp(-(fk-x)^2/(2.*sigma^2))
    		fn = fact1*fact2*fntot*fnwide
    
    These equations represent the form for the general Gaussian, as given in the writeup for lab B2, but multiplied by a parameter, fntot, which changes the normalization. FNTOT should come out to be equal to the total number of entries in the histogram, if the fit is good.

    Enter two returns to finish entering the model; it will be compiled. Now do "model compile." If the compilation works, without errors, save the model as the file d:\usr\schmuck\gaussian\gauss.eqn .

  7. "Get parameters," "enter parameters," then enter initial guesses for the three parameters. When done, "save parameters" to the file d:\usr\schmuck\gaussian\gauss.par .
  8. Now enter the data. I give a sample set of data below; you may want to enter it in, just to make sure the program is working. Then you would enter in your data. "get data," "enter:"
    	9. 	 3.
    	10.	25.
    	11.	132.
    	12.	111.
    	13.	19.
    	14.	6.
    	15.	1.  
    
    You could read in a data file from disk if you wanted to.  It should 
    start with a line with the 
    variable names:
    
    	FK  FN
    
    and it should end with the line
    	ENDDATA
    
  9. Do the fit: "calculate," "least squares." For the data given, you should find:
    		chi-squared = 46.381
    		FNTOT = 288.21
    		x = 11.411
    		F = 0.75806
    
    (The numbers for your data will be different, of course.)

    Now let the program determine the errors: "statistics," "90%," etc. For the data given, the errors on fntot, x, and F are 7, .02, and .02, respectively.

  10. Get a graph of the fit: "graphics," "draw plot," "printer output." Get two.
  11. Graphics File Conversion. There are (at least) two ways to convert the graph of your data on the screen into a computer file.
    • To make a PostScript file to use in LaTeX, go to plotter setup and configure the "Apple Laserwriter" option to write to a disk file. FTP this file to stars, and you can incorporate it into a paper.
    • To convert to a file which you can post on your web page, follow the following steps:
      • MINSQ should be running under Windows 3.11, in a separate window. If it is running in full-screen mode, press Alt-Enter to go to window mode.
      • Now copy the window to the clipboard, by pressing Alt-PrintScrn .
      • Open Paintbrush, and Paste in the contents of the clipboard.
      • Save as a file in .bmp format (256 colors is certainly good enough). Ideally, connect over the network to your stars file system, and save the file directly to your web-page directory.
      • If you saved the file locally, now either FTP the file to your account on stars, or connect over the network to your stars file system, and just move the file over using the File Manager.
      • Using one of the computers in TH 117, convert this file to .jpg or .gif format, using Lview or some other program. Here is an example of the result.