Visashot, a python script for capturing screenshots from vintage instruments - Page 1
Forum section: electronics / testgear

author: damien
author_rank: Contributor
timestamp: January 21, 2024, 06:32:41 am
content: 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 analyzerHP-8990A and 8991A Peak power analyzers HP-8992A Digital video power analyzer HP-5450/1xA/B Digital oscilloscopes (54501A, 54503A, 54504A, 54505A/B, 54506B, 54510A/B, 54512B) 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 HP-83475B Lightwave communication analyzer HP-5461/2xA/D Oscilloscopes (54621A/D, 54622A/D, 54624A, 54641A/D, 54642A/D)HP-4395A and HP-4396B Spectrum / network / impedance analyzersHP-4286A RF LCR meter HP-4291A/B Impedance / material analyzer HP-4294A Precision impedance analyzer HP-4352B VCO/PLL analyzerHP-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) HP-E440/1x ESA Spectrum analyzers (E4401B, E4402B, E4403B, E4404B, E4405B, E4407B, E4408B, E4411B) HP-E4406A VSA Signal analyzer HP-894xx Signal analyzers (89441A, 89440A, 89410A, 89441V, 89450A, 89451A) 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...)Amailing listis also available to facilitate testing and development discussions.Cheers!

author: mankan
author_rank: Regular Contributor
timestamp: January 21, 2024, 11:06:16 am
content: Tried on Windows with my E4407B:.\visashot.py -d 18 -i 1 -o screen.png -gUnsupported instrument ' E4407B'. Aborting.ERROR:Empty screenshot bufferAfter 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

author: damien
author_rank: Contributor
timestamp: January 21, 2024, 12:39:15 pm
content: Thanks for the feedback! Stripping is indeed required for more recent instruments.The code I used for the E4400 is inspired from this repohttps://github.com/angry-dad/E4407B-GPIB-Screen-Capturewhich 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! :-)

author: mankan
author_rank: Regular Contributor
timestamp: January 21, 2024, 02:40:07 pm
content: 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.Also, you need to delete the file first.

author: damien
author_rank: Contributor
timestamp: January 22, 2024, 02:31:46 am
content: 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

author: mankan
author_rank: Regular Contributor
timestamp: January 22, 2024, 06:12:58 pm
content: Damien, you are welcome. I can now confirm that revision dcd818 is working for me on my E4407B.

author: damien
author_rank: Contributor
timestamp: January 23, 2024, 02:04:47 am
content: 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.

author: damien
author_rank: Contributor
timestamp: January 26, 2024, 03:03:01 am
content: 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:

author: DeepLink
author_rank: Regular Contributor
timestamp: January 30, 2024, 10:50:58 am
content: This is just the tool I need for my 53310ABut I have Zero knowledge with PythonI do run EZGPIB (pascal) with NI libraries, and have a NI USB interfaceCan talk to the 53310AIDN?: HEWLETT-PACKARD,53310A,0,3235VERS?: 1990,0OPT?: MEMORY,C,0,RFBut what do I need to download/install in order to use this tool?

author: abeyer
author_rank: Frequent Contributor
timestamp: January 30, 2024, 06:34:42 pm
content: Quote from: DeepLink on January 30, 2024, 10:50:58 amIt uses pyvisa for communication with the instrument, so you'll need to install and configure it. There areinstructions for installing and information about the backends it can use (including NI) here.

author: fenugrec
author_rank: Frequent Contributor
timestamp: January 30, 2024, 07:28:16 pm
content: 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...

author: damien
author_rank: Contributor
timestamp: January 31, 2024, 02:55:53 am
content: Quote from: fenugrec on January 30, 2024, 07:28:16 pmYes 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.16Hewlett-Packard, E4407B, MY41440000, A.14.06HEWLETT-PACKARD,53310A,0,3235HEWLETT-PACKARD,54542A,3400A00000,00.13,01.14,T3.33,01.01,0.001AGILENT TECHNOLOGIES,54641D,MY42000000,A.02.31

author: cloudstrife87
author_rank: Contributor
timestamp: October 16, 2024, 03:15:22 pm
content: Hi Damien,I've been trying to run the Visashot script to capture from my Agilent 54642D, although 54642D stated "Remote Operation Completed", but I keep encountering error "FileNotFoundError: [WinError 2] The system cannot find the file specified". Has anyone here encountered this error?I installed ImageMagick-6.9.13, PythonMagick 0.9.19, and tried inserting "shell=True" in subprocess code but has no luck in resolving this error.Below are the console logs:Code:C:\Users\James\AppData\Local\Programs\Python\Python313\python.exe C:/Users/James/Downloads/visashot.py -s GPIB0::7::INSTR -o test.pngTraceback (most recent call last):File "C:\Users\James\Downloads\visashot.py", line 934, in <module>_main()~~~~~^^File "C:\Users\James\Downloads\visashot.py", line 892, in _mainrtn = capture(instr, output_filename, trim, margin, scale, recolor, foreground_color, background_color, swap_id_command_order)File "C:\Users\James\Downloads\visashot.py", line 748, in capture_execute_imagemagick([IMAGE_MAGICK_CONVERT, tmp_filename, filename])~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "C:\Users\James\Downloads\visashot.py", line 524, in _execute_imagemagickstdout, stderr = subprocess.Popen(command_array, stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "C:\Users\James\AppData\Local\Programs\Python\Python313\Lib\subprocess.py", line 1036, in __init__self._execute_child(args, executable, preexec_fn, close_fds,~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^pass_fds, cwd, env,^^^^^^^^^^^^^^^^^^^...<5 lines>...gid, gids, uid, umask,^^^^^^^^^^^^^^^^^^^^^^start_new_session, process_group)^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^File "C:\Users\James\AppData\Local\Programs\Python\Python313\Lib\subprocess.py", line 1548, in _execute_childhp, ht, pid, tid = _winapi.CreateProcess(executable, args,~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^# no special security^^^^^^^^^^^^^^^^^^^^^...<4 lines>...cwd,^^^^startupinfo)^^^^^^^^^^^^FileNotFoundError: [WinError 2] The system cannot find the file specifiedProcess finished with exit code 1

author: damien
author_rank: Contributor
timestamp: October 17, 2024, 12:54:00 pm
content: Hi!I don't have a windows machine so it's not easy to get things working on your platform. But let's try!I imagine that you found the possible solution "shell=True" here:https://stackoverflow.com/questions/73193119/python-filenotfounderror-winerror-2-the-system-cannot-find-the-file-specifieIt was the first hit on google for meThe second one on that page could be useful too?The first thing would be to try the latest version of visashothttps://damien.douxchamps.net/elec/visashot/but I doubt it will help becauseI've never heard about this issue before.Next you could display the two filenames before the execution, adding just before line 760 (latest version):Code:logging.debug("tmp_filename: %s", tmp_filename)logging.debug("filename: %s", filename)If the execution fails the tmp_filename should still be present in your system and it should contain a valid image. I don't think this is the issue but at least we could be certain.Could you also share the full logs? (using the -g option)

author: cloudstrife87
author_rank: Contributor
timestamp: October 17, 2024, 01:26:12 pm
content: Hi Damien, I'm not too sure why but I somehow managed to get it working.Last night I uninstalled ImageMagick-6.9.13 and installed the latest version ImageMagick-7.1.1-39-Q16-HDRI-x64, but still couldn't get it working.Just now after seeing your post I tried again, it works! I didn't restart my computer or change any settings, so I'm not too sure what I did to fix it. I used the latest Visashot script from your website and didn't do any modification (not even the Shell=True).Sorry for taking your precious time trying to figure this out.I'm going to try on my HP 3563A next! Will report my results here.Code:C:\Users\James\AppData\Local\Programs\Python\Python313\python.exe C:/Users/James/Downloads/visashot.py -s GPIB0::7::INSTR -o agilent.pngProcess finished with exit code 0

author: damien
author_rank: Contributor
timestamp: October 17, 2024, 01:59:19 pm
content: Great!I haven't tested the 3563A so if it works it's (another) small miracle. But definitely worth a try. And I'm happy to discuss with you to make it happen.Cheers!

author: cloudstrife87
author_rank: Contributor
timestamp: October 17, 2024, 02:43:26 pm
content: Hi Damien,Ok I've tried each device type scripts and so far not working: 3563A will first show "Unknown Mnemonic" and then "Command Too Long" before timeout.Sorry I'm not familiar with HP-IB programming, I just started to read the 3563A programming manual:https://docs.ampnuts.ru/eevblog.docs/HP_Agilent_Keysight/HP%203563A%20Programming.pdf. In appendix B Example Program 1 would that be a good start? Though seems like this code passes the control to 3563A to trigger the print though.

author: damien
author_rank: Contributor
timestamp: October 17, 2024, 03:09:23 pm
content: A quick check into the manual you linked indicates that it's a vector graphic display. Visashot only works with bitmaps at the moment.Still, it should be possible to get the HPGL buffer and render that into a bitmap. Or use an HPGL to SVG converter (apparently those exist!)The relevant pages are 5-28 and following. There seems to be two commands to send:- VBLK 1- DVAS or DVAN or DVBN, depending on the output formatAfter that capturing the buffer should be possible.You can first try visashot with the -I option, this should get the ID string right.For developing the best would be to start by getting the buffer in the 3 different formats. Simplest would be to get a python console, connect to your instrument (see short sample on my website) and then send the two commands above (e.g. VBLK1 or VBLK01, followed by DVAS) Then maybe something like "READ?" but I'm not sure... Hacking required from this point ;-)

author: cloudstrife87
author_rank: Contributor
timestamp: October 17, 2024, 04:51:22 pm
content: What you meant by hacking is reverse engineering and reconstructing the data right?I did the DVAS, DVAN and DVBN tests below, so far I can complete each test command individually. If i mix 2 together (eg. VBLK1>DVAS>READ?>VBLK1>DVAN), I'll get into timeout error and can only recover after I restarted 3563a.Test 1>>> instrument.write("VBLK1")7[3563A displayed: "VECTOR DISP BLOCK 1"]>>> instrument.write("DVAS")6[3563A displayed: "DUMP VECTOR DISP ASCII"]>>> instrument.write("READ?")7No status changes in 3563ATest 2>>> instrument.write("VBLK1")7[3563A displayed: "VECTOR DISP BLOCK 1"]>>> instrument.write("DVAN")6[3563A displayed: "DUMP VECTOR DISP ANSI"]>>> instrument.write("READ?")7No status changes in 3563ATest 3>>> instrument.write("VBLK1")7[3563A displayed: "VECTOR DISP BLOCK 1"]>>> instrument.write("DVBN")6[3563A displayed: "DUMP VECTOR DISP BINARY"]>>> instrument.write("READ?")7No status changes in 3563ATest 1Code:>>> import pyvisa>>> ressourceManager = pyvisa.ResourceManager()>>> instrument = ressourceManager.open_resource("GPIB0::20::INSTR")>>> instrument.write("VBLK1")7>>> instrument.write("DVAS")6>>> instrument.write("READ?")7Test 2Code:>>> import pyvisa>>> ressourceManager = pyvisa.ResourceManager()>>> instrument = ressourceManager.open_resource("GPIB0::20::INSTR")>>> instrument.write("VBLK1")7>>> instrument.write("DVAN")6>>> instrument.write("READ?")7Test 3Code:>>> import pyvisa>>> ressourceManager = pyvisa.ResourceManager()>>> instrument = ressourceManager.open_resource("GPIB0::20::INSTR")>>> instrument.write("VBLK1")7>>> instrument.write("DVBN")6>>> instrument.write("READ?")7Combined Test with errorCode:>>> import pyvisa>>> ressourceManager = pyvisa.ResourceManager()>>> instrument = ressourceManager.open_resource("GPIB0::20::INSTR")>>> instrument.write("VBLK1")7>>> instrument.write("DVAS")6>>> instrument.write("READ?")7>>> instrument.write("VBLK1")7>>> instrument.write("DVAN")Traceback (most recent call last):File "<python-input-7>", line 1, in <module>instrument.write("DVAN")~~~~~~~~~~~~~~~~^^^^^^^^File "C:\Users\James\AppData\Local\Programs\Python\Python313\Lib\site-packages\pyvisa\resources\messagebased.py", line 196, in writecount = self.write_raw(message.encode(enco))File "C:\Users\James\AppData\Local\Programs\Python\Python313\Lib\site-packages\pyvisa\resources\messagebased.py", line 156, in write_rawreturn self.visalib.write(self.session, message)~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^File "C:\Users\James\AppData\Local\Programs\Python\Python313\Lib\site-packages\pyvisa\ctwrapper\functions.py", line 2795, in writeret = library.viWrite(session, data, len(data), byref(return_count))File "C:\Users\James\AppData\Local\Programs\Python\Python313\Lib\site-packages\pyvisa\ctwrapper\highlevel.py", line 226, in _return_handlerreturn self.handle_return_value(session, ret_value) # type: ignore

author: damien
author_rank: Contributor
timestamp: October 19, 2024, 01:19:29 am
content: Yeah, things are going to get a little dirtyFrom the 6/7 returned by the commands I can see that the termination characters you're using are "\r\n", which should work. Well actually it worked since you've got reasonable messages displayed on the 3563A. So I think talking with the instrument is not an issue. Noice.What is the instrument ID string?Code:id_string = instrument.query("ID?")print(id_string)When using the READ? command you will need to actually read from the instrument after that. The fact that the instrument doesn't say anything on the screen when you do the READ? is probably a good thing (no error) but now it's just waiting for you to get the bytes, for example using:Code:buffer = instrument.read_raw()Then you could save the content of the buffer to check what's in it, maybe after checking its length:Code:print("Buffer length: " + str(len(buffer)) + "\n")file = open("buffer.raw", "wb")file.write(buffer)file.close()... or something like that (the code above is untested butshouldmay work)If that works then try to get a buffer file for each of the output formats.If there's more than 20kB or so you may need to read multiple times and concatenate the outputs, but let's forget about that for now...

author: cloudstrife87
author_rank: Contributor
timestamp: October 20, 2024, 09:38:17 am
content: Sorry I missed the instrument string: "HP3563A"So far so good all 3 buffer types are less than 20kb, 3563A shows no errors or indication during buffer extraction, and managed to extract them as attached.Code:>>> import pyvisa>>> ressourceManager = pyvisa.ResourceManager()>>> instrument = ressourceManager.open_resource("GPIB0::20::INSTR")>>> id_string = instrument.query("ID?")>>> print(id_string)HP3563A>>> instrument.write("VBLK1")7>>> instrument.write("DVAS")6>>> buffer = instrument.read_raw()>>> print("Buffer length: " + str(len(buffer)) + "\n")Buffer length: 2012>>> file = open("dvasbuffer.raw", "wb")>>> file.write(buffer)2012>>> file.close()>>> instrument.write("VBLK1")7>>> instrument.write("DVAN")6>>> buffer = instrument.read_raw()>>> print("Buffer length: " + str(len(buffer)) + "\n")Buffer length: 1068>>> file = open("dvanbuffer.raw", "wb")>>> file.write(buffer)1068>>> file.close()>>> instrument.write("VBLK1")7>>> instrument.write("DVBN")6>>> buffer = instrument.read_raw()>>> print("Buffer length: " + str(len(buffer)) + "\n")Buffer length: 270>>> file = open("dvbnbuffer.raw", "wb")>>> file.write(buffer)270>>> file.close()

author: damien
author_rank: Contributor
timestamp: October 21, 2024, 11:05:30 am
content: The size is way to small for a screenshot, even vectorized :-( All I was able to do is use the dvasbuffer.raw and after removing a couple of bytes at the beginning it can be loaded in octave/matlab. Don't get too excited though: the plot is not interesting. Not actually sure what it represents. See pic below.There has to be another function for the screenshot or printing

author: damien
author_rank: Contributor
timestamp: January 02, 2025, 11:26:40 am
content: I just made some minor improvements over the holidays and that means a new release 1.22!Successful tests with HP-8563EImprove handling of PRINT_DEVICES instrumentsSwitch to IM v7 while keeping some compat with v6.Be robust against bad serial numbers in IDN stringHP 5450/1xA/B scopes successfully testedFix serial baud rate argument handlingAutomatic timeout calculation for serial devicesQuick download link:https://damien.douxchamps.net/elec/visashot/visashot.pyEnjoy!

author: damien
author_rank: Contributor
timestamp: March 17, 2025, 02:38:30 pm
content: Yet another new release. The major addition in 1.23 is the support for the LeCroy 9300 series of scopes.120 instruments are now supported, thanks to all the contributors!Quick download link:https://damien.douxchamps.net/elec/visashot/visashot.pyEnjoy!

author: fenugrec
author_rank: Frequent Contributor
timestamp: March 24, 2025, 09:14:14 pm
content: a stray '+' here maybe?Code:/visashot.py", line 815if model in LECROY_SCDP_DEVICES+: # Some devices are orange instead of green^SyntaxError: invalid syntax

author: damien
author_rank: Contributor
timestamp: March 25, 2025, 10:16:43 am
content: Hi fenugrec,Whoopsie, thanks! Fixed in 1.24 :-)

author: KE5FX
author_rank: Super Contributor
timestamp: April 27, 2025, 10:38:18 pm
content: Quote from: damien on January 21, 2024, 06:32:41 amMinor data point: it looks like the 89410A/8944xAshouldwork, but the MMEM storage area appears to only have about 64KB available, at least on mine. TIFF files tend to be (much) bigger than that, and in my case I get a disk-full error.I added a couple of lines to force it to use the RAM disk:Code:instrument.write("MMEM:INIT 'RAM:',DOS, 500000")instrument.write("MMEM:MSIS 'RAM:'")That lets it create the SCRNSHOT.TIF file, but instrument_query_binary_values() doesn't appear to read the preamble properly. I can retrieve the file with this short program, courtesy o4-mini-high:Code:import pyvisarm = pyvisa.ResourceManager()inst = rm.open_resource('GPIB0::17::INSTR')inst.read_termination = Noneinst.write_termination = '\r\n'inst.write(":MMEM:DATA? 'SCRNSHOT.TIF'")hdr = inst.read_bytes(2) # b'#' + b'<digit>'if hdr != ord('#') or not chr(hdr).isdigit():raise RuntimeError(f"Bad preamble: {hdr!r}")n = int(chr(hdr)) # how many ASCII digits followlen_s = inst.read_bytes(n).decode('ascii') # payload lengthlength = int(len_s)img = inst.read_bytes(length)inst.read_bytes(1) # trailing \nwith open('screen.tif','wb') as f:f.write(img)The file is there, but the incantation that wrote it apparently wasn't quite right:That's all the time I had to tinker around with it. Looks pretty close, but I'm not familiar enough with PyVISA to diagnose it easily.

author: damien
author_rank: Contributor
timestamp: April 28, 2025, 08:23:41 am
content: Hi KE5FX,Ooh, this is awesome! I did some quick blind coding for those instruments, I'm surprised is "nearly" works!I added your two lines and changedCode:instrument.write(":MMEM:DATA? 'INT:scrnshot.tif'")intoCode:instrument.write(":MMEM:DATA? 'RAM:scrnshot.tif'")Since you set "MMEM:MSIS 'RAM:'" we could maybe omit the "RAM:" before "scrnshot.tif" but it could also be the source of the error you saw. BTW that red warning on the screen is missing the "?" after "MMEM:DATA". Maybe it was from a previous (unsuccessful) attempt at reading the buffer, because AFAICT that GPIB call is for reading not writing.Can you try the attached version? If anything is wrong please try the -g option and share the debug output.

author: KE5FX
author_rank: Super Contributor
timestamp: April 29, 2025, 06:18:14 pm
content: Quote from: damien on April 28, 2025, 08:23:41 amThanks much, that worked after a couple of tweaks.Some operations needed *WAI commands for synchronizationThe 894xx doesn't support the READ? command so I added a separate_read_HCOPY_bitmap()functionDeleting a file that doesn't exist causes an error message, so you won't want to do that twice (or at all, necessarily, since the RAM disk gets initialized each time)There should probably be a warning somewhere that we nuke the RAM disk. Hate to do something like that, but I don't see any alternatives at first glance.

author: damien
author_rank: Contributor
timestamp: April 30, 2025, 12:28:54 pm
content: Hi KE5FX,Thanks for helping out! I've tweaked a few minor things and came up with this new version. Let me know if there's any issue, otherwise I'll make a new release. Banzai!Damien

author: KE5FX
author_rank: Super Contributor
timestamp: April 30, 2025, 03:15:34 pm
content: Looks good, ship it!

author: bostonman
author_rank: Super Contributor
timestamp: May 01, 2025, 02:34:27 am
content: I think being able to print is great. I have a spectrum analyzer (8592L) and think being able to print will be nice.Unfortunately I don't believe I have any spare cables and not knowledgeable with using Python scripts.Do you have plans to post a brief tutorial on making a cable and/or better steps to implement the script?

author: wkb
author_rank: Super Contributor
timestamp: May 01, 2025, 06:48:56 am
content: HPiB cables should be quite simple to acquire as used surplus.Given the rather apecial connectors forget about DIY.

author: DeepLink
author_rank: Regular Contributor
timestamp: May 01, 2025, 07:36:29 am
content: Besides the GPIB cable, you also need a GPIB InterfaceLook at the AR488 - USB to GPIB DIY - based on a Arduino Nano

author: damien
author_rank: Contributor
timestamp: May 01, 2025, 11:06:26 am
content: Hi Bostonman,I have some information/tips on my website here:https://damien.douxchamps.net/elec/visashot/Admittedly not a full tutorial though.The most important is to get GPIB (or serial) and pyVISA working with your machine.If you have a desktop you can find cheap PCI cards (ok, an older desktop then!) or as @DeepLink suggested a USB adapter. The DIY one is the cheapest way, you can also find some by Keysight/Agilent or NI on auction sites (but they can go for more than $100).If you use linux then python will be easy: just save the script somewhere and execute it (use the -h option for help). For example:Code:./visashot.py -d 8 -o output.pngfor device 8 on the GPIB bus. On windows you will have to install python and call it a little differently:Code:python3 visashot.py -d 8 -o output.png

author: damien
author_rank: Contributor
timestamp: May 01, 2025, 11:11:25 am
content: Quote from: KE5FX on April 30, 2025, 03:15:34 pmAwesome, released! Thanks for the feedback and help

author: bostonman
author_rank: Super Contributor
timestamp: June 04, 2025, 02:36:53 am
content: Sadly, I thought my 8592L had GPIB. Unfortunately, after doing more research into implementing your script, I grabbed my analyzer only to discover it has serial and parallel only.

author: damien
author_rank: Contributor
timestamp: June 04, 2025, 10:57:23 am
content: Quote from: bostonman on June 04, 2025, 02:36:53 amSomeone with an 8591EM had success using the serial port. It would look something like:./visashot.py -g -s "ASRL4::INSTR" -r 19200 -o output.pngASRL is for the serial port, and you will need to set the baudrate on your instrument too.

author: bostonman
author_rank: Super Contributor
timestamp: June 04, 2025, 12:53:45 pm
content: So a basic serial cable to a USB convertor, and then use Visashot?Do I need any image convertor or is it simply run that command and get a PNG image?Some research showed I'd need the parallel port for capturing screen shots and the serial port for capturing the settings (i.e. frequency, span, etc...) with a RTC (real time clock) for keeping track of date/time stamps, and an SD card. This all assumes I use an Arduino to do the work.

author: damien
author_rank: Contributor
timestamp: June 04, 2025, 02:09:46 pm
content: Quote from: bostonman on June 04, 2025, 12:53:45 pmYes it should be that simple. I'm not sure about the code when using a USB-serial converter though. Hopefully it's as simple as ASRL1 (serial port 1).QuoteNo convertor needed, it's integrated in visashot via ImageMagick. So something close to the command line above should give you a PNG image as output.You can run./visashot.py -hfor help about options. I've only had one person with a serial instrument so far, so I can't rule out it will fail. But I'm happy to work with you to make it chooch!

author: bostonman
author_rank: Super Contributor
timestamp: June 06, 2025, 08:21:14 pm
content: Thankfully I have a USB to serial convertor (also had to install a driver).Due to too many anomalies between analyzer printer settings, not understanding Python, and your script, I apologize in advance, but need some help with the basics.The analyzer printer settings is something I'll need to tinker with, but I'd like to know one piece of the puzzle that is correct so I know where to focus my attention.I have an older laptop with Win7 with Python 3.8.0; I just downloaded it and ran the installer. When I click your script, I get a Command window that quickly closes.The little I know about Python is: I think it needs to be set in an environment in order to just run a .py file.I added the path in the environment. Now when I type Python --version in the CMD window, it shows the version.Having said this, I'm uncertain how to setup Python to run your script; and this eliminates me from using the 'help' file you suggested.As for the analyzer, I'm tinkering with the print/plotter settings, but, each time I try a setting by pressing 'copy', it freezes. Due to not understanding how to run the script, I have two equations with three unknowns (the third being whether this USB to serial works).Going forward, assuming this current setup works, ideally I'd like something that will last the test of time. Most likely a USB to serial convertor will not work on future Windows due to driver incompatibility, but maybe an alternate method would be great like a Pi or Arduino.

author: damien
author_rank: Contributor
timestamp: June 07, 2025, 12:32:02 pm
content: To run the script you type (in the folder that contains visashot)Code:Python visashot.pyNote that you need to install the python package PyVisa. Otherwise the visashot will not be happy. I have no windows experience, but on Linux you would do:Code:pip install pyvisaFor ImageMagick have a look here:https://imagemagick.org/script/download.phpMaybe a good samaritan with Windows experience can help? :-)

author: bostonman
author_rank: Super Contributor
timestamp: June 08, 2025, 03:03:56 pm
content: Hmmmm seems then this would all be easier on Linux.Looking at pyvisa, it seems a NI driver also needs to be installed.

author: bostonman
author_rank: Super Contributor
timestamp: June 08, 2025, 06:15:58 pm
content: Think maybe I'll need to cancel trying to get this to work.The NI Visa that's required needs Labview and/or Studio installed. I can try Linux, but assume I need a driver for the serial to USB cable.

author: abeyer
author_rank: Frequent Contributor
timestamp: June 08, 2025, 07:34:13 pm
content: Quote from: bostonman on June 08, 2025, 03:03:56 pmIf it meets your needs, thepyvisa-pybackend is usually much easier to get working in my experience, rather than messing with the vendor drivers.

author: abeyer
author_rank: Frequent Contributor
timestamp: June 08, 2025, 07:36:33 pm
content: Quote from: bostonman on June 08, 2025, 06:15:58 pmmost linux distros will have all the common usb serial devices prebuilt and will show up as either /dev/ttyUSB or /dev/ttyACM out of the box

author: bostonman
author_rank: Super Contributor
timestamp: June 08, 2025, 10:30:50 pm
content: From what I understand, and maybe my interpretation is incorrect, pyvisa won't install without the NI stuff, but then NI won't install without Labview or Studio.So it seems this whole setup isn't Windows friendly.

author: abeyer
author_rank: Frequent Contributor
timestamp: June 08, 2025, 11:22:10 pm
content: Quote from: bostonman on June 08, 2025, 10:30:50 pmNo, that's what pyvisa-py is for, to avoid that:https://pyvisa.readthedocs.io/en/latest/introduction/getting.html#:~:text=Alternatively%2C%20you%20can%20install%20PyVISA%2DPy%20which%20is%20a%20pure%20Python%20implementation%20of%20the%20VISA%20standard.%20You%20can%20install%20it%20using%20pip%3Ahttps://pyvisa.readthedocs.io/projects/pyvisa-py/en/latest/

author: bostonman
author_rank: Super Contributor
timestamp: June 10, 2025, 12:55:02 pm
content: I think this all revolves around Linux because Windows doesn't install pyvisa. Online documentation keeps referring me to NI which states pyvisa needs NI installed.Maybe someone who installed this on a Windows machine knows more than the documentation I'm finding.

author: abeyer
author_rank: Frequent Contributor
timestamp: June 10, 2025, 07:10:03 pm
content: No, it's nothing to do with linux, works on windows too. pyvisa needsa backend. NI is one backend, pyvisa-py is another. Read the pyvisa-py docs and follow them.This is from scratch on a windows laptop that that's never had pyvisa nor NI installed (and also doesn't have any devices to connect to) but it still gets all the way through to device discovery along with some warnings about optional extra packages you can use for enhanced network discovery:

author: bostonman
author_rank: Super Contributor
timestamp: June 17, 2025, 02:12:36 am
content: I didn't know about PowerShell (nor have I used it until recently).I followed your screen shot (much appreciated), and believe everything with according to your steps. Once the steps were completed, I tried running visashot, visashot -h, etc.. and all I kept seeing was a DOS window opening and closing.Sorry for the questions, but I have limited experience with scripts and stuff, so not sure what needs to be done at this point.

author: bostonman
author_rank: Super Contributor
timestamp: June 18, 2025, 07:37:29 pm
content: I ran it from a Command window and it didn't open/close like it does when I double click the py file, but I'm lost. I referenced the -h file along with going to the website in the help file, and tried formatting the command to take information from the serial and usb.Below are the steps I took and just don't understand how this needs to be formatted to listen to the incoming data from the analyzer.C:\Users\user58\Desktop\New folder>visashot.py -s asrl2 -o c:\test.pngERROR:Could not access instrument asrl2 using backend 'None': Please install PySerial (>=3.0) to use this resource type.No module named 'serial'C:\Users\user58\Desktop\New folder>visashot.py -s asrl6 -o c:\test.pngERROR:Could not access instrument asrl6 using backend 'None': Please install PySerial (>=3.0) to use this resource type.No module named 'serial'C:\Users\user58\Desktop\New folder>visashot.py -s usb6 -o c:\test.pngWARNING:There is no class defined for (<InterfaceType.unknown: -1>, None). UsingResourceERROR:Could not access instrument usb6 using backend 'None': VI_ERROR_INV_RSRC_NAME (-1073807342): Invalid resource reference specified. Parsing error.C:\Users\user58\Desktop\New folder>

author: damien
author_rank: Contributor
timestamp: June 19, 2025, 10:11:38 am
content: Not a windows user but I can try to continue from the instructions of abeyer:1) get into the virtual environment:Code:.\venv\Scripts\activate.ps12) pip install PySerial:Code:python -m pip install PySerial

author: bostonman
author_rank: Super Contributor
timestamp: June 19, 2025, 12:41:05 pm
content: Is it serial I need or USB? This is going from the serial port on the analyzer through the convertor cable and into the USB port (at the time it was port 6) on the laptop.Am I formatting the commands correctly because I'm somewhat shooting from the hip with trying to figure out the analyzer settings and the command line settings along with trying to figure out what isn't installed correctly.

author: bostonman
author_rank: Super Contributor
timestamp: June 28, 2025, 08:49:03 pm
content: I figured out in order to use the 9-pin serial port to USB, the cable needs to be null modem. After building a null modem cable, I used Putty (9600, N, 8, 1, XON/XOFF), pushed 'copy' on the analyzer, and saw a stream of information indicating it's communicating.After I played with Visashot and had very little luck. Figured I'd try ChatGPT and it had me install Magick along with adding a path in the Visa.py file. It also had me make changes to four lines (see below). The result was better, but all I got was the analyzer screen remained frozen when I ran the Visashot script, the command seemed to execute (I didn't get any errors as I was before ChatGPT helped), but no image, and, as mentioned, the analyzer screen remained frozen indicating it's not dumping the 'copy' information.What can I try now?# model = _get_model(instrument, invert_idn_order)# if model is None:# logging.error("Could not find the instrument model")# return Falsemodel = "8592L"logging.warning("Forcing model to 8592L for compatibility")

author: bostonman
author_rank: Super Contributor
timestamp: June 29, 2025, 11:27:45 pm
content: I'm at a loss with Visashot.Today I took the approach of making sure the data from the 8592L was correct by connecting my null modem cable to the serial to USB convertor and opened Putty. The settings were the same: serial, 9600, 8, N, 1, and Xon/Xoff. The analyzer is set to 'plotter' and 9600, however, I don't see any other settings other than selecting serial (or parallel if I wanted to use the parallel port) and then something called LPJ or something like that.After opening a terminal window in Putty, I pushed 'copy' on the analyzer and saw a long stream of data that I saved as a HPGL file. Then used a third party program to convert the HPGL to a PNG which it did. The screen shot looked perfect (except black and white).This I assume tells me the analyzer settings are correct, my cable is correct, and the serial to USB convertor is working.Now when I try to use Visashot, I get errors that I don't understand.The steps I took to convert raw data to an image is what I assume Vistashot does automatically; except possibly keeps it green.In any case, I could use help. According to ChatGPT, when 'copy' on the analyzer is pressed, Visashot doesn't get a reply from the analyzer and therefore it doesn't get any data including the analyzer screen remains frozen indicating the internal buffer is full which is what gives me errors.Maybe I didn't install Pyvisa correctly or did something else wrong - but I followed all the steps for Pyvisa.I think Visashot is installed correctly because I run the .py file in a CMD window from within the Windows directory it resides in without an issue.

author: KE5FX
author_rank: Super Contributor
timestamp: June 30, 2025, 09:16:56 pm
content: LLMs are great for learning about Python and writing/debugging code, but when you try to do more obscure things they often don't hold up very well. If you ask even a high-end reasoning/research model, "How can I use Visashot under Windows to obtain screenshots from my HP 8592L?" you will likely get a bunch of plausibly-hallucinated text. Instructions that probablyshouldwork, using tools that probablyshouldexist with options that they probablyshouldsupport, but don't. Just the nature of the beast.The important thing is that you have now positively established communications with the 8592L. It may be possible to get 7470.EXE working over your serial cable, if the 8592L supports commands similar to the later analyzers in the 859x series.I would suggest setting the 8592L to addressable mode (may be called Talk/Listen mode, while you may be in Talk-Only mode now.) Then, go back to PuTTY and send it the commandPLOT 550,279,9750,7479;(the semicolon at the end probably isn't necessary but for some reason I used it in 7470.EXE.) When you hit Enter, what happens?

author: bostonman
author_rank: Super Contributor
timestamp: June 30, 2025, 10:28:38 pm
content: Upon using ChatGPT to test, I was blown away, however, as you stated, the more I've used it, the more I've realized it goes in circles. I tried using it as a way of copy/pasting errors in hopes it would shed light rather than bombarding this thread.Fortunately it helped me establish a working serial cable, and, until it suggested Putty, I hadn't considered looking at incoming data. Currently I use it for certain things and feel guilty coming on here admitting to using it, but feel being honest about were my information came from that led me to this point is better; and it allows people to realize I didn't get to a certain point on my own so they don't talk too high tech.QuoteUnless I'm overlooking a menu, as mentioned, my analyzer doesn't have much for communication settings nor does it have anything related to talk/listen. In fact, I don't understand why when I select 'plotter' does it still offer comm settings for 'printer'.In any case, from what I can establish, it seems since the analyzer screen remains frozen, Visashot isn't seeing the incoming data and/or not acknowledging the incoming data; although I'd assume if it saw incoming data that it would get processed but keep the analyzer screen frozen.When using Putty, either just before or after it finishes receiving data, the analyzer screen isn't frozen indicating the buffer got dumped.Not fully understanding RS232, my thoughts are maybe the RS232 is working via Putty, but maybe pins are connected or not connected that need to be for Visashot to work correctly.If I remember correctly, I connected 1-4, 2-3, 3-2, 4-6, 5-5, 6-1, 7-8, 8-7, and 9-9

author: KE5FX
author_rank: Super Contributor
timestamp: July 01, 2025, 12:22:26 am
content: Quote from: bostonman on June 30, 2025, 10:28:38 pmI wouldn't worry too much about what other people think of your LLM usage. Some people are not great at understanding and using powerful tools. Some of those people end up on the Internet. Some of them end up on here. And they all have strong, poorly-informed opinions on the subject that they are all too happy to share. Enough said.QuoteYes, talk/listen nomenclature is normally associated with GPIB rather than serial comms, but it can still come into play. If there are no menu settings that sound similar to that, it's not a concern.QuoteYour connections are fine, and so is Putty. Putty is just a terminal program that receives text from the serial port, displays it, and sends any characters you type back to the port.However, if the analyzer can only use its serial port for one-way communication with a plotter or printer, that rules out its use with Visashot. Visashot expects to send the analyzer a request for a plot dump, which is inherently a two-way conversation. 7470.EXE can wait for the plot to be sent from the instrument, as well as actively request them. I'm curious to see if your 8592L can response to the command I mentioned. If it can, then perhaps Visashot can be modified to send that command. If it can't, then 7470.EXE is your only hope for (easily) receiving plots.

author: bostonman
author_rank: Super Contributor
timestamp: July 01, 2025, 12:58:27 am
content: I'll try the program you suggested.ChatGPT suggested sending certain commands from Putty to see how the analyzer responds and in all cases the analyzer never replied - not to say ChatGPT knew what it was talking about.Seeing how the data was received in Putty, I assume Visashot was just waiting for incoming data too, so I wasn't sure if the analyzer not accepting requests was an issue.

author: KE5FX
author_rank: Super Contributor
timestamp: July 01, 2025, 01:02:15 am
content: Quote from: bostonman on July 01, 2025, 12:58:27 amTry the command I suggested first. Just type it into Putty and hit Enter.

author: bostonman
author_rank: Super Contributor
timestamp: July 01, 2025, 06:45:19 pm
content: Looks like nothing happened.The data before (see attached) is the stream from pushing ‘copy’ on the analyzer; wanted to make sure it was communicating correctly.Attached is a screen shot and the wiring diagram for the null modem adapter I made.

author: KE5FX
author_rank: Super Contributor
timestamp: July 01, 2025, 07:23:29 pm
content: Sounds like the 8592L doesn't do anything but send data through the serial port, unless the manual says otherwise (not personally familiar with it, myself.)Some other options are to save the text received by Putty and send it to an HP-GL/2 plotting program, or write your own Python script to do the same. That's one thing that ChatGPT and similar resourcescanhelp you with... although l've been using either Claude or Gemini for programming-related stuff lately, as the decent OpenAI models are painfully slow.If you install the GPIB Toolkit, you could try using the 'Edit CONNECT.INI' option in the GPIB configurator program to change the interface_settings line tocom<your COM port #>:baud=9600 parity=N data=8 stop=1and is_Prologix to0. After saving the file, run the 7470 plotter emulator and hit the 'w' key, then press 'copy' on the analyzer. Good chance that will also work.

author: G0HZU
author_rank: Super Contributor
timestamp: July 01, 2025, 08:40:26 pm
content: After years of doing this via VB6 and other apps I ended up grabbing screen data from my test gear via MS Excel as in the screenshot below. I just select the instrument via the tab along the bottom of the spreadsheet and then hit the get screen button. It copies it to the clipboard and it can be pasted as a picture into Word and it also gets saved as a file. All the instruments are connected via GPIB except the Tek MSO4104 which connects via USB.I'm not too keen on installing the ImageMagick SW but I could try testing your Python script on some of the instruments in the Excel tabs?For example, you have the E4440A PSA as untested, also the E4406A and the 54540C scope and I have these included in my Excel spreadsheet below.

author: G0HZU
author_rank: Super Contributor
timestamp: July 01, 2025, 08:48:02 pm
content: If you want the IDNs from the instruments in the excel tabs I can send them to you (with the SN set to zero on the LSDs) along with some screenshots.Can I test your Python script on these newer instruments without needing ImageMagick? I'd rather not install it on this PC or the little EeePC.

author: bostonman
author_rank: Super Contributor
timestamp: July 01, 2025, 10:19:17 pm
content: QuoteI'm not keen either on installing such software. Not necessarily because it's another piece of software, but because I want to avoid depending on software that may go obsolete and not run on future operating systems.A VB script is a simpler solution, but also is dependent on others using MS Office versus some who use Linux and/or someone such as myself who has an outdated version of Excel that may not work with such a script.Extracting data from the (in my case) analyzer is less confusing to me after tinkering with this for so long. Unless I'm wrong, the data is simple to get. The biggest challenge is converting the data to an image. As ChatGPT had me (successfully) do: save the data string as an HPGL and use third party software to convert it.My opinion this was a long process. It provided a solution, but it's not practical for capturing several images.I think ChatGPT is capable of producing a script that will capture the incoming data string and then save it as an HPGL which reduces steps by a human.My question is: how much work to convert the data to a PNG or some other image without third party software; or some piece of software that's and can always run on an OS?

author: KE5FX
author_rank: Super Contributor
timestamp: July 01, 2025, 10:53:00 pm
content: Quote from: G0HZU on July 01, 2025, 08:40:26 pmThat's pretty slick! Is it online anywhere? I'll add a link to my 'Third-party software' section if so.

author: G0HZU
author_rank: Super Contributor
timestamp: July 02, 2025, 03:55:03 pm
content: Hi KE5FX. It's not online anywhere as it really isn't very portable. It is configured to work for my instruments and the two PCs I use and it really is very fussy about changes. It took me a while to get it to work on both PCs and with both GPIB to USB adaptors I have here.In my case it was worth the effort as I use it to grab screenshots to the clipboard (and to a file if required) and this is great for rapidly putting them into a Word document. Before I had this, there was always that mental barrier of having to use different tools for each piece of test gear. Also the SW tool might not be able to directly copy to the clipboard.Here's a quick Youtube demo across seven instruments. It's a hot day here today and my workroom quickly became really hot with all this test gear on at onceIt is also possible to configure it to dump multiple screen grabs from the same instrument into Excel. It then overlays the images in a neat pile within Excel with a slight offset between them. So (say) ten grabs could be made in a few seconds and the ten images could be saved or processed later.

author: wkb
author_rank: Super Contributor
timestamp: July 02, 2025, 04:05:28 pm
content: ImageMagick has been around "for eons". Less hassle than our friends at M$. So, do not assume problems when there are unlikely to be any

author: bostonman
author_rank: Super Contributor
timestamp: July 04, 2025, 01:59:52 am
content: I've been working with ChatGPT on creating a script to capture the analyzer screen data.Either this is a difficult process or ChatGPT is having difficulty. It kept giving code to me over the last three-days that seemed to abort before all the data was captured. It seems to think Xon/Xoff stuff was messing up things and kept tweaking. It wasn't until tonight when I informed it that using Putty, from the time I press 'copy' on the analyzer to when the data finishes being captured is about seventeen-seconds. It then placed a twenty-two second (per my suggestion) time out which seemed to have solved the capturing issues.Currently I have something that seems to work, however, I haven't done any extensive tests other than a few successful captures. It still needs some tweaking because it's quite basic and needs the code edited to fluff it a bit.In any case, Ghostscript seemed to be the suggested software to convert the hpgl file, but I'm getting an issue with the "auto" convert from hpgl > ps > PDF, so I'm using an online convertor to go from hpgl to PDF and also hpgl to PNG. I think the error is in the code and not pointing to the correct directory, but this is a minor issue that I haven't bothered to address.The more serious issue that seems to be occurring is some text is being translated wrong (see attached hpgl file).I haven't figured out which single or multiple characters are causing issues. Maybe it's the online convertors I'm (temporarily) using that can't convert the data correctly or maybe it's the data stream.I'd appreciate any feedback on this issue and how to possibly resolve it.

author: KE5FX
author_rank: Super Contributor
timestamp: July 04, 2025, 02:18:09 am
content: Almost no generic .hpgl renderers are worth messing with when it comes to rendering plots from test equipment. Your data stream seems OK, in that 7470.EXE can render it without any trouble:This isn't because 7470.EXE is so great, or because the other renderers are so terrible, but because so many instruments don't actually conform to the published specs for HP-GL/2. Many of them generate output with various quirks and bugs that the original HP 7470-series plotters shrugged off, but that anyone writing an emulator would have no reason to anticipate.Whenever I run into one of those "quirks", I add a hack to work around it... and believe me, at this point there are a LOT of hacks.For an automated HPGL->PDF pipeline, ImageMagick is almost certainly a better bet, just going by how well it works with the Visashot package. I would stick to that, for what you're doing.(As for ChatGPT, naturally it's not a mind-reader, and it isn't sitting there beside you, so it doesn't know how long the timeout intervals need to be unless you tell it. These tools are incredibly powerful but "vibe coding" only gets you so far.)

author: bostonman
author_rank: Super Contributor
timestamp: July 04, 2025, 02:34:44 am
content: That looks great; I really like the white with blue line. It's better than the green which I thought was good - maybe because it mimicked the actual screen; and better than just having all one color.Thanks for converting that (I haven't quite figured out that 7470 program - seems like it installs a bunch of other programs). In any case, my focus has been to capture the data and then work on a simple conversion later. I'm sure Imagemagick is better, and whether I've used others in the past and will continue, as stated above, my current focus is just getting a working capture script, but I plan to use Imagemagick since it's been highly recommended.The current script opens a window similar to a CMD window (or maybe it is) with a small pop up window that you click when you're ready to start the capture. The comm port is pre-selected in code (I change it if need be), and then converts the hpgl to ps and then to PDF (which currently fails).My vision is: open the script, select the comm port, press the capture button, push copy on the analyzer, it captures the data, converts it, and either deletes the hpgl and ps files or moves them to another directly. Although, seems as if I use Imagemagick, I won't need a ps file, so maybe move the final PNG file to a sub-directory.

author: KE5FX
author_rank: Super Contributor
timestamp: July 04, 2025, 02:58:40 am
content: Quote from: bostonman on July 04, 2025, 02:34:44 am7470.EXE doesn't install anything else, but it is one of several programs whose shortcuts are all (unfortunately) dumped on the desktop by the install program. In retrospect I wish I hadn't done that, but it doesn't bug me enough personally to fix it.Youcanforce 7470.EXE to write a .PDF by setting up a .PDF writer as your system's default printer but whether that is more or less trouble than what you're doing now, I couldn't say.QuoteYeah, I'd focus on swapping out Ghostscript for ImageMagic, assuming you can get it to render the .hpgl file well. Being a plotter emulator, the color choices are generally easy to change in these programs. ChatGPT is probably reasonably conversant with ImageMagick, since as wkb and others have pointed out, it has been around a while.Edit: seems ImageMagick doesn't accept HPGLorrender to .PDFs directly, so...

author: bostonman
author_rank: Super Contributor
timestamp: July 06, 2025, 02:00:21 pm
content: QuoteI didn't realize a new message was posted, so I'm just getting this.Ironically I was just researching ImageMagick to see which commands to use for converting HPGL to an image.At the moment I'll have to tinker with which options are best because 7470 is great, but I think it's GUI based whereas I need a command line method for quick converting. Ideally after the data is received, I'd like to have it converted automatically and either open for immediate viewing, or at least be in a directory to open/view.

author: bsdphk
author_rank: Regular Contributor
timestamp: July 06, 2025, 09:46:19 pm
content: I wrote some code many years ago which properly renders the input data to the old HP vector displays as SVG.Here is a sample output from HP8568B:https://phk.freebsd.dk/_images/spec_6731.svgBecause the SVG is vector based, you can scale however you want.Feel free to steal whatever code you can use from:https://github.com/bsdphk/pyltandhttps://phk.freebsd.dk/hacks/Wargames/

author: bostonman
author_rank: Super Contributor
timestamp: July 06, 2025, 11:10:48 pm
content: Thanks for the code.After several hours with ChatGPT, I've managed to accomplish little.My plan was to make the most simple GUI with the most basic add-ons/libraries that captures the incoming data stream as an HPGL, converts it to a post script (a necessary step according to ChatGPT), and then converts it to PNG (or PDF).The GUI is nice, but after two-days and about ten-hours, I realized it's nothing more than Putty. Today I was informed by ChatGPT that the post script file(s) aren't correct and it's why the PDF comes out blank. Until now, I was ignoring that issue because I was trying to perfect the GUI and thought adding the necessary code to do the conversion was simple. Thought I have the HPGL data/file, it's converting it to PS, and then all I need is to add on converting from PS to PNG or PDF.Today I tried having it create a script to auto run 7470.exe because I like the color scheme (white background and blue lines). It told me a script to auto run the 7470 was easy, but after two-hours of it sending me in circles, I gave up.Eventually it told me it could create a script to convert HPGL to post script without needing anything else except Python code, that was about two-hours wasted because it got close, but all I'd get was the screen (no text) the size of a quarter.The GUI saves the step in Putty of setting up the comm port, capturing the data, saving it as an HPGL, etc... but it still requires manual time consuming labor to convert it in 7470. Ideally I want to capture the data, bing bang, and I have a nice PNG of the screen.The other thing I was confused at towards the end of my ChatGPT go around in circles chat was that I thought 7470 can create a PNG from an HPGL. Unless I'm doing something wrong, you have to select 'all files' to see an HPGL file, and then you can only save it as a BMP, GIF, etc... Once you close 7470 or try opening another HPGL file, you have to select 'all files' again.This is the part ChatGPT was struggling with because sometimes 7470 would pop a window asking to add text and throw errors in the script.I got burnt out and gave up for now, but ideally if I could get 7470 to auto run somehow, then I think it would be pretty cool.

author: KE5FX
author_rank: Super Contributor
timestamp: July 07, 2025, 02:32:22 am
content: Yep, it will save .GIF/.PCX/.BMP/.TGA files, but not .PNG. For these types of plots, there is no reason to use .PNG. They don't need to go beyond 8-bit color, and 8-bit .GIFs actually tend to be a bit smaller than .PNGs.I wouldn't expect LLMs to know a whole lot about 7470.EXE, as it's much more obscure than the other general-purpose vector graphics renderers. You'd almost be better off feeding the .cpp files to a large-context model and asking it to translate it all to Python.I haven't tested it in a million years, but at one point the auto_print_mode option in 7470.INI would do what you're talking about. You would set up your default printer to write .PDF files (or .PS, I suppose.)

author: bostonman
author_rank: Super Contributor
timestamp: July 07, 2025, 02:47:31 am
content: I agree that GIF or BMP is probably just as good.The screen shot in a previous post was a PNG, so I was under the assumption 7470 went from HPGL to PNG - it really doesn't matter to me. I tend to like final screen shots to be PDF, but an image is just as good.I should check the HPGL file that was obtained from my script in 7470 to make sure it's correct before continuing. For what it's worth, I probably never used my analyzer since obtaining it several years ago, so being able to print from it really is just the challenge at this point.Also, I thought implementing Visashot was a simple task, but, as we discovered, apparently it doesn't support my analyzer.Worse case I can manually use 7470, but that wouldn't be fun; and it would be time consuming.You bring up an interesting subject and not sure whether you were serious. I didn't see an .ini file, but I see C code for 7470. Maybe ChatGPT can use that to implement the conversion.Maybe I can spend thirty or forty hours letting ChatGPT send me in circles.

author: abeyer
author_rank: Frequent Contributor
timestamp: July 07, 2025, 02:57:16 am
content: Claude (particularly Claude Code) and github Copilot Pro are both much better options for writing software than ChatGPT right now, from everything I've seen. Also, once you start going in circles you should just stop... they are all pretty bad about not being able to right themselves once that happens. You need to take a step back then and resetsomethingor it will usually just continue. That could be just switching models, or feeding the output of one to another, or write some code or pseudocode yourself that sketches out something that it's doing wrong and ask it to flesh out the details, or even just start a new session and rewrite your prompt different from the start. If you don't do something though, and just keep repeating what's not working, you're wasting your time (not to mention tokens, if you're paying for usage.)I'm still not certain you couldn't get visashot working... but not sure what's wrong there either. I poked at the docs on hparchive for a minute and it sounded like that model should from what I saw.

author: bostonman
author_rank: Super Contributor
timestamp: July 07, 2025, 12:25:51 pm
content: QuoteI'll have to keep this in mind and possibly try it too.QuoteYou couldn't have said it any better. My first request was asking for a GUI that had several features. The GUI it initially made was great, great color scheme, etc... and just about the entire layout was done without any direction.I told it the GUI was great, now let's just move something here, or change this to that. It decided to strip everything in the GUI in order to implement a change. I'd tell it to add the stuff it previously had, suddenly it's placing things where they don't belong, text doesn't fit within the GUI, the GUI wouldn't load, etc... Once the GUI didn't load, that's when it really went downhill because suddenly it's focused on installing libraries rather than realizing: the GUI worked before I made this change.I began telling it immediately that here is the code that I liked and works, but had flaws, let's call this Rev 1. As time went on, I'd say, no, give me the GUI you had in Rev 1.In any case, you could be correct about Visashot working with my analyzer, but I found myself confused over the command line since I'm not Linux savvy which may have contributed to it not working. My experience was that I tried all the commands and got results I didn't understand and even resorted to ChatGPT by letting it read the help file and directing me. One argument I had with ChatGPT is it kept telling me to install NI, and I kept arguing that Pyvisa is all that's needed.Seeing the data stream in Putty gave me the idea to let ChatGPT create a simple GUI to act like Putty. It detects available comm ports, you select which one, push capture data, etc... The initial issue was timing. From what I calculated, at 9600 baud it takes 17s from the time 'copy' is pushed on the analyzer to when the data finishes. This took a bit to work into the code, but the GUI works almost flawlessly now.As stated though, after several days, all I've done is reinvented the wheel because I have a simple version of Putty without the ability to convert HPGL to something usable.

author: KE5FX
author_rank: Super Contributor
timestamp: July 07, 2025, 07:48:53 pm
content: Quote from: bostonman on July 07, 2025, 12:25:51 pmI still don't understand that myself. How PyVisa is supposed to communicate with an NI488.2-compatible interface if you didn't install the manufacturer's low-level kernel driver package for that specific interface, I have no earthly clue.People on here are swearing that it works, though, so...

author: abeyer
author_rank: Frequent Contributor
timestamp: July 07, 2025, 08:51:13 pm
content: Quote from: KE5FX on July 07, 2025, 07:48:53 pmIf you need a kernel driver then you need a kernel driver... but that's generally only true if you have a pci/isa gpib card in your machine. Many cases (I'd saymostcases in modern use) you're not using gpib hardware directly in the host machine, but over an adapter to serial, usb, ethernet, etc... In that case you don't need a driver, only an implementation of the protocol on top of the the low-level driver for whatever hardware bus you're communicating on.

author: KE5FX
author_rank: Super Contributor
timestamp: July 08, 2025, 01:16:04 am
content: Quote from: abeyer on July 07, 2025, 08:51:13 pmThat's the problem, though. Going with the USB example, under Windows, you need a manufacturer-specific USB driver for an NI GPIB-USB-HS adapter. Even though the GPIB-USB-HS uses a bog-standard FX2LP USB device controller, it does not support any predefined USB device classes, and it will enumerate with a VID and PID that Windows has no idea what to do with. A given system might have multiple copies of cyusb.sys sitting around, but the OS won't know to assign it to the adapter if you don't install the NI driver package.Maybe things are different in Linux, but in Windows there is basically no way that pyvisa is going to talk to an NI PCIorUSB adapter without either installing some sort of OEM driver or doing some fancy Zadig-style footwork to assign a generic FX2LP driver to that VID/PID and self-sign it.If there's a tractable way to do that, neither ChatGPT nor an extremely-experienced USB device developer (your humble narrator) is aware of it.

author: bostonman
author_rank: Super Contributor
timestamp: July 08, 2025, 02:30:46 am
content: Unfortunately I don't have input because I thought Visaprint was Windows based; or able to run on Windows with ease.After following directions on installing libraries through Powershell and still not getting it to work, the conclusion was this is deeper than just double clicking a script because I don't know Linux command lines well.I checked the HPGL data from my GUI script (see attached) using 7470 and it's apparent that the incoming data is good. As mentioned, the script also converts the HPGL > post script > PDF, but the PDF was always blank. Some was due to the script not having the correct path, but, from my understanding, the PS file doesn't contain the correct information.Currently I need the extra step of going from HPGL to an image file (JPG, BMP, etc..) or PDF as easy.Seems 7470 can be somewhat automated with a script, but I've noticed sometimes it opens a window to add caption text and sometimes it doesn't. Also, the file drop down menu doesn't include HPGL, so 'all files' need to be selected. This confuses the script, so I haven't been able to automate it this way either.I thought ChatGPT could create a script to mimic the HPGL data and draw something it can convert to an image file, but that proved to be about two-hours wasted.

author: abeyer
author_rank: Frequent Contributor
timestamp: July 08, 2025, 04:00:20 am
content: Quote from: KE5FX on July 08, 2025, 01:16:04 amMy understanding is the python usb stack uses libusb and winusb to communicate from userspace. I don't think you even need zadig anymore, though it will work. You can use winusb.sys as the driver (signed by MS) and might need to manually load it or provide an INF to force it by vid/pid, if the device doesn't natively allow it. That's about the limit of what I know, as it's always just worked for me with my hardware, and never needed to dive deeper. There may well be something special about the GPIB-USB-HS that prevents that approach from working, but don't own one so can't really say. pyvisa-py is pretty clear that they don't support every possible config, and they document pretty well what you need to do to configure it for what it does support.