Skip to content

Instantly share code, notes, and snippets.

@jddmartin
Last active June 29, 2017 21:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jddmartin/99ea2328f67abe466022f30a7a24d8e6 to your computer and use it in GitHub Desktop.
Save jddmartin/99ea2328f67abe466022f30a7a24d8e6 to your computer and use it in GitHub Desktop.
How to get a CentOS 7 machine running with a National Instruments PCI-GPIB card and NI-VISA, starting with a fresh CentOS install
# How to get a CentOS 7 machine running with a National Instruments
# PCI-GPIB card and NI-VISA, starting with a fresh CentOS install
#
# Jim Martin, University of Waterloo, June 23rd, 2017.
#
# Some of the "reboot"s in the following recipe may not be necessary.
# This document is written in a "script" style, but all commands should be
# copied from here, and run on the command line, answering prompts and
# observing output.
#
# Install PCI-GPIB card in computer.
# Install CentOS to harddrive on computer from DVD
# (I used CentOS-7-x86_64-DVD-1611.iso
# with: sha256sum CentOS-7-x86_64-DVD-1611.iso
# returning:
# c455ee948e872ad2194bdddd39045b83634e8613249182b88f549bb2319d97eb
# in agreement with sha256 listed at::
# https://wiki.centos.org/Manuals/ReleaseNotes/CentOS7
#
# If you are going to be reinstalling repeatedly, or on multiple machines,
# you should consider the use of "Kickstart" to give automatic responses to
# the CentOS installer queries.
#
# Log in as root after all following reboots.
#
cat /etc/centos-release # gives: "CentOS Linux release 7.3.1611 (Core)"
uname -r # gives: "3.10.0-514.el7.x86_64"
#
# "PackageKit" interferes with yum; see: https://unix.stackexchange.com/questions/196078/how-to-avoid-yum-lock-hassle
# Get rid of it:
systemctl stop packagekit
systemctl disable packagekit
sudo yum remove PackageKit
#
# get everything up to date. Future installations may need to inhibit
# kernel updates (see end of these notes) before running updating.
yum update
#
# Install 32 bit versions of some libraries required for National Instruments:
yum install libstdc++.i686 libXinerama.i686 mesa-libGL.i686
# If these 32 bit libraries are not installed errors will typically be:
# Can't load library /usr/local/lib/liblvrt.so.15.0
# libXinerama.so.1: cannot open shared object file: No such file or directory
# To download the LabVIEW Runtime engine, goto ...
# In this case the LabVIEW Runtime engine should NOT be downloaded,
# but instead the 32 bit libraries (above).
#
lspci -v # gives (partial):
# 09:00.0 Communication controller: National Instruments PCI-GPIB (rev 01)
# Flags: bus master, medium devsel, latency 16, IRQ 11
# Memory at fb209000 (32-bit, non-prefetchable) [size=2K]
# Memory at fb204000 (32-bit, non-prefetchable) [size=16K]
# Expansion ROM at fb200000 [disabled] [size=16K]
# Note that there is no "Kernel driver in use:" or "Kernel module:" lines.
reboot
#
uname -r # gives (changed since first boot): "3.10.0-514.21.2.el7.x86_64"
#
# Download or copy from external media, putting on ~/Desktop:
# NIKAL151.iso
# NI4882-15.1.1f0.iso
# NI-VISA-16.0.0.iso # 17.0 is available, but 16.0 worked.
# see:
# http://www.ni.com/download/ni-kal-15.1/6549/en/
# http://www.ni.com/download/ni-488.2---linux-15.1.1/5926/en/
# http://www.ni.com/download/ni-visa-16.0/6185/en/
# I logged in to my NI account in my browser, and then from the command line:
cd ~/Desktop
wget http://ftp.ni.com/support/softlib/kal/15.1/NIKAL151.iso
wget http://ftp.ni.com/support/softlib/gpib/linux/15.1/patch/NI4882-15.1.1f0.iso
wget http://ftp.ni.com/support/softlib/visa/NI-VISA/16.0/Linux/NI-VISA-16.0.0.iso
# Check downloads:
md5sum NIKAL151.iso # returns: b42b45a99c5fbe31f9f9c1bf8b1f8862
md5sum NI4882-15.1.1f0.iso # returns: 7974cebc3db83772b28507162cd5f97b
md5sum NI-VISA-16.0.0.iso # returns: 7bd345779ce11ff79d5cb970d3bf99b3
#
# Install NI-KAL:
mkdir ~/Desktop/mount_location
cd ~/Desktop/
sudo mount -o loop NIKAL151.iso mount_location
cd mount_location/
./INSTALL # a few prompts regarding license etc...
lspci -v # (unchanged since before last boot)
reboot
#
# Install NI-488.2:
cd ~/Desktop/
sudo mount -o loop NI4882-15.1.1f0.iso mount_location
cd mount_location/
./INSTALL # at the end the system queries for reboot. Select "yes".
# After reboot:
lspci -v # gives (partial; note additional "Kernel driver in use:" line)
# 09:00.0 Communication controller: National Instruments PCI-GPIB (rev 01)
# Flags: bus master, medium devsel, latency 255, IRQ 18
# Memory at fb209000 (32-bit, non-prefetchable) [size=2K]
# Memory at fb204000 (32-bit, non-prefetchable) [size=16K]
# Expansion ROM at fb200000 [disabled] [size=16K]
# Kernel driver in use: ni488
gpibtsw # should pop up a window "NI-488.2 Trouble Shooting Wizard"
# showing: GPIB Name: GPIB0, Interface Type: PCI-GPIB , Status: Passed
#
# Install NI-VISA:
cd ~/Desktop/
sudo mount -o loop NI-VISA-16.0.0.iso mount_location
cd mount_location/
./INSTALL
reboot
#
# Everything should be working:
lspci -v # same output as before boot
gpibtsw # same behaviour as before boot
NIvisaic # should show "GPIB Miscellaneous Resources -> GPIB0::INTFC"
# if an instrument on the GPIB bus is turned on
# and "Refresh" is hit, you should see something *like*:
# GPIB Instrument Resources -> GPIB0::7::INSTR
# Selecting instrument and trying "Input/Output", "*IDN?\n"
# should return something, assuming *IDN? is a valid command for
# the instrument.
# Success!!!
#
# To avoid kernel updates, consider editing /etc/yum.conf
# as described at: https://access.redhat.com/solutions/10185
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment