This is a Python script for acquiring from the HP4194A impedance analyzer using the Prologix GPIB-USB Controller. The PyVISA library is used to communicate over the USB link.
The Prologix controller can be purchased from Sparkfun.
- Install the FTDI VCP Driver (OSX only, not needed on Linux).
- Create a Python environment.
$ python3 -m venv venv $ . venv/bin/activate $ pip install -U pip $ pip install -r requirements.txt
- macOS 10.13.3 and Ubuntu 16.04
- Python 3.6.7
- FTDI USB Serial Driver 2.4.2 (2017-05-02)
- Prologix GPIB-USB Controller version 6.107
On MacOSX, the following error has been seen:
Traceback (most recent call last):
File "./hp4194a.py", line 10, in <module>
import pylab
File "/Users/rjollos/.pyenv/versions/hp4194a-3.6.5/lib/python3.6/site-packages/pylab.py", line 1, in <module>
from matplotlib.pylab import *
File "/Users/rjollos/.pyenv/versions/hp4194a-3.6.5/lib/python3.6/site-packages/matplotlib/pylab.py", line 252, in <module>
from matplotlib import cbook, mlab, pyplot as plt
File "/Users/rjollos/.pyenv/versions/hp4194a-3.6.5/lib/python3.6/site-packages/matplotlib/pyplot.py", line 115, in <module>
_backend_mod, new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/Users/rjollos/.pyenv/versions/hp4194a-3.6.5/lib/python3.6/site-packages/matplotlib/backends/__init__.py", line 62, in pylab_setup
[backend_name], 0)
File "/Users/rjollos/.pyenv/versions/hp4194a-3.6.5/lib/python3.6/site-packages/matplotlib/backends/backend_macosx.py", line 17, in <module>
from matplotlib.backends import _macosx
RuntimeError: Python is not installed as a framework. The Mac OS X
backend will not be able to function correctly if Python is not
installed as a framework. See the Python documentation for more
information on installing Python as a framework on Mac OS X. Please
either reinstall Python as a framework, or try one of the other backends.
If you are using (Ana)Conda please install python.app and replace the
use of 'python' with 'pythonw'. See 'Working with Matplotlib on OSX' in
the Matplotlib FAQ for more information.
The solution described in this StackOverflow response has successfully solved the issue.
- Add
reset
command:./hp4194a --reset
- Improve error handling. For example, when LOCAL is pressed during acquisiiton.