1

[background/context] hello, I am trying to learn to automate measurement devices using SCPI commands, but instead of using Labview I decided to go with python. I have played around with SCPI commands in Physik Instrumente (PI)-specific software in the past and It seems much more user-friendly to me than trying to work with complex flowcharts (plus I don't want my programs to depend on third-party licenses).

it seems from a rudimentary search that a common method is using PyVisa, in the second page of their instructions ("configuring the backend") they mention installing an NI-VISA library, which I assume corresponds to National Instruments (TM).

[Question] It mentions that "If no backend is specified, Pyvisa uses the NI backend". Will this even work for instruments that are not NI products? (e.g. I need to synchronize Agilent hardware to synchronize with various other instruments, including the PI hardware ).

  • What matters is who made the GPIB interface that connects your PC to the GPIB, not who made the instruments you're talking to. – The Photon Dec 08 '18 at 22:33

2 Answers2

2

If you want to use PyVisa, you will need some kind of Visa library for it to use to communicate with your instruments.

If your instruments are GPIB instruments, you need to use the Visa library from the company that made the device your PC uses to connect to the GPIB bus. Traditionally, this was an ISA or PCI card, but nowadays it is more often a USB-GPIB bridge. In any of these case, the Visa (and sometimes another underlying vendor library) are what knows how to command these devices to produce GPIB transactions.

If your instruments are LXI (LAN eXtensions for Instrumentation) or USB controlled devices, it won't matter which vendor's Visa you use, but you'll still need a Visa to use PyVisa, because the Visa API is the only API PyVisa knows how to use to communicate with instruments.

If your instruments are USB-controlled, you might be able to do away with Visa and use the instrument vendor's proprietary libraries to communicate with the instrument. But you also would have to give up PyVisa and write your own Python wrapper for the proprietary library's API.

Presumably you could also dispense with Visa for an LXI instrument, but it would basically require learning the LXI protocol and writing something very much like the Visa library in Python.

The Photon
  • 126,425
  • 3
  • 159
  • 304
0

If you want to program through the Virtual Instrument Software Architecture VISA (which is a good idea in a multi-vendor test environment), then you will need VISA installed. While installing NI-VISA will automatically give you a copy, you may prefer to obtain it from another vendor who supports VISA (Anritsu, Keysight, Tek, R&S to name but the most prominent few) or even a third party. Installing VISA from NI will not should not conflict with any other vendors' instruments.

To talk to VISA from Python, the easiest route is to use PyVISA. You could though if you wanted, roll your own from ctypes calls into the VISA API.

To talk to your chosen instruments from VISA, you will need the VISA drivers for those specific instruments, obtained from their respective manufacturers.

Neil_UK
  • 158,152
  • 3
  • 173
  • 387
  • I've been doing instrument control with Visa for 25 years and never heard of or used a "VISA driver" for a specific instrument. Are you talking about something like a LabView vi? Because you won't find an equivalent for Python as far as I know. – The Photon Dec 09 '18 at 15:25