PyVISA-py: Pure Python backend for PyVISA

PyVISA

PyVISA-py is a backend for PyVISA. It implements most of the methods for Message Based communication (Serial/USB/GPIB/Ethernet) using Python and some well developed, easy to deploy and cross platform libraries.

You can select the PyVISA-py backend using @py when instantiating the visa Resource Manager:

>>> import pyvisa
>>> rm = pyvisa.ResourceManager('@py')
>>> rm.list_resources()
('USB0::0x1AB1::0x0588::DS1K00005888::INSTR')
>>> inst = rm.open_resource('USB0::0x1AB1::0x0588::DS1K00005888::INSTR')
>>> print(inst.query("*IDN?"))

That’s all! Except for @py, the code is exactly what you would write to using the NI-VISA backend for PyVISA.

Currently Pyvisa-py support the following resources:

  • TCPIP INSTR

  • TCPIP SOCKET

  • GPIB INSTR

  • ASRL INSTR

  • USB INSTR

  • USB RAW

    Note: ASRL INSTR supports also URL Handlers like

    • loop:// –> ASLRloop://::INSTR

    • socket:// –> ASRLsocket://::INSTR

    These entries will not be listed during the device discovery rm.list_resources(). For further details see https://pyserial.readthedocs.io/en/latest/url_handlers.html

You can report a problem or ask for features in the issue tracker. Or get the code in GitHub.