Author Topic: Visashot, a python script for capturing screenshots from vintage instruments  (Read 1583 times)

0 Members and 1 Guest are viewing this topic.

Offline damienTopic starter

  • Newbie
  • Posts: 9
  • Country: jp
    • Website
Hi all,

I've been working for a while on a python script for capturing screenshots from vintage instruments and would appreciate the community's feedback and help.

Here's a few samples to start with:







86 devices are supported, but don't get too excited because 1) it's easy to reach this number with some instruments having many variants (like the HP85xx series of spectrum analyzers) and 2) not all devices have been tested, and I even boldly assumed that if it works for one instrument of a series then it works for all of them. You will notice that all instruments are from HP at the moment but there should be nothing preventing us from supporting devices from other manufacturers.

HP-53310A Modulation domain analyzer
HP-8990A and 8991A Peak power analyzers [untested]
HP-8992A Digital video power analyzer [untested]
HP-5450/1xA/B Digital oscilloscopes (54501A, 54503A, 54504A, 54505A/B, 54506B, 54510A/B, 54512B) [untested]
HP-5452/4xA Oscilloscopes (54520A, 54522A, 54540A, 54542A)
HP-54600 Oscilloscopes (54600A, 54601A, 54602A, 54600B, 54601B, 54602B, 54603B, 54610B, 54615B, 54616B, 54645A, 54645D)
HP-54620A Logic analyzer [untested]
HP-83475B Lightwave communication analyzer [untested]
HP-5461/2xA/D Oscilloscopes (54621A/D, 54622A/D, 54624A, 54641A/D, 54642A/D)
HP-4395A and HP-4396B Spectrum / network / impedance analyzers
HP-4286A RF LCR meter [untested]
HP-4291A/B Impedance / material analyzer [untested]
HP-4294A Precision impedance analyzer [untested]
HP-4352B VCO/PLL analyzer
HP-859xE Spectrum analyzers (8591E, 8593E, 8594E, 8595E, 8596E)
HP-859xEM EMC analyzers (8591EM, 8593EM, 8594EM, 8595EM, 8596EM)
HP-859xL Spectrum analyzers (8590L, 8592L)
HP-856xE Spectrum analyzers (8560E, 8561E, 8562E, 8563E, 8564E, 8565E)
HP-E444x PSA Signal analyzers (E4440A, E4443B, E4445A, E4446B, E4447A, E4448A) [tested]
HP-E440/1x ESA Spectrum analyzers (E4401B, E4402B, E4403B, E4404B, E4405B, E4407B, E4408B, E4411B) [tested]
HP-E4406A VSA Signal analyzer [untested]
HP-894xx Signal analyzers (89441A, 89440A, 89410A, 89441V, 89450A, 89451A) [untested]

The script is 100% python and is based on pyvisa, so if you're interested in giving it a spin you will need a working pyvisa setup. ImageMagick is the only other dependency. Visashot has been tested on Linux and Windows, but I don't have a Windows machine myself so support for this platform may be a little spotty.

Please consider contributing, for example by:
- testing with your instruments
- sharing sexy screenshots
- helping to support more devices
- testing on other platforms (mac?)

Project page for download and more information: https://damien.douxchamps.net/elec/visashot/
Developer site: https://sourceforge.net/projects/visashot/ (yeah, I know SF is old skool...)
A mailing list is also available to facilitate testing and development discussions.

Cheers!
« Last Edit: January 26, 2024, 03:13:40 am by damien »
 
The following users thanked this post: egonotto, tv84

Offline mankan

  • Regular Contributor
  • *
  • Posts: 101
  • Country: se
Tried on Windows with my E4407B:
 .\visashot.py -d 18 -i 1 -o screen.png -g
Unsupported instrument ' E4407B'. Aborting.
ERROR:Empty screenshot buffer

After stripping the model string I got a Visa timeout instead. I have NI-Visa installed.
Full "*IDN?" response is: "Hewlett-Packard, E4407B, MY41440643, A.14.06"

This is what I use for screenshots: https://github.com/mankangustafsson/gpib_playground/blob/master/esa_screen.py
 
The following users thanked this post: damien

Offline damienTopic starter

  • Newbie
  • Posts: 9
  • Country: jp
    • Website
Thanks for the feedback! Stripping is indeed required for more recent instruments.

The code I used for the E4400 is inspired from this repo https://github.com/angry-dad/E4407B-GPIB-Screen-Capture which has essentially the same ideas.

I've also increased the timeout to 10 seconds, if it doesn't work I suppose we could push it even further but it becomes a bit... strange? Ideally I'd like to find a way to do it without timeouts.

Git repo updated! :-)
 

Offline mankan

  • Regular Contributor
  • *
  • Posts: 101
  • Country: se
Still get timeouts but I do not think the instrument is slow. My script takes 5-6 seconds to complete.
It seems like there are some bad commands sent, see picture.
1987498-0
Also, you need to delete the file first.
 
The following users thanked this post: damien

Offline damienTopic starter

  • Newbie
  • Posts: 9
  • Country: jp
    • Website
I missed the different behavior for querying files on the E44xx. New updates in git!
Thanks again for the help, especially since you already have something working on your side <3
 

Offline mankan

  • Regular Contributor
  • *
  • Posts: 101
  • Country: se
Damien, you are welcome. I can now confirm that revision dcd818 is working for me on my E4407B.
 
The following users thanked this post: damien

Offline damienTopic starter

  • Newbie
  • Posts: 9
  • Country: jp
    • Website
Excellent! I'm surprised I managed to get it right in only two iterations ;-)
Oh if you have a screenshot I could use on the project page that'd be awesome.
 

Offline damienTopic starter

  • Newbie
  • Posts: 9
  • Country: jp
    • Website
New release 1.20 is now available with confirmed support for E44xx signal analyzers!
Big thanks to @mankan for the feedback!

Here's a gratuitous extra screenshot to celebrate:

 
The following users thanked this post: mankan

Offline DeepLink

  • Regular Contributor
  • *
  • Posts: 108
  • Country: dk
This is just the tool I need for my 53310A  ;D

But I have Zero knowledge with Python

I do run EZGPIB (pascal) with NI libraries, and have a NI USB interface
Can talk to the 53310A
IDN?: HEWLETT-PACKARD,53310A,0,3235
VERS?: 1990,0
OPT?: MEMORY,C,0,RF

But what do I need to download/install in order to use this tool?
 

Offline abeyer

  • Frequent Contributor
  • **
  • Posts: 325
  • Country: us
This is just the tool I need for my 53310A  ;D

But I have Zero knowledge with Python

I do run EZGPIB (pascal) with NI libraries, and have a NI USB interface
Can talk to the 53310A
IDN?: HEWLETT-PACKARD,53310A,0,3235
VERS?: 1990,0
OPT?: MEMORY,C,0,RF

But what do I need to download/install in order to use this tool?

It uses pyvisa for communication with the instrument, so you'll need to install and configure it. There are instructions for installing and information about the backends it can use (including NI) here.
 

Offline fenugrec

  • Regular Contributor
  • *
  • Posts: 223
  • Country: ca
It will be difficult to have automated regression testing for this, but I suggest you keep a database of example responses of different instruments. So you can document odd edge cases where e.g. different versions reply differently to *IDN etc. Otherwise I think it's easy to break previously-working support while fixing others...
 
The following users thanked this post: damien

Offline damienTopic starter

  • Newbie
  • Posts: 9
  • Country: jp
    • Website
It will be difficult to have automated regression testing for this, but I suggest you keep a database of example responses of different instruments. So you can document odd edge cases where e.g. different versions reply differently to *IDN etc. Otherwise I think it's easy to break previously-working support while fixing others...

Yes regressions are going to be hard to manage. As more people use the script my hope is that we'll have volunteers who can test their instruments before new releases. In the meantime your idea is great, I've started to list the IDN strings I know in an idn.txt file. I have also kept PCL buffers from various instruments for testing the parsing of that format, also in the repo now.

Here are the 5 IDNs strings I know. Note that serial numbers are partially blanked with zeros.
Please share your IDN if your instrument is supported!

HEWLETT-PACKARD,4396B,JP1KE00000,REV1.16
Hewlett-Packard, E4407B, MY41440000, A.14.06
HEWLETT-PACKARD,53310A,0,3235
HEWLETT-PACKARD,54542A,3400A00000,00.13,01.14,T3.33,01.01,0.001
AGILENT TECHNOLOGIES,54641D,MY42000000,A.02.31
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf