Author Topic: PyVisa Sillyness and Agilent 34972A interfacing...  (Read 5604 times)

0 Members and 1 Guest are viewing this topic.

Offline SmokeyTopic starter

  • Super Contributor
  • ***
  • Posts: 2864
  • Country: us
  • Not An Expert
PyVisa Sillyness and Agilent 34972A interfacing...
« on: March 03, 2014, 04:17:08 am »
Ever feel like sometimes the world just doesn't want you to get any work done?

I need to interface with an Agilent 34972A DMM Scanner.  Nothing fancy at this point, I just want to get the present reading on the screen into a python program.  Sounds simple enough.

So I install Agilent IO Libraries and a new program I didn't know about before, Agilent Command Expert.  Command Expert is pretty bad ass because it gives you a list of all the possible commands for your instrument and lets you make command lists and test them out on the real instrument or a simulated one.  When you are done you can save the command list and play it back through various programs like labview. 

Well the new version of Command Expert supposedly has a python plug-in that lets you run commands straight from python without having to have pyvisa or some other layer running.  It is it's own python lib.  But it doesn't get installed by default unless it "auto-detects python installed on your system".  Well of course it didn't auto-detect anything so I get no python plug-in.  I am running one of the approved python versions in a default directory.  No funny business there.  As far as I can tell (please prove me wrong) there is no way to manually install the Agilent python lib.  :(

Strike one.  Next up... PyVisa.

Googling PyVisa returns as the first result:
http://pyvisa.readthedocs.org/en/latest/
Which seems to be up to date tutorial and help.  Maybe a little TOO up to date. 
Firstly....   ****  Yes I know it's my own fault for not reading the little blue box above the search window or welcome screen well enough.  I blame the "Installation" page for throwing me off. ****

That site has some good documentation that mostly refers to PyVisa version 1.5......which doesn't have a stable public release at this time.  If you happen to skip the welcome screen note about having to download the development version of 1.5 from GitHub, and just followed the instruction in the "Installation" Page on the left, it installs 1.4.  Easy_install also gets 1.4.  Version 1.5 changes some fundamental things about PyVisa so the sample code doesn't run on 1.4.  So I'm trying to figure out why the "Hello World" of pyvisa that I copied straight from the first page of the tutorial is throwing errors. 

I was just about to give up and get my pencil to become the human data logger when I realized I was being an idiot and running the wrong version of PyVisa.

I guess the tl:dr is...
If you are not aware of it, Agilent has a cool program called Command Expert that helps with automation stuff.  But apparently Python support is still a work in progress.
And PyVisa really wants people to use the dev version 1.5 but didn't finish updating the installation page of the tutorial.
And I'm an idiot.  Sometimes.....
 

Offline alex.forencich

  • Frequent Contributor
  • **
  • Posts: 397
  • Country: us
    • Alex Forencich
Re: PyVisa Sillyness and Agilent 34972A interfacing...
« Reply #1 on: March 04, 2014, 01:23:42 am »
Yeah, I know what you mean.  I wanted to use PyVISA to communicate with some LAN based instruments a while ago, but it turns out that the NI drivers aren't compatible with version 3 of the linux kernel.   |O And all of the Agilent stuff is windows only. I really didn't want to roll my computer back a few years in kernel revisions or use a VM for instrument control, so I ended up figuring out how to eliminate all of the proprietary stuff completely by writing my own pure python driver that could communicate with the instrument directly.  I'm not sure if it is something you would be interested in or not, but the driver is here: http://github.com/alexforencich/python-vxi11 .   
Python-based instrument control: Python IVI, Python VXI-11, Python USBTMC
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf