Posts

Showing posts from October, 2014

PyVISA command-line utilities

PyVISA is a Python frontend for the VISA library that enables controlling all kinds of measurement equipment through GPIB, RS232, USB and Ethernet among others interfaces. If you are following the development of PyVISA you might have seen that we have recently made the visa module executable to provide a few useful utilities. To try this, you need to update to the latest PyVISA: $ pip install -U https://github.com/hgrecco/pyvisa/zipball/master First, we now provide a simpler way to get debug information: $ python -m visa info Machine Details:    Platform ID:    Darwin-10.8.0-x86_64-i386-32bit    Processor:      i386 Python:    Implementation: CPython    Executable:     /Users/grecco/envs/lantz/bin/python    Version:        3.2.3    Compiler:       GCC 4.2.1 (Apple Inc. build 5666) (dot 3)    Bits:           32bit    Build:          Apr 10 2012 11:25:50 (#v3.2.3:3d0686d90f55)    Unicode:        UCS2 PyVISA Version: 1.6.1 Backends:    ni:       Version: 1.6.1 (bundled with PyVIS

Communicating with instruments using PyVISA but without NI-VISA

PyVISA is a Python frontend for the VISA library that enables controlling all kinds of measurement equipment through GPIB, RS232, USB and Ethernet among others interfaces. Starting form version 1.6 , PyVISA allows to use different backends. The cool thing is that your code remains the same, except the line in which you instantiate the resource manager (which tells which backend to use). A few days ago I blogged about one of such alternative backends called PyVISA-sim which allows your to mock the presence of instruments (in cased that you missed the announcement, is here ). Today I am making public a second backend.   Until now, talking to instruments via PyVISA required that you had National Instruments VISA library installed 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. It is an implementation of message based communication (Serial/USB/Ethernet) using Pyt