Author Topic: Computer comms w/ Instrument (USB, GPIB, IEE488, RS232...) - simple guide?  (Read 1322 times)

0 Members and 1 Guest are viewing this topic.

Offline RaxTopic starter

  • Super Contributor
  • ***
  • Posts: 1110
  • Country: us
Hi all,
Is there a known, simple, accessible writeup somewhere that would introduce one (particularly of the kind that's a bit short in time and patience...) to ways in which one can connect their computer with their bench instruments?
I've never been able to scratch the surface too much, but I do have:
  • An USBGPIB kit of parts (unbuilt), but also a couple of built ones
  • an RS232 to USB cable (which I have no idea if correct!)
I have a bunch of HP, Fluke, Tektronix and many other branded instruments.
Some other potentially useful thoughts/asks:
  • I highly prefer USB as interface
  • What software offers a good balance between complexity/features, simplicity of installing and making work, and maybe cheap or zero licensing cost?
  • What are some of the things to know? For instance, IEEE488 comes with some address settings... How's that visible from the computer/program side?
  • What types of instruments I'd like to connect? Mostly metrology stuff (DMMs from 6.5 to 8.5 digits, calibrators of all sorts - mostly Fluke, but not only), but other things such as maybe a scope or three - HP, Tek, Rigol, etc., generators of all sorts (HP, R&S, etc.) etc etc
I'm sure I probably asked all the wrong questions...
Thanks a bunch!
« Last Edit: October 10, 2023, 01:44:24 am by Rax »
 

Offline jjoonathan

  • Frequent Contributor
  • **
  • Posts: 865
  • Country: us
I personally think USB is best for applications with built-in drivers but falls off hard if you have to manage the drivers yourself. Test equipment drivers are particularly bad. It always seems to turn into a fight. Ethernet is never as smooth as plugging in a USB HID keyboard but you never have to fight drivers even if you want to code in python on linux from a laptop connected through wifi alone.

My stack: AD007 GPIB<->Ethernet Bridge, python-vxi11, jupyterlab.

EDIT: AD007 is no longer cheap. The key ingredient here is vxi11 compatibility, which is spoken by the python library. Depending on what you can find, this can tip the equation. Whatever you choose, best of luck  :-+
« Last Edit: October 10, 2023, 02:05:19 am by jjoonathan »
 

Offline RaxTopic starter

  • Super Contributor
  • ***
  • Posts: 1110
  • Country: us
Ethernet is never as smooth as plugging in a USB HID keyboard but you never have to fight drivers even if you want to code in python on linux from a laptop connected to wifi.
Over network is the best of all worlds - I'd be mind blown to harvest data from my living room laptop when I don't feel like sitting in the garage, where my bench is - but in my case I can't really imagine it being practical, unless I:
  • Have some way to connect all instruments to wifi. Nope, right?
  • I connect all instruments to my bench desktop, which is online itself via wifi. Connecting them to the desktop would still have to be USB, so...
But maybe there's a simpler solution I am not aware of.
 

Offline jjoonathan

  • Frequent Contributor
  • **
  • Posts: 865
  • Country: us
You don't need a computer at your bench, just some GPIB cables to wire them to the AD007 (or similar) and an ethernet cable to put the AD007 on your network.
 

Online coromonadalix

  • Super Contributor
  • ***
  • Posts: 7008
  • Country: ca
there is no simple guide,  even if many brands do use rs232, gpid, lan interfaces, gpid interfaces, fakes or genuine ones, ar488 project here on eevblog, prologix adapters, arduino based ones, raspi  ...

you have IVI drivers, visa drivers, USB tmc, LXI compatible ....   and you have some of their softwares, and excel macro enabled sheets, vb, c++, c#, Python   etc ...

Nothing is perfect between many brands,  mostly old stuff vs more recent ones

There is a few software pieces here on eevblog forums who can be useful and slightly standardize some equipment, work in progress ...

there is no definitive answers to help you, you'll have to dig and read ... and do tests

Python is lately getting more traction, compatible with many os'es ...

Even purely using usb interface, you may have to deal with incompatibilities, quirks etc ... you may not be able to read at fast rates ... sluggish responses etc ...
« Last Edit: October 10, 2023, 02:14:38 am by coromonadalix »
 

Offline RaxTopic starter

  • Super Contributor
  • ***
  • Posts: 1110
  • Country: us
 
The following users thanked this post: coromonadalix

Offline RaxTopic starter

  • Super Contributor
  • ***
  • Posts: 1110
  • Country: us
 

Offline alligatorblues

  • Regular Contributor
  • *
  • Posts: 155
  • Country: us
I've spent considerable time and effort connecting instruments to computers. There is no 'universal' way to do it. The easiest is GPIB using a GPIB PCIe adapter on the motherboard. IVI is a compendium that develops VISA. VISA is a universal access method which will work with any computer architecture and any instrument with a VISA driver.

It is up to the manufacturer to create a VISA library accoding to the standards set by IVI. Any VISA library will work. However, different manufacturers have different ways of packaging VISA. Keysight puts it in the I/O libraries package, which you need for general communication. Benchvue contains a subset of the I/O libraries.

Once  VISA is configured, you can communicate in C#, Java, C++, visual basic, python, Matlab, Labview; and whichever other language drivers are disteibuted with the particular VISA implementation. National Instruments has a VISA package for virtually any instrument that has GPIB or 9-pin serial connectivity.

But some of them work only with NI GPIB cards or GPIB<>USB adapters. The various VISA packages come with many instrument, operating system and programming language drivers. So, a program written for VISA should work across similar instrumentation.
 

Offline rcjoy

  • Regular Contributor
  • *
  • Posts: 58
  • Country: us
VXI-11 and your own C, C++, or Python program is the guaranteed most reliable way to talk to instruments.

If your instrument says "LXI" on the front panel, it will support VXI-11 natively.  Just plug the instrument into your network switch, and you can access it from any Windows/Mac/Linux PC on your network.  Even your laptop.

If you have GPIB instruments, a GPIB/LAN gateway such as the Agilent E5810A, Keysight E5810B, ICS 9065, and others (likely the Tektronix AD007) connects your instrument to the network.  The GPIB/LAN gateway speaks VXI-11.

Absolutely no drivers are needed on your PC since it is just standard network communications via RPC.

To make it easier to use in your program, you can use a VXi-11 library that wraps the RPC calls with more friendly function calls.

For Python, use python-vxi11 at https://github.com/python-ivi/python-vxi11

For C on Windows, you can try libvxi11 at https://github.com/f4exb/libvxi11

For C++ on MacOS, you can try libvxi11 at https://github.com/Lew-Engineering/libvxi11

At home I have a E5810A and several GPIB instruments.  I can talk to all of them from my laptop via WiFi anywhere in the house.
 

Offline RaxTopic starter

  • Super Contributor
  • ***
  • Posts: 1110
  • Country: us
Interestingly, I guess I registered the first success (thanks to bdunham7!...). I was able to connect to my 34401A by using a Fluke RS232 to USB cable and Test Controller!

Quite smooth and reliable too! (this one minute I've used it)
 

Offline Njk

  • Frequent Contributor
  • **
  • Posts: 348
  • Country: ru
Re: Computer comms w/ Instrument (USB, GPIB, IEE488, RS232...) - simple guide?
« Reply #10 on: October 10, 2023, 07:25:51 am »
For C on Windows, you can try libvxi11 at https://github.com/f4exb/libvxi11
BTW, for a USB connection, it's possible to get and install the standard USB TMC class driver (ausbtmc.sys) that allows to talk with the instrument directly from the app. No libs at all. A simple example: https://bitbucket.org/hexamer/usbtmc-scpi-exe/src/main/
 
The following users thanked this post: Rax


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf