1
\$\begingroup\$

[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 ).

\$\endgroup\$

closed as off-topic by brhans, RoyC, Finbarr, Lior Bilia, Elliot Alderson Dec 11 '18 at 18:32

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions on the use of electronic devices are off-topic as this site is intended specifically for questions on electronics design." – brhans, RoyC, Finbarr, Lior Bilia, Elliot Alderson
If this question can be reworded to fit the rules in the help center, please edit the question.

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

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.

\$\endgroup\$
0
\$\begingroup\$

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.

\$\endgroup\$
  • \$\begingroup\$ 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. \$\endgroup\$ – The Photon Dec 9 '18 at 15:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.