21 Oct 2019 - fubar - Sreekar Guddeti
A tutorial on interfacing VISA compatible hardware using python's wrapper module `pyVISA`.
Interfacing test and measurement s
488A is older version of the GPIB to USB adaptor. The driver development is supported only till Windows 7. So if trying to install the driver on later Windows versions, it might get tricky
Newer version is 488B
Download KUSB-488B GPIB driver
Download KUSB-488A GPIB driver
It is essential to have no traces of previous installations of either the GPIB2USB drivers or the VISA libraries. This is ensured from checking the device manager and installed programs.
In case PyVISA-py is already installed in a virtual environment, running
python -m visa info
will list the VISA libraries(either NI’s implementation or PyVISA-py’s own pure Python implemenation). This check is optional and needed only if one is not sure if the drivers and VISA libraries are completely uninstalled
Plug the Keithley GPIB-USB adaptor and check the device manager listing. The hardware is not listed.
Check the installed programs. The driver is for KUSB-488B and the hardware is KUSB-USB488A. Hence it is not listed. Unplug the adaptor and remove the installed driver.
Run ` python -m visa info` and see if the sytem is clean and ready for proper installation
Again plug the the Keithley GPIB-USB adaptor and check the device manager listing. This confirms that the system is ready for a proper installation of hardware.
Ensure the hardware is unplugged
Install the KUSB-488A driver with version 9.2.0. According to the release notes within the source directory,
it is recommended to install the Keithley’s adaptor driver first followed by the NI’s own GPIB-488.2 driver to avoid vendor design conflict.
Rebooting the computer is a requirement after the completion of installations
After reboot, plug the hardware and check if it is installed in the device manager
Install the NI’s implementation of the VISA specification; version 19.0
Uncheck the additional services provided by NI as these will only increase the number of unneccessary processes and services running in the background. In the older versions of NI-VISA, the option to uncheck GPIB-488.2 driver from NI was present in the installer. However the current version automatically checks for the GPIB driver pre-installed and accordingly proceeds with the installation to avoid conflict.
After installation, check for the installed components. Check that the GPIB driver is from Maintainer GPIB-488 whereas NI-VISA is from NI itself.
A successful installation creates visa32.dll
and visa64.dll
dynamically linked libraries. DLL files are shareable libraries which can be ported as it is across systems offering convience of using software without recompiling on new systems. They act like patches.
After the installation, look out for the install location; usually the C:\\Windows\system32
and search for visa32.dll
and visa64.dll
. If they are present there, then PyVISA-py can detect them without fuss. If they are not present there (for some reason), then proceed to the alternative installation
For some reason, my VISA installation has not generated the DLLs at the location. I searched for visa* (* is called a wild card evaluating to any character set like 32.dll or 64.dll) across the WINDOWS directory and found a visa32.dll
at C:\Windows\SysWOW64\visa32.dll
.
To demonstrate the portability of DLL files, I copied the visa32.dll
to the PyVISA virtual environment (described below) and checked for the detection of the visa library.
python -m visa info
lists the detection of the visa32 library at the path of the virtual environment.
However the bitness of Python installation (64 bit) and that of VISA (32bit) do not match. We need to fix this!
Tools available with us:
32 bit VISAcd