Personal tools
You are here: Home Exp Spec Info pol OLD OLD PPC POL document gpib_install_driver

gpib_install_driver

by admin last modified Sep 23, 2010 12:56 PM

Instructions describing how to install the gpib driver (SL4)

To install gpib driver SL4 (2.6 kernel)

- supports NI gpib calls

<http://linux-gpib.sourceforge.net/doc_html/index.html>


<http://linux-gpib.sourceforge.net/

Tells us how to download the code by clicking on "source code"

View release notes for required package (under Notes/Monitor)
Select Release 3.2.09

Download.
I downloaded to /root/gpib on midtis07 but it doesn't have to be in root.

-> file

linux-gpib-3.2.09.tar.gz
Unzip using e.g
tar -zxf linux-gpib-3.2.09.tar.gz

This creates a directory linux-gpib-3.2.09

cd to linux-gpib-3.2.09

[root@midtis07 linux-gpib-3.2.09]# ls

aclocal.m4 config.log drivers libtool README
AUTHORS config.status etc ltmain.sh README.HAMEG
bootstrap config.sub examples m4 README.hp82335
ChangeLog configure include Makefile stamp-h1
compile configure.ac INSTALL Makefile.am test
config.guess COPYING install-sh Makefile.in TODO
config.h depcomp language missing usb
config.h.in doc lib NEWS util
[root@midtis07 linux-gpib-3.2.09]#

Read the installation notes,

less INSTALL

Reading INSTALL, the first steps of installing the GPIB board were already done, and the linux kernel source code was on the machine.


Installing the linux-GPIB (see INSTALL item B)

./configure
make
make install

The .so libraries go in /usr/local/lib/

pol@midtis07 dvm]$ locate libgpib.so
/usr/local/lib/libgpib.so.0.1.3
/usr/local/lib/libgpib.so.0
/usr/local/lib/libgpib.so

Make sure the directory you installed the
shared library to is listed in your /etc/ld.so.conf file,
so that ld can find libgpib.so. If the directory is not listed,
add it and then run 'ldconfig'.

Making sure the directory to which the shared library was installed is
listed in the /etc/ld.so.conf file:

less /etc/ld.so.conf
include ld.so.conf.d/*.conf
/usr/ofed/lib
/usr/local/lib

If not, add it and then run 'ldconfig'

Let anyone access the device so change permissions:

chmod a+rw /dev/gpib0


The GPIB is a PCI device. Find it with

/sbin/lspci -v


01:0c.0 Communication controller: National Instruments PCI-GPIB (rev 01)
Flags: bus master, medium devsel, latency 64, IRQ 6
Memory at ff8ff800 (32-bit, non-prefetchable) [size=2K]
Memory at ff8f8000 (32-bit, non-prefetchable) [size=16K]
Expansion ROM at ff8f4000 [disabled] [size=16K]

Look in the online documentation
http://linux-gpib.sourceforge.net/doc_html/index.html
Click on Supported Hardware Matrix

Our GPIB board is National Instruments PCI-GPIB (rev 01)
This is listed, showing
the kernel driver module is : tnt4882.ko
and the board_type (for /etc/gpib.conf) is : ni_pci
There are no board-specific notes.

Next run modprobe (item D in INSTALL)
modprobe tnt4882 (name tnt4882 came from above kernel driver module).

Look at /etc/gpib.conf
...
minor = 0 /* board index, minor = 0 uses /dev/gpib0, minor = 1 uses /dev/gpib1, etc.
*/
board_type = "ni_pci" /* type of interface board being used */
name = "violet" /* optional name, allows you to get a board descriptor using ibfind() */
pad = 0 /* primary address of interface */
sad = 0 /* secondary address of interface */
timeout = T3s /* timeout for commands */
.....

This looks OK.

Run the 'gpib_config' utility to setup the driver

gpib_config --minor 0
(minor 0 means use /dev/gpib0 which we set permissions on above)



There is a test pgm (ibtest) in "examples".



If necessary, recompile feDVMtest on midtis07

Check the environment variables for MIDAS
[pol@midtis07 dvm]$ printenv | grep MIDAS
MIDASSYS=/home/pol/packages/midas
MIDAS_EXPTAB=/etc/exptab
MIDAS_PHYSICS_EVID=-1
MIDAS_EVENT_MODE=2
MIDAS_TRIGGER_MASK=-1
MIDAS_EXPT_NAME=pol

