Wednesday, May 13, 2009

Interfacing Experimental Instruments with computer

Once you have decided what experiments you are going to do, the next thing to decide is the measuring instruments you will be needing for building you experimental setup. Most common instruments in the field of condense matter physics experiments are picoammeters, voltage source, cryostat, magnets, LCR meter , oscilloscope , signal generator etc. Now in order to get good results and reducing experiments time you need to interface this instruments with computer in order to completely automize your experiments. The reasons behind doing this is -
1)Manual control of instruments and experiments often lead to human error.
2)It take lot of time and men power when your experiments is human control.
3)Results you get using manual control are often not of good quality.
So in order to overcome this problems you need to make a completely autonomous experimental setup and hence you need to interface these instruments with computer.

The instruments I have in my labs are-
  1. Tektronix TDS1012B oscilloscope.
  2. Tektronix AFG3101 Singal generator.
  3. LCR meter.
  4. Kaithly Picoammeter cum voltage source.
  5. Kaithly nanovoltemeter.
  6. Cryostat.
I am going to tell you how to interface each of these instruments with computer.

Before starting that let us discuss the protocols used to interface instruments and the software we can use to interface these instruments.

The basic communication method with the computer are-
  1. Serial Port communication.
  2. GPIB (General Purpose Interface Bord).
  3. USB
some instruments come GPIB interface for which you need to install a GPIB card in your computer. Some GPIB card are given in below link
http://www.icselect.com/gpib_intfcbds_ds.html

some comes with serial port interface. The serial port is given in many old computer but now in latest computer and Laptops you can't have the serial port for such situation you can use USB-SERIAL PORT CONVERTER.

some instruments comes with USB port and almost all computer has USB port so you don't need to install some other hardware.

Now this was the hardware part now lets switch to software part. Every instruments use a mode for communicating with the computer and our next task is to discuss this mode or protocol for interfacing with the instruments. This protocols are-
  1. SCIP commands.
  2. VISA
  3. IVI
Lets start with SCIP commands. Every instruments which has this facility to interface with computer comes with some set of SCIP commands with can be used to remotely control the instrument from computer. This commands can be found usually in instruments manual in the section like "Interfacing with the computer". Programing the instruments using SCIP commands are ofter known as low level programing. Now we need to send this commands to the instruments, we can either use GPIB interface or Serial port interface. If you know C or C++ programing you just need to link a .dll file which comes with the instrument and then you can just use the syntax fwrite("SCIP command") to send this command to the instruments. The other method is little difficult for this you need to know all the serial port interface protocol as well as serial port programming in order to send this commands.

The better way is to use some software which can make our life lot easier. In the range of scientific measurement software most important are LabView and Matlab. I am also going to post Matlab and LabView tutorials in my blogs but for now we will only consider intefcing using this Matlab. Installing matlab is easy like other software , you just need to follow instruction given in the screen don' forget to install "TEST AND MEASURMENT TOOL BOX". Once you have installed matlab just run it go to the command window and type
>tmtool
after this test and measurement tool box will open click the refresh sign to refresh any hardware connected to you computer. At the left side you will find list of all interface like GPIB , Serial , TCPIP etc if your instrument is connected to GPIB board just go to GPIB tree and then click connect button in the right side of the window , it will show the status to be connected if instrument is connected with the computer. Now you can send SCIP commands from the text box above the send and query button.In order to check if everything is going fine just type
*IDN?
and press inquiry button
the response of this command will be a text string which will be having the information about the connected instrument.
Whenever you send some SCIP commands such that the response of the instrument is to send some text string either you can use inquiry or use send and then read command in sequence.
Once you are done with programing your instrument you can go to log session tab where you will find all the codes for what you have done manually you can use this code to make an m-file.

In instrument control tool box you will also find -
  1. Instrument Objects
  2. Instrument driver.
I will discuss this in later post since its 2:20AM in night and I am feeling sleepy. I think just reading this post will not be that helpful so I will soon post a video which will demonstrate all the content of this post.

Enjoy!

No comments:

Post a Comment