Computer based instrument control and
data collection in Grad Lab
This section was written by Andrew Berkley, August 1999 and is edited and
maintained by Robert Gammon.
Contents
1. GPIB
Many of the instruments in the Graduate Laboratory have IEEE-488.2 GPIB
(General Purpose Instrument Bus) interfaces. This GPIB interface is a mechanism
for a computer to control an instrument and read data from it. You may
connect any number of instruments to a computer. The instruments are connected
to the computer via stackable cables so that one can easily connect multiple
devices.
Each device connected to the GPIB bus must have its own GPIB Address.
Each instrument provides a different mechanism for setting its address,
so see the documentation in the library on the instrument you wish to use.
2. LabVIEW
LabVIEW is a programming environment specifically tailored to make data
collection and control of a set of instruments from a computer a straightforward
job. Previous to the introduction of LabVIEW most of the interfaces in
Grad Lab were written in QuickBasic which provided for very limited real-time
data visualization. LabVIEW provides a wealth of tools for presenting data
while it is being taken or for reading previously taken data.
For experiments where data taking via GPIB occurs on a regular basis
some pre-written LabVIEW programs have been provided to make data taking
a comfortable, and pleasant experience. Currently the critical opalescence
and ferroelectric experiments have data collection programs written for
them.
While these programs make it easy to read data from the devices you
should be very careful to understand what the settings on the meter mean
and to choose them correctly.
3. Instruments supported
3.1 HP 34401A Multimeters
The HP 34401A multimeters are one of the most common devices in the Grad
Lab environment. Thus they are probably the first choice for computer based
data collection.
3.1.1 GPIB Address
When you power on the HP 34401A multimeters they display their GPIB address.
You may change the address by navigating the menus on the meter by hitting
SHIFT, MENU ON/OFF,>>>>, and then using the < and > and and ^ to change
the address and then press AUTO/MAN to save the changes.
3.1.2 Resolution
The resolution setting on the meter is the number of digits reported. This
can be set from 4.5 to 6.5. The 0.5 digit corresponds to a 1 or 0 at the
farthest left position.
3.1.3 Range
The range setting on the meter basically tells the meter where to put the
decimal place in the 6.5 digits. That is, if you read a 2 Kohm resistance
while on a 200 Kohm scale, you will be wasting two digits of resolution
(as the first two digits will be zeros).
Both the range and resolution settings may affect the current the meter
uses to measure resistance.
3.1.4 Speed
The speed setting is, as are all features of the meter, described in the
HP 34401A manual. Depending on the number of digits of resolution this
setting controls how long the meter averages the A/D reading before reporting
it. There is a table in the manual which gives the actual times in terms
of number of power line cycles (60 Hz).
3.2 Keithley 193 System DMM
The Keithley 193 System digital multimeter provides a wealth of features
including filtering and averaging. There is only one of these devices in
the lab and it is most often used in to the Ferroelectric experiment monitoring
temperature. If you needs its capabilities, arrange to share with
the student dint the Ferrelectric experiment
3.2.1 GPIB Address
The GPIB address of the K193 defaults to 30. Changing it is possible and
the procedure is described in the manual though this should be unnecessary.
3.2.2 Filtering
3.2.3 Resolution / Range
Changing the resolution or range of the K193 may also change the current
used to measure resistance. A quick experiment will show the
the 2 Kohm scale at 6.5 digit resolution puts too much current through
the thermistor resistance themometer causing self heating. It is
better to use 20 Kohm scale. You can test this when the controller
is holding a constant temperature by setting the K193 to different resistance
scales and seeing that the resistance read is different. Differences
can be large enough to indicate self heating temperatures of more than
50 mK.
3.3 EG&G 5209 Lock In Amplifier
The EG&G 5209 Lock-In Amplifier is a feature rich lock-in which with
its GPIB interface alleviates the need for a separate meter to watch the
voltage on the output of a lock-in. Having a computerized interface to
it means that there is never a problem with forgetting what the sensitivity
of the lock-in was set to. The reading rate from the lock-in is upwards
of 100Hz (limited by the lock-in digital interface). Control of all the
lock-in features is possible both from the computer or from the front-end
while it is running. Care must be taken to write down the filtering and
time constant settings as these are not logged by the computer unless you
use the ``Save Config'' button to save the configuration (in a non-human
readable format) to disk. After saving the configuration you may look at
it later by choosing ``Load Config''. While the sensitivity is already
taken into account by the output from the lock-in being put in volts referenced
to the input, the sensitivity setting also determines how many digits of
that result are valid.
The only interface to the EG&G 5209 lock-in is through the Generic
Logging program.
3.4 Keithley 485 picoammeter
The Keithley 485 picoammeter is a ammeter which can measure from microamps
down to picoamps. The GPIB interface provides for a reading rate of three
Hz (limited by the digital interface on the K485, not by the ammeter itself
which has a documented rise time of only a few milliseconds depending on
the current). There is an analog output of the picoammeter which may be
connected to a faster GPIB meter if the three Hz data collection rate is
too slow.
The only interface to the K485 is through the Generic Logging program.
4. Critical Opalescence Experiment
Program
In the critical opalescence experiment you need to record the ratio of
the laser beam's initial intensity to transmitted intensity as well as
the temperature of the bath. The temperature of the bath is measured by
a thermistor whose resistance is related to temperature by the formula:
|
(1) |
Both of these elements (temperature and ratio) are measured by HP 34401A
multimeters, one in resistance measurement mode and one in Volts DC Ratio
mode.
On the desktop of the critical opalescence machine there is a folder
called LocalApps. Inside that folder you should find a shortcut named Data
Collection for Critical Opalescence Experiment. Double clicking that
shortcut will open up a LabVIEW program which will manage data collection
from the two HP 34401A multimeters. If you want to
modify the program please make a copy of all the relevant VIs (Virtual
Instruments) in your own directory.
Start the VI running by clicking the arrow in the toolbar. Then click
on the Configure button for the first HP multimeter. This will bring up
a dialog box to configure the meter you wish to use to read the resistance
of the thermistor. Configure the device appropriately (make sure to set
the GPIB Address correctly). Then click the Done button at the bottom of
the configuration screen to send the meter the proper configuration commands.
If the meter beeps then something went wrong (this appears to happen on
occasion, and if it does just reclick the configure button and click done
again to resend the configuration string). The readings from this meter
will be plugged into the formula given earlier before being written to
the log file to give temperature in degrees C. The raw resistances will
also be written to the file. After the configuration has been completed
read §6 on how to operate the rest of the
program. Any further changes to the configuration may only be done by stopping
and restarting the logging program. After you are satisfied with the configuration
of your meter you may save the configuration to a file so you can reload
it quickly later by clicking on the Save Config button in the configuration
dialog.
Make sure to write down the settings you chose for the meter so that
you know the resolution of the numbers written to the logfile (as they
are written with a fixed maximum precision) or use the Save/Load Config
feature to keep track of it, but write down what file you saved the config
to.
5. Ferroelectric Experiment
Program
Monitoring the temperature of the bath around the ferroelectric crystal
is done via watching the resistance of a temperature probe in the bath
and the conversion from resistance to temperature is given by equation
(
1). The resistance measurement is done by a
Keithley 193 System DMM. In the LocalApps Folder on the desktop you should
find an application called
Ferroelectric Temperature Logger. Double
clicking that should start up the program to log the temperature of the
bath to a file. Click the arrow in the toolbar to start the VI running.
Then choose the ``Configure'' button for the K193. The GPIB address of
the meter should be 30 (to change this see the manual). Use of the filtering
feature of the K193 is suggested (the details of the filtering are described,
once again, in the manual). When done with the settings click the Done
button to close the configuration screen. Any further changes to the configuration
may only be done by stopping and restarting the logging program. The meter
should click and start displaying Kohms. After you are satisfied with the
configuration of your meter you may save the configuration to a file so
you can reload it quickly later by clicking on the Save Config button.
See §
6 on how to operate the rest of the
logging program. There is a formula section on the front panel where you
may specify the conversion formula from temperature to resistance. If you
do change it you may want to right click the box and select ``Data Operations'',
``Set current value to default'' to avoid having to retype your changes
later.
There is also a program tailored for doing recording from two HP 34401A
multimeters (which you may decide to use for looking at hysteresis curves).
The interface to this program is basically the same as that for the temperature
logger and indeed both programs can be run simultaneously.
Make sure to write down the settings you chose for the meters so
that you know the resolution of the numbers written to the logfile (as
they are written with a fixed maximum precision) or use the Save/Load Config
functionality.
6. Logging
After finishing configuring the devices as described in the previous sections
you have to setup the remainder of the logging procedure.
In the ``Logfile Path'' type the name of the logfile you wish to write
to. You should make a directory c:\user\yourname\ to store any
important data, so the logfile for a given run might be c:\user\yourname\mmddyy.txt.
If this is an old logfile that you want to append the data to (for example
you stopped the data collection a few minutes ago and want to continue
again) then make sure the ``overwrite logfile'' setting is false
before continuing. If overwrite is false, the new data uses the same time
base as the old logfile, that is the first column, time in seconds since
logging started, is correctly calculated with respect to the initial logfile
starting time.
Set the delay between readings to an appropriate number (for example
10 seconds) so you do not log more data than you can handle in an analysis
program. The number in the delay setting is in milliseconds.
Click the large ``Collect Data'' button and if all is working well then
the Run Indicator should turn from Red to Green. If it does not then look
at the error indicator box and try to determine what went wrong. Worse
comes to worse close the data logging window then restart it and try again
(don't forget to click the Configure buttons before running).
If you want to pause data taking click the Pause button. If you want
to stop data taking press the Stop button (this may take a few seconds
to have an effect depending on what the delay between readings is).
Now the meters are reading every so often and the readings are being
written to the log file you specified with a timestamp which says when
the readings were taken. The format of the logfile is described in the
next section. You may check that the logfile is being created by opening
the logfile in notepad or some other file viewer.
Remember to CONFIGURE the device before you start logging.
7. Logfile Format
The format of the logfile is that the first line is a header:
mm/dd/yy hh:mm:ss AM/PM [floating point number encoding time]
and the remaining lines are of the form:
hh:mm:ss AM/PM [tab] [time in seconds since logfile started] [tab]
dataset1 [tab] dataset2...[return]
hh:mm:ss AM/PM [tab] [time in seconds since logfile started] [tab]
dataset1 [tab] dataset2...[return]
...
While the timestamps are precise to one millisecond, the actual reading
time of the meter is generally pretty slow so the two readings will not
be exactly synchronized, nor will the timestamp truly reflect the time
of reading, instead it reflects the time when the request was sent to the
meter to perform a measurement. For the critical opalescence experiment
the first dataset is the resistance, dataset2 is temperature and the third
is the ratio. The ferroelectric has the first dataset being resistance
and the second temperature.
8. Watching the data
After the run indicator on the data logging program has turned green you
should check and verify that the data is really being collected and perhaps
you want to look at it a bit. So you can minimize the data collection window
(it will continue to take data regardless). Now you have a choice of methods
for viewing the data. You could ftp the data file to some other machine
and view it with Origin or your favorite plotting package. If you look
at the logfile with a program like explorer it will show it as having a
length of zero, this isn't really true. FTPing your data is annoying and
does not let you see what is going on now. Instead you may want to use
the ``Real Time Log File Plotter'' located in the LocalApps folder.
After opening this program you will want to set the path for the logfile
to what you are writing to in the logging program and click the run arrow
in the toolbar.
The indicator ``Data Began'' should tell you when the logfile was first
written to. The selections for datasets are now sized to the number of
data columns in the file (4 for critical opalescence has time, resistance,
temperature, ratio; 3 for ferroelectric time, resistance, and temperature).
This program provides two different graph types to watch your data with.
The first is a ``Dual Strip Chart'' which displays two data sets as a function
of time. For the critical opalescence experiment it might be useful to
look at both the ratio and the temperature at the same time, so in the
``Dual Strip Chart'' area of the program set the First Plot to Dataset
#2 and the Second Plot to Dataset #3 and click the Create button. This
should pop-up a new window with an empty graph in it. You have to go back
to the initial window and click the green ``Read Data'' button to begin
sending data to the graph. You should now see the data as it is being collected.
See the dual strip chart user interface section for more information on
playing with the graph. If there is a tremendous amount of data in the
logfile you might click ``Read Data'' before you create the graph so as
to catch up to the end of the logfile. If you want to skip a large section
of the file (if for example you are appending to a large data file and
want to look at only the end) then modify the percent skip option before
starting the VI.
The second type of plot is an ``XY Plotter''. This can be used to display
either a real XY plot (one dataset vs. another) or just a single plot strip-chart
(dataset vs. time). To watch the temperature as a function of time for
the ferroelectric or critical opalescence experiment set x-axis to time
and y-axis to dataset #2 and click the Create button and the Read Data
button (if you have not already). For the critical opalescence experiment
it might be nice to watch the ratio as a function of temperature, in this
case set the x-axis to dataset #2 (temperature) and the y-axis to dataset
#3 (ratio). See the later section on the user interface for the XY plotter
to determine how to change the x-axis labels from time to a real decimal
number (for displaying a real XY plot).
You may create up to five of each type of graph of the logfile by repeating
the procedure above (you only need to click Read Data once either before
or after you create the graphs).
There is also a program to review an old logfile that does not update
in realtime, the ``Log File Review''. In the window that pops up, change
the Path for logfile to be the logfile you are writing to with the data
logging program and then select the run arrow in the toolbar. This program
does not update in real-time and instead are geared toward reviewing a
logfile that perhaps you left running over the weekend, or last night.
It makes review plots much faster than loading the data through the ``Real
Time Log File Plotter''.
9. Writing notes on logfiles
As most people don't tend to write things down while taking data from a
computer there is a program to assist in this endeavor. Try the ``Log Timestamped
Notes'' application. Make sure that you set the notes filename to something
DIFFERENT from the logfile you are writing the data to, for example mmddyynotes.txt.
You may type a note in the note box and click the write note to file button
in which case the file will contain the date/time the note was written
and the note itself. For example type ``Turned temperature knob one quarter
turn'' and then write the note to the file. So when you are looking over
the data in the other window you can browse through this file and see what
you did at some time.
10. Plot Features
10.1 Controlling visual features
The control of the visual features of the plot is done through the gray
palette below the graph. On the left-most part of the control are two tabs
which select whether auto-scaling is active for the x and y axes. Placing
the tabs to the left means off and to the right means on. To auto-scale
the plot once, just left click the buttons right next to the tabs. To change
the properties of the axes (precision, numbers instead of time, format)
right click on the buttons next to the tabs.
To zoom in on a region turn off the auto-scaling features of the plots,
and then select the magnifying glass and select a region. Holding the left
button on the magnifying glass allows a selection of zoom types (zoom in
y-axis only, zoom in area, etc.).
When using the dual-xy plotter this interface becomes a bit more complicated
as there are really two plots stacked one on top of the other with a common
x-axis. Using the toggle for showing one graph or both graphs in conjunction
with the palette controls allows for control of both plots.
To change the x-axis from a time display to a decimal display (if you
are viewing a real XY plot), press the right mouse button over the button
right next to the x-axis auto-scaling tab and select the formatting menu.
It is recommended that you experiment with the logging programs and
visualization tools to find the features available.
10.2 Mean and Deviation
The plots also provide a readout giving the mean and the standard deviation
of the region that is currently being shown. If you are using an XY plot
and have selected multiple plots to be displayed then you can use the index
next to the mean and deviation display to select which plot you wish to
see the numbers for.
11. Generic Logging Program
There is also a generic logging program which provides for logging from
an arbitrary number of instruments (as long as it is less than five) and
currently supports the following instruments:
-
Keithley 193 DMM
-
Keithley 485 Picoammeter
-
HP 34401A
-
EG&G 5209 lock-in
(if you wish to use the Keithley or Computer Boards DAS08 A/D cards then
you want to use the LabVIEW program Acquire which is more tuned for high
speed data collection).
There should be a link to the program in the LocalApps directory called
Generic
Logging Program. The interface is the same as for the previous programs
except in this case one is able to choose the device to Configure. Use
the first few device slots and leave the rest as None. Make sure to click
the checkbox under ``Log Raw'' for the devices you want to write to a logfile.
12. Comments, questions
Patches to this document to
ajb6@physics.umd.edu.
About this document ...
Computer based instrument control and data collection in Grad Lab
This document was generated using the
LaTeX2HTML
translator Version 98.1 release (February 19th, 1998)
Copyright © 1993, 1994, 1995, 1996, 1997,
Nikos
Drakos, Computer Based Learning Unit, University of Leeds.
The command line arguments were:
latex2html -no_navigation -split 0 -link 6 -show_section_numbers
users.tex.
The translation was initiated by Andrew Berkley on 1999-08-23
Andrew Berkley
1999-08-23
Last Edited 9/28/99 by R. Gammon