Skip to main content

PyVISA-py

A PyVISA backend that implements a large part of the “Virtual Instrument Software Architecture” (VISA) in pure Python (with the help of some nice cross platform libraries python packages!).

Description

PyVISA started as wrapper for the NI-VISA library and therefore you need to install National Instruments VISA library in your system. This works most of the time, for most people. But NI-VISA is a proprietary library that only works on certain systems. That is when PyVISA-py jumps in.

Starting from version 1.6, PyVISA allows to use different backends. These backends can be dynamically loaded. PyVISA-py is one of such backends. 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

VISA and Python

Python has a couple of features that make it very interesting for measurement controlling:

  • Python is an easy-to-learn scripting language with short development cycles.

  • It represents a high abstraction level, which perfectly blends with the abstraction level of measurement programs.

  • It has a very rich set of native libraries, including numerical and plotting modules for data analysis and visualisation.

  • A large set of books (in many languages) and on-line publications is available.

Requirements

  • Python (tested with 2.7, 3.4+)

  • PyVISA 1.6+

Optionally - PySerial (to interface with Serial instruments) - PyUSB (to interface with USB instruments) - linux-gpib (to interface with gpib instruments, only on linux) - gpib-ctypes (to interface with GPIB instruments on Windows and Linux, warning: experimental)

Python 2 support

With Python 2 EOL behind us, and given the limited time maintainers have, the 0.4.0 release of PyVISA-py will be the last version of PyVISA-py supporting Python 2.

Installation

Using pip:

$ pip install pyvisa-py

Documentation

The documentation can be read online at https://pyvisa-py.readthedocs.org

pyvisa-py is written and maintained by Hernan E. Grecco <hernan.grecco@gmail.com>.

Other contributors, listed alphabetically, are:

(If you think that your name belongs here, please let the maintainer know)

PyVISA-py Changelog

0.4.0 (unreleased)

  • support device lan name in TCPIP INSTR resources PR #226

  • fix handling of VXI11 flags in device_write PR #226

  • do not enforce 4 bytes padding RFC 1014 since some instrument do not respect it (Issue # 225) PR #226

  • fix not setting stop bits with serial devices PR #205

  • fix improper wait time before a timeout in the TCPIP backend PR # 173

  • add GPIB support for proprietary device drivers on Windows and Linux (experimental): try importing gpib-ctypes if linux-gpib is not present. fix #105 #137

  • fix return types of PyVisaLibrary and Session methods to match pyvisa.highlevel.VisaLibraryBase fix #169 PR #170

  • avoid double closing of gpib resources PR #171

  • fix initialization of timeout for the USB resources (the default was set before creating the underlying connection to which the timeout must be passed and was not). PR #167

  • implement USBTMC abort sequence after read timeout to avoid losing communication with the instrument after a timeout occurs. PR #179

  • fix custom timeout for USB instruments. PR #179

  • fix triggering for all protocols. PR #180

  • add support for “quirky” devices made by Rigol. PR #186 PR #207

  • add support for Visa flush operation. PR #208

  • fix reading large amounts of data from some instruments when using VXI-11. PR #209

0.3.1 (2018-09-12)

  • Fix initialization of timeout (issue identified in TCPIP resources) PR #160

0.3 (2018-09-05)

  • Fix handling of seesion registration under Python 3.7 PR #155

  • Add read_stb, assert_trigger, lock, unlock to highlevel PR #139

  • Fix timeout handling in usb PR #144

  • Add gpib_command and assert_trigger to GPIB PR # 136

  • Handle ValueError in usb list fix #131 PR #132

  • Fix reading on GPIB and implement clear and gpib_send_ifc PR #132

  • Do not error when listing USB devices PR #126

  • Fix an error in the handling of the termchar for TCPIP INSTR PR #126

  • Make list_resources return an empty tuple instead of erroring PR #121

  • Proper support for timeout in TCPIP INSTR sessions PR #120 #127 #130 #144

  • Proper encoding of data before transfer for all backends PR #119

  • Unify use of StatusCode PR #118

  • Improve handling of sessions attrs PR #116

  • TCPIP SOCKET timeout handling improvement PR #115

  • Fix compatibility with pyserial 3.0 PR #112

  • TCPIP SOCKET handler read should not block PR #107

  • TCPIP error handling fixes PR #100

  • Use repr() instead of str() to log RPC record PR #97

  • Speed up large transfer over GPIB 2beb52a5bcea2dae32d4a9908dc19f7874bfc0b7

  • Catch GPIB errors while enumerating devices 9fea9d5c40cc6c33ce1244c209e5e576a33abfc2

  • Add a serial poll function to GPIB backend PR #67

  • Handle timeout in USB TMC backend PR #64

  • Make USB TMC backend faster by transferring multiple bytes PR #63

  • Fix issue with encoding before data transfer PR #59 #

  • Get Linux GPIB version PR #55

  • Fix broken import in TCPIP sessions PR #51

0.2 (2015-08-25)

  • Added support for TCPIP Socket. (Issue #38, thanks Thorsten Liebig)

  • Added support for GPIB INSTR using linux-gpib. (Issue #24, thanks bessman)

  • Added support for USB RAW. (Issue #18, kopp)

  • Better error reporting when pyusb or pyserial is missing.

  • Fixed logging of unicode strings. (Issue #54)

  • Fixed timeout in SerialSession. (Issue #44)

  • Moved resource name parsing to PyVISA.

  • VXI11 protocol performance enhancement. (thanks alexforencich)

  • Improved pyusb importing.

  • Fixed large binary reads in TCPIP.

  • Added backend information to logger.

  • Use pyvisa compat/struct.py for python < 2.7.8 (thanks Martin Ritter)

0.1 (2015-02-08)

  • Initial release. Preliminary support for: - USB INSTR - TCPIP INSTR - ASRL INSTR

Metadata

Release files for PyVISA-py 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for PyVISA-py 0.4.0
File Size Uploaded Provenance Actions
PyVISA-py-0.4.0.tar.gz 5.9 MB Without provenance Details for PyVISA-py-0.4.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for PyVISA-py 0.4.0
File Interpreter ABI Platform Actions
PyVISA_py-0.4.0-py3-none-any.whl Python 3 none any Details for PyVISA_py-0.4.0-py3-none-any.whl

Total release size: 5.9 MB

Release files / PyVISA-py-0.4.0.tar.gz

Download URL PyVISA-py-0.4.0.tar.gz
Size 5.9 MB
Tags Source
SHA-256 checksum
How to use checksums
a27b509a626607cd21e871cbf2ca2df63422937f4621038a8ca8c30cdb688f61
BLAKE2b-256 checksum
How to use checksums
69c66d1f1777bae719cb521a5c3a93eb36935d4dd9e9adb650c6e253151dc4c9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

Release files / PyVISA_py-0.4.0-py3-none-any.whl

Download URL PyVISA_py-0.4.0-py3-none-any.whl
Size 53.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eccaaf67c19e11be2d356809ebe33de6e0a6d007eaecaf9170bddb7edbae6ad1
BLAKE2b-256 checksum
How to use checksums
a6ed0a7676d77865974344490b8d06fd75d1c237907d15ab39068d14252bd10f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.1.3.post20200330 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.7.3

Security for PyVISA-py 0.4.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page