Code covered by the BSD License  

Highlights from
KPIB: Kenny-Purpose Interface Bus

5.0

5.0 | 4 ratings Rate this file 31 Downloads (last 30 days) File Size: 344.18 KB File ID: #12051

KPIB: Kenny-Purpose Interface Bus

by M. A. Hopcroft

 

24 Aug 2006 (Updated 04 Jan 2011)

A common interface for control of multiple scientific instruments with GPIB and serial connections.

| Watch this File

File Information
Description

kpib.m contains code for GPIB and serial port communication for a number of scientific instruments, organized so that a single common command syntax can operate them all. For example, the command:
r = kpib(INSTRUMENT,GPIB,'read');
will return the voltage and current reading from a number of different power supplies. The goal is to be able to write matlab code that can accommodate changing instruments and experimental setups with minimum hassle. If INSTRUMENT and GPIB are defined as constants at the beginning of your code, then they can be changed to accommodate new equipment, and the rest of the code is unchanged. In addition, kpib can test whether an instrument exists at an address and read and write arbitrary strings to instruments for testing.

Supported instruments (v4.88):

  Temperature Controllers

'BlueOven' 2800 Controller for Thermotron S-1.2 Thermal Chamber
              (aka "Blue Oven")
'GreyOven' ICS 4809 Modbus interface to Watlow F4 Controller for
              TestEquity 1007S Thermal Chamber (aka "Grey Oven")
'AcuOven' Watlow 981 Temperature controller for Acutronic inertial
              test chamber. Also 'WAT_981'
'AO_800' Alpha Omega Instruments Series 800/850 Temperature
              Controller using Watlow Series 96 controller
              (Modbus serial comm.)
              (RS-232 device, specify 'COM1' for GPIB address)
'CV_TIC304' CryoVac TIC 304-MA Temperature Controller
'SI_9700' Scientific Instruments model 9700 Temperature Controller
'NP_3150' Newport Temperature Controller Model 3150

  Signal Analyzers

'HP_89410A' HP 89410A Vector Signal Analyzer
'HP_4195A' HP Network/Spectrum Analyzer
'HP_4395A' HP 4395A Network/Spectrum Analyzer
'HP_8753ES' HP 8753ES S-Parameter Network Analyzer
'AG_E5071B' Agilent E5070B/E5071B RF Network Analyzer
'HP_8560A' HP 8560A Spectrum Analyzer

  Oscilloscopes

'TEK_TDS' Tektronix TDS family Oscilloscopes
'HP_54600' Hewlett-Packard 54600-series Oscilloscopes (HP_54602B)
'HP_54800' Hewlett-Packard 548XX Infiniium Oscilloscopes (HP_54845A)

  Waveform/Function Generators

'HP_33120A' HP 33120A 15 MHz function generator
'AG_33250A' Agilent 33250A 80 MHz Function generator
'SRS_DS345' Stanford Research Systems DS345 30 MHz function generator
'FLK_290' Fluke 290 series (291, 292, 294) arbitrary waveform generators

  Multimeters

'HP_3478A' Hewlett-Packard 3478A multimeter
'HP_34401A' HP 34401A multimeter
'HP_34420A' HP 34420A 7.5 Digit Nanovoltmeter with RTD measurement

  Power Supplies

'HP_E3631A' HP E3631A triple output DC power supply
'HP_6614C' HP 6614C single-output 100V/0.5A DC power supply
'HP_E3632A' HP E3632A DC power supply 15/30 V
'HP_E3634A' HP E3634A DC power supply 25/50 V
'HP_E3641A' HP E3641A DC power supply
'HP_E3647A' HP E3647A dual output DC power supply
              (incl. TDS 340, TDS 540, TDS 744A)
'HP_E3633A' HP E3633A DC power supply 8/20 V

  Other Instruments

'HP_53132A' HP 53132A 225 MHz Universal Counter
'KTH_236' Keithley 236/237/238 Source Measure Unit
'KTH_2400' Keithley 2400 Source-Measure Unit (minimum functionality)
'HP_4284A' HP 4284A LCR Meter
'HP_3499B' Agilent 3499B Multiplexer
'VH_2701C' Valhalla 2701C voltage calibrator
'VH_2701B' Valhalla 2701B voltage calibrator (limited functionality)
'OH_EXP' Ohaus Explorer precision balances (incl. Pro models)
'ACT_3000' Acutronic 3000-series inertial test station controller

Documentation for each instrument is in the code. Use the "Find" command or use the Cell menu in the MATLAB Editor (the "%%" menu) to jump to the code for a specific instrument, or use "showdemo kpib" to open the code in the Help browser.

The device drivers are not complete; they are based on user needs. A code template is provided for adding other instruments or commands. See the comments ("showdemo kpib") for details. Note that the code assumes a single National Instruments PCI GPIB interface card, but this can be changed to other hardware supported by MATLAB, incl. USB, as well as serial port controllers (e.g. Prologix). See help for details. Feedback and contributions are welcome.
Includes sample programs.

