Python + GPIB (Prefer ethernet) + Windows - Recommendations? - Page 1
Forum section: electronics / testgear

author: inaxeon
author_rank: Regular Contributor
timestamp: July 19, 2022, 08:50:52 am
content: Hey folksCan anyone recommend what a solution to meet the above requirements? All I want is to program GPIB stuff in Python, preferable over ethernet, I'm on Windows.

author: alm
author_rank: Super Contributor
timestamp: July 19, 2022, 11:21:01 am
content: I'd get something that implements VXI-11. They can easily be used throughpython-vxi11,PyVISA-pyorpython-ivi. This saves you from the mess of having to install a huge VISA framework like NI-VISA or Keysight IO libraries, and keeps everything in pure Python that is much more stable and less hassle to set up in my experience.I have good experiences with the HP E2050A, Agilent/Keysight E5810A, Tektronix AD007 and theTAMS L488. Thisopen source GPIB ethernet adaptermight also work, but I haven't tried it.

author: switchabl
author_rank: Frequent Contributor
timestamp: July 19, 2022, 11:44:46 am
content: I have had the best experience with the NI stuff, it has been pretty much rock solid and seems to work with basically any instrument (PCI and USB adapters, haven't used their Ethernet gateway). I think NI-VISA is around 1GB these days, I don't really care anymore, as long as it does the job.+1 for PyVISA, it is easy to use and has a backend for NI-VISA as well. If you want to switch to the native PyVISA-py backend (or vice versa) later on, it is trivial.

author: alm
author_rank: Super Contributor
timestamp: July 19, 2022, 01:36:41 pm
content: Quote from: switchabl on July 19, 2022, 11:44:46 amThe Ethernet / VXI-11 solutions will keep working for as long as Ethernet over copper and Python are supported. You could run it on an Android device if you wanted to. The PCI/USB solutions will keep working for as long as the manufacturer (e.g. NI) decide to support them on the platform you use. I've been burned by this before, for example NI not supporting their GPIB-USB devices on Linux versions released in the last decade. Never mind supporting hardware like Raspberry Pi.To me, unless you want to use software that requires NI-VISA/Keysight IO Libraries (e.g. LabView or BenchVue), they are not worth the hassle anymore. Installing a pure Python module like python-vxi11 is just so much easier. Your use case may vary.

author: jjoonathan
author_rank: Frequent Contributor
timestamp: July 19, 2022, 02:29:49 pm
content: Yes, python-vxi11 / pyvisa-py / ethernet is the way! No PCI/USB drivers, no morbidly obese vendor libraries, no Windows (it works on Windows, but it doesn't need Windows), no nonsense. Just python and ethernet. Beautiful.I use AD007 Ethernet->GPIB adapters which are the first ones I tried. They work great.

author: RoGeorge
author_rank: Super Contributor
timestamp: July 19, 2022, 02:50:49 pm
content: PyVisa, here's my post for how to start using pyvisa as a beginner:https://www.eevblog.com/forum/projects/exit/

author: switchabl
author_rank: Frequent Contributor
timestamp: July 19, 2022, 02:58:21 pm
content: Agreed, VXI-11 is certainly a lot more portable. And Linux is a whole different story, native GPIB on Linux can be a real pain. There is an actively-maintained open-source implementation (linux-gpib) but you have to build it yourself, it needs an out-of-tree kernel module and it doesn't have a VISA interface. Then there is NI-VISA which doesn't support USB and really needs a compatible distribution.Is there a more recent version of python-vxi11? The one on PyPI is marked beta and was last updated in 2017. That may be an issue if you don't have the skill or resources to fix problems yourself.Still, certainly an option if you are starting fresh. Unfortunately, many places have existing code that relies on VISA (through .NET, Matlab or even LabVIEW). In that case I will take NI-VISA over Keysight IO any day.

author: inaxeon
author_rank: Regular Contributor
timestamp: July 20, 2022, 05:01:45 am
content: Okay thanks for the suggestions. Yes I was hoping it was possible to do without VISA as it appears that NI are rather eager to discontinue support for old ethernet hardware, much of which is still very expensive. VXI-11 Looks like the avenue I'll go down.

author: alm
author_rank: Super Contributor
timestamp: July 20, 2022, 05:02:56 pm
content: Quote from: switchabl on July 19, 2022, 02:58:21 pmAs far as I know it's barely maintained. I remember needing to wait for month for compatibility with a new kernel shipped with one of the major distributions. And it's not stable with some NI GPIB-USB hardware: the driver will stall at times and the driver needs to be reloaded to fix it. Not much fun for long-term logging projects. I haven't had any problems since switching to VXI-11 GPIB controllers.Quote from: switchabl on July 19, 2022, 02:58:21 pmThere'sa bunch of scattered forksthat add some minor changes. But none of them is mainstream, as far as I know. I've been using the git master version which has been stable for me.