GPIB

From Nanoelektronikk

Revision as of 06:15, 3 October 2014 by Olavky (Talk | contribs)
(diff) ← Older revision | Current revision (diff) | Newer revision → (diff)
Jump to: navigation, search

GPIB on Linux

For GPIB to work on Linux, the following has to be done:

  • Check if the GPIB-driver is installed on your Linux-machine:
$ /sbin/lsmod |grep tnt4882
tnt4882                28164  0 
nec7210                23296  1 tnt4882
gpib_common            41540  2 tnt4882,nec7210
$ ll /dev/gpib0
crwxrwxrwx    1 root     root     160,   0 2006-07-31 09:10 /dev/gpib0
  • If the driver is missing contact the NANO engineer to get it installed. Supplying the name of the machine together with the request will speed up the process.
  • After the startup the following command is run in Matlab:
$ addpath(genpath('/hom/mes/src/matlab/gpib/linux'));

This sets the right paths to the GPIBmex-files.

The scripts on /hom/mes/src/matlab/gpib/linux/M* is modified versions made for GPIB on Solaris. Script for instruments can be copied from /hom/mes/src/matlab/gpib/sun/GPIBM/ and be modified to be used on Linux. There is a fundamental difference between the scripts of the different platforms. In stead of using the name of the instrument as identification, the GPIB-scripts for Linux uses the address of the instruments as ID. Other than that the scripts are nearly identical, except that the error messages has been moved to the underlying mex-functions.

Example:

for solaris-gpib:

function FL45_Init(FL45Name)
% function FL45_Init(FL45Name)
% Initializes the Fluke 45 multimeter 
% written by dagwis@ifi.uio.no 1/8-96
if nargin==0, FL45Name='FL45'; 
end 
GPIB_Write('*CLS; *RST; *ESE 32; AUTO; CLR2; DBCLR; HOLDCLR; RELCLR;
COMPCLR;', FL45Name);
if FL45_Error(FL45Name),
 error(['Error in initializing FL45 : ' FL45Name]);
end

for linux-gpib:

function FL45_Init(FL45Adr)
% function FL45_Init(FL45Adr)
% Initializes the Fluke 45 multimeter
% written by dagwis@ifi.uio.no 1/8-96
% modified for linux-gpib by haavarkr@ifi.uio.no 10/2005
if nargin==0, FL45Adr=5; end % der 5 er gpib adressen til instrumentet.
GPIB_Write('*CLS; *RST; *ESE 32; AUTO; CLR2; DBCLR; HOLDCLR; RELCLR;
COMPCLR;', FL45Adr);


Good luck! :)

Personal tools