Acknowledgements
This submission has inspired the following:
res_meas
Required Products Instrument Control Toolbox
MATLAB release MATLAB 7.1.0 (R14SP3)
Other requirements GPIB interface hardware, see: http://www.mathworks.com/products/instrument/supportedio13769.html and/or serial port for RS-232 connections
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (11)
06 Nov 2006 jaime casas

This was I lookingfor...
now let me check it out

19 Nov 2007 Enrique Medina

Thank you for submitting this helpful interface for GPIB. It will certainly save me a lot of time. I believe I may have found a bug. I am using a Tektronix TDS-744A oscilloscope, and when using the getdata command I was able to get the x data correctly, but the only way to obtain the y data instead of NaNs was to change the indices in lines 2218-2220 from 13,14,15 to 14,15,16. I have not tested this thoroughly, but it worked for one example.

14 May 2008 shanthakumar k

can u give the documents also for this file.......

if so its very useful

25 Nov 2008 yad so

hey can you help me i need to have conection with a source keithley 236 for my tesis proyect, but i don't know how to start

29 Nov 2008 M. A. Hopcroft

Well, to get started you need to have some GPIB interface hardware to make the connection from the computer to the instrument. The list of MATLAB-supported devices is here:
http://www.mathworks.com/products/instrument/supportedio13769.html

30 May 2009 Suyash Jain  
27 May 2010 Damien Leduc

Hello,
I use a generator hp33120a and "kpib.m"
I want to create with "kpib.m" a burst (sinusoidal) of 5 periods. Has anyone any idea ?
Thank you in advance for your answer.

10 Jun 2010 M. A. Hopcroft

Burst support has been added for the HP_33120A and the AG_33250A.

25 Aug 2010 Harish

This was extremely helpful in automating my measurements. Thank you so very much.

16 Jun 2011 Patricia

I'm using the AO_800 and am able to set the temperature (but not get a confirmation from fread). I am able to check the Watlow screen to verify the tempereture set--which is correct. However, I am unable to read the temperature back. There's always a timeout and a warning that the data was not returned within the timeout period.

16 Jun 2011 M. A. Hopcroft

The AO_800 serial communication is often tricky and temperamental. Contact me directly through the email on my author page and I will try to help.

Please login to add a comment or rating.
Updates
19 Sep 2006

New in v3.88:
-Two new instruments submitted by users
-assorted bugfixes
-53132A 'getdata' for faster operation

08 Nov 2006

-Simplified input syntax: combine instrument, gpib, channel into a single parameter
-New Instrument: HP 3499B Multiplexer
-Asst. Bugfixes and improvements (see comments)

13 Nov 2006

Incl. sample program "oven.m"

08 Jan 2007

Added 'config'/'getdata' commands for faster operation of multimeters; HP 33120A Fun. Gen. code fixed; various bugfixes.

26 Feb 2007

Assorted small bugfixes for HP_53132A, HP_89410A, HP_4395A, SRS_DS345 (see comments for details)
More documentation

16 May 2007

v4.38: added support for log frequency sweeps on Analyzers;
misc. bug fixes, see comments

24 May 2007

v4.39 HP89410 set source frequency

14 Aug 2007

New instruments: Valhalla 2701 voltage calibrators, Newport 3150 temperature controller.
Asst. bugfixes, see changelog in code comments

08 Feb 2008

New instrument: Hewlett-Packard 4195A Network Analyzer.
New Interface: Supports Prologix USB-GPIB interface (and similar virtual serial port -based hardware)

08 Apr 2008

Added support for Keithley 2400 Source-Measure Unit.
Bugfixes for Prologix USB support.

13 May 2008

-Added support for Hewlett-Packard 54600 series oscilloscopes
-Other minor bugfixes
-See code comments for details

15 May 2008

typo fixes

26 Sep 2008

Added New Instrument: OHaus Explorer precision balances
Reformatted code to use Cells and Help Browser

17 Nov 2009

Added new instruments

14 Dec 2009

Agilent E5070B/E5071B fully supported

04 Jan 2010

minor bugfixes for HP_4395A, AG_E5071B; added html help file

14 May 2010

v4.86: several new instruments added, new command 'scan' for detecting connected instruments. see changelog for details

16 May 2010

v4.87 fixed bugs in TEK_TDS, updated sample programs

05 Jun 2010

v4.88 add burst mode to HP_33120A,AG_33250A. Bugfix for HP_54800

04 Jan 2011

v4.94: add support for Acutronic inertial test station. Improvements to code for Keithley 236/7/8 SMUs. Other improvements.

Tag Activity for this File
Tag Applied By Date/Time
instrument drivers M. A. Hopcroft 22 Oct 2008 08:35:36
instrument control M. A. Hopcroft 22 Oct 2008 08:35:36
gpib M. A. Hopcroft 22 Oct 2008 08:35:36
serial port M. A. Hopcroft 22 Oct 2008 08:35:36
instrument driver Data Acquisition Team 28 Oct 2008 11:39:42
instruments M. A. Hopcroft 26 Apr 2010 17:40:29
serial port Orkun Ogucu 04 Apr 2011 06:52:26

Contact us at files@mathworks.com