No hostname so will run locally. (mserver not run on this machine so -h will not work).

Run feDVMtest locally on midtis07 as experiment "test" :

[pol@midtis07 dvm]$ feDVMtest -e test
Frontend name : feDVMtest
Event buffer size : 2097152
Buffer allocation : 2 x 2097152
System max event size : 524288
User max event size : 32768
User max frag. size : 5242880
# of events per buffer : 64

Agilent34970A_config
[dd_gpib.c:295:gpib device driver] GPIB ibwrt addr 8 cmd SYST:CTYP? 100 error code 0xc100
InternalReceiveSetup: command failed
[dd_gpib.c:350:gpib device driver] GPIB ibrd addr 8 cmd error code 0xc100
Module in slot 100 is
[cd_Agilent34970A.c:416:Agilent34970A_config] Mismatch for ODB module type and hardware
Agilent34970A_multi
[dd_gpib.c:295:gpib device driver] GPIB ibwrt addr 8 cmd *ESE 1; error code 0xc100
[dd_gpib.c:295:gpib device driver] GPIB ibwrt addr 8 cmd ROUT:SCAN (@101,102); error code 0xc100
cd_Agilent34970A_read
[dd_gpib.c:295:gpib device driver] GPIB ibwrt addr 8 cmd *ESR? error code 0xc100
InternalReceiveSetup: command failed


This is because the GPIB devices were switched off.

Note: the DVM is in the same rack as the computer (rack to the left of the
one with the VME crate in it).
The wavemeter is in the laser hut.

After powering up,

[pol@midtis07 dvm]$ feDVMtest -h midtis07
Frontend name : feDVMtest
Event buffer size : 2097152
Buffer allocation : 2 x 2097152
System max event size : 524288
User max event size : 32768
User max frag. size : 5242880
# of events per buffer : 64

Agilent34970A_config
Module in slot 100 is HEWLETT-PACKARD,34901A,0,2.3

SENS:FUNC "VOLT:DC",(@101)
SENS:VOLT:DC:RANG 10,(@101)
SENS:VOLT:DC:NPLC 10,(@101)
SENS:FUNC "TEMP",(@102)
SENS:TEMP:TRAN:TC:TYPE J,(@102)
SENS:TEMP:NPLC 1,(@102)
Module in slot 200 is HEWLETT-PACKARD,34907A,0,1.1

No config action for multi
Agilent34970A_config done 101,102,
Agilent34970A_multi
cd_Agilent34970A_read
GET -7.80000000E-06,+2.42450000E+01

Acq time 1267294174
cd_Agilent34970A_read
GET -5.08000000E-05,+2.43510000E+01

Acq time 1267234095
cd_Agilent34970A_read
GET -4.30000000E-05,+2.43460000E+01

Acq time 1267174043
cd_Agilent34970A_read
GET -3.91000000E-05,+2.43820000E+01

Acq time 1267113991
cd_Agilent34970A_read
GET -2.87000000E-05,+2.43140000E+01

------ started a run

Acq time 1266921184
Measured data -0.000008
rdata is -0.000008
Measured data 24.195999
rdata is 24.195999
Measured data 0.000013
rdata is 0.000013
Measured data 24.194000
rdata is 24.194000
Measured data 0.000012
rdata is 0.000012

..... ended a run


Measured data 24.153999
rdata is 24.153999
cd_Agilent34970A_read
GET +1.17000000E-05,+2.41690000E+01

Acq time 1266913034
Measured data -0.000006
rdata is -0.000006
Measured data 24.149000
rdata is 24.149000
cd_Agilent34970A_read
GET -5.20000000E-06,+2.41740000E+01


Then started the DAQ on isdaq01 and seemed to run without complaining.


NOTE: to recreate the devices /dev/gpib if they disappear

as root
# cd /usr/local/src/gpib/linux-gpib-3.2.09/drivers
# make /dev/gpib0
# ls -l /dev/gpib0
# crw-rw---- 1 root gpib 160, 0 Jul 10 13:02 /dev/gpib0
Change permissions so everyone can read/write
# chmod a+rw /dev/gpib0
# ls -lt /dev/gpib0
crw-rw-rw- 1 root gpib 160, 0 Jul 10 13:02 /dev/gpib0

Document Actions