6/19
install driver
Google search for
"National Instruments GPIB driver linux 64-bit" -> first hit
http://joule.ni.com/nidu/cds/view/p/id/1000/lang/en
NI_488.2 Version 2.5 Driver for Linux 64-bit
Download the instillation file.
unpack: tar -xzvf ni...tar.gz
Install:
root]# sh ./INSTALL
*****************************************************************************
NI-488.2 Distribution
version 2.5.4b1 for Linux
*****************************************************************************
National Instruments products support the following Linux distributions:
Mandriva Linux Official
openSUSE
Red Hat Enterprise Linux Desktop + Workstation
Refer to README.txt for the latest information at the time of release.
Refer to www.ni.com/linux for the most recent information about Linux
support at National Instruments.
*****************************************************************************
NATIONAL INSTRUMENTS CONFIDENTIAL
THE SOFTWARE YOU ARE ABOUT TO INSTALL IS NOT A RELEASED VERSION
REFER TO README.txt FOR A LIST OF KNOWN ISSUES
*****************************************************************************
Error:
Install gcc:
$ yum install gcc
Install g++
$ yum install gcc-c++.x86_64
Try again. New error:
************************************ ERROR ************************************* * Kernel source does not appear to be installed for the 2.6.18-128.1.10.el5 kernel. * Installation of the kernel-source package for kernel 2.6.18-128.1.10.el5 is * required to continue this installation. ************************************ ERROR *************************************??
root]# cat /etc/grub.conf | grep kernel
# all kernel and initrd paths are relative to /, eg.
# kernel /boot/vmlinuz-version ro root=/dev/md0
kernel /boot/vmlinuz-2.6.18-128.1.10.el5 ro root=/dev/md0 rhgb quiet
kernel /boot/vmlinuz-2.6.18-53.el5 ro root=/dev/md0 rhgb quiet
root]# more /proc/version
Linux version 2.6.18-128.1.10.el5 (mockbuild@ls20-bc2-14.build.redhat.com) (gcc version 4.1.2 20080704 (Red Hat 4.1
.2-44)) #1 SMP Wed Apr 29 13:53:08 EDT 2009
So I am running Red Hat 4.1. The driver wants 5.0 or 5.1
Options:
- Look into getting Red Hat 5.0 or 5.1
- Other drivers:
NI-488.2 - Beta 64 Bit
NI-VISA
GPIB-ENET Firmware
Talk to Leo:
For some reason the kernal was not up to date:
root]# cat /etc/grub.conf |grep kernel
# all kernel and initrd paths are relative to /, eg.
# kernel /boot/vmlinuz-version ro root=/dev/md0
kernel /boot/vmlinuz-2.6.18-128.1.14.el5 ro root=/dev/md0 rhgb quiet
Fixed!
Utilities:
gpibexplorer - utility to brows, add, and delete GPIB interfaces.
gpibtsw - GPIB trouble shooting wizard
gpibintctrl - GPIB Interactive Control utility
firmwareupdate - GPIB Firmware Update utility
ethernetconfig - GPIB ethernet device conviguration utility
You ca get to everything from the gpibexplorer
6/23
Explore utilities
_
Lakeshore Manual:_
http://www.lakeshore.com/pdf_files/instruments/218_Manual.pdf
Utilities:
gpibexplorer - utility to brows, add, and delete GPIB interfaces.
gpibtsw - GPIB trouble shooting wizard
gpibintctrl - GPIB Interactive Control utility
firmwareupdate - GPIB Firmware Update utility
ethernetconfig - GPIB ethernet device conviguration utility
You ca get to everything from the gpibexplorer
Chapter 6 on computer interface
Mode 318 IEEE-488 interface capabilities
• SH1: Source handshake capability.
• RL1: Complete remote/local capability.
• DC1: Full device clear capability.
• DT0: No device trigger capability.
• C0: No system controller capability.
• T5: Basic TALKER, serial poll capability, talk only, unaddressed to talk if addressed to listen.
• L4: Basic LISTENER, unaddressed to listen if addressed to talk.
• SR1: Service request capability.
• AH1: Acceptor handshake capability.
• PP0: No parallel poll capability.
• E1: Open collector electronics.
Set the Interface to Baud 9600
Select Address 12
Terminator setting: Cr Lf
Power down and back up
1) Bus Control 2) Common 3) Interface and Device Specific
7/28
Lakeshore readout
Lakeshore 218 temperature monitor
$ gpibdxplorer
Help: file:///usr/local/natinst/ni4882/docs/OnlineHelp/GpibHelp/index.htm
c library:
NI-488.2 includes libgpibapi.so—a dynamic library you can use from your C/C++ applications.
g++ prog.cpp -lgpibapi
current error:
[lab@spudws3 ~/lakeShore]$ g++ test.cc -lgpibapi -o test /usr/bin/ld: skipping incompatible /usr/local/lib/libgpibapi.so when searching for -lgpibapi /usr/bin/ld: cannot find -lgpibapi collect2: ld returned 1 exit status
New error: I think the file cib.o is written for 32-bit
[lab@spudws3 ~/lakeShore]$ g++ test.cc /usr/local/natinst/ni4882/lib/cib.o -ldl /usr/bin/ld: warning: i386 architecture of input file `/usr/local/natinst/ni4882/lib/cib.o' is incompatible with i386:x86-64 output
Troubleshooting
/usr/local/natinst/ni4882/bin/gpibtsw
-> Passed
Current driver:
NI-488.2 Distribution
version 2.5.4b1 for Linux
Not the answer I wanted:
http://digital.ni.com/public.nsf/allkb/D4F2801E11FDCA2286256ED9004B4599
Problem: I am writing code on a 64-bit Linux machine and need to make calls to the NI-488.2 driver. Does National Instruments provide this ability? Solution: Unfortunately, the libraries included with the 64-bit Beta 488.2 driver are kernel mode only. This means that programs will run on 64-bit systems, but they must be 32-bit applications. All current driver versions support up to 32-bit systems. The cib.o language interface provided by National Instruments will not link into 64-bit code. If a 64-bit system must be used in your application, one option is to actually compile a 32-bit program on your 64-bit system and link to the GPIB library through the 32-bit code. There is no way to link 64-bit code to the National Instruments GPIB library.
Idea: try setting up a 32bit chroot
7/30
compiling in 32-bit: glibc-devel.i386
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h:
No such file or directory
Install glibc-devel.i386 0:2.5-34
7/31
This now works:$ g++ -m32 test.cc -lgpibapi $ g++ -m32 test.cc -lgpibapi or $ g++ -m32 test.cc /usr/local/natinst/ni4882/lib/cib.o -ldl
Dynamic interface library
libgpibapi.so
initialization
ibdev
pad - The promary GPIB address of the device
ibc
device communication
clean up
interactive control:
$ /usr/local/natinst/ni4882/bin/gpibintctrl
: ibfind
enter board/device name: gpib0
gpib0:
gpib0: ibwrt "*IDN?"
[c100] ( err timo cmpl )
error: EABO
count: 0
gpib0:
Follow this page:
file:///usr/local/natinst/ni4882/docs/OnlineHelp/GpibHelp/index.htm?ni4882linux.chm/gpib6iev.html
: ibdev
enter board index: 0
enter primary address: 6
enter secondary address: 0
enter timeout: 13
enter 'EOI on last byte' flag: 1
enter end-of-string mode/byte: 0
ud0: ibclr
[0100] ( cmpl )
ud0: ibwrt
enter string: "*IDN?"
[8100] ( err cmpl )
error: ENOL
count: 0
ud0: ibrd
enter byte count: 29
[c100] ( err timo cmpl )
error: EABO
count: 0
ud0: ibonl 0
[0100] ( cmpl )
I think I am not connected.
troubleshooting
Trouble shooting utility
/usr/local/natinst/ni4882/bin/gpibtsw
This all reports OK
: ibfind enter board/device name: GPIB0
GPIB0: ibfind
enter board/device name: GPIB1
[8000] ( err )
error: EDVR (0xe0140025)
GPIB0: ibclr
[8000] ( err )
error: EHDL
Thus I think the code is finding the device properly, and the device
is named GPIB0
Set the address to 6 on the physical Lakeshore box via:
Interface (button #6)
-> Baud - hit enter
-> Address - set to 06, hit enter
: ibdev 0 6 0 13 1 0
ud0: ibclr
[0100] ( cmpl )
ud0: ibrd
enter byte count: 29
[0100] ( cmpl )
count: 29
4c 53 43 49 2c 4d 4f 44 L S C I , M O D
45 4c 32 31 38 53 2c 32 E L 2 1 8 S , 2
32 41 32 37 36 2c 30 31 2 A 2 7 6 , 0 1
31 31 30 38 0d 1 1 0 8 .
ud0: ibwrt "*IDN?"