HP 16500B Screendump with LAN option and Python - Page 1
Forum section: electronics / testgear

author: davorin
author_rank: Unknown
timestamp: January 22, 2015, 12:24:19 pm
content: As I saw on this site (http://www.philpem.me.uk/elec/testgear/hp16500b/rc/) that if you have a LAN adapter in your 16500B, you can actually NFS mount your LA as it exports two file systems.So if you are under Ubuntu or Debian like me, first install your NFS client by doing:Code:sudo apt-get install nfs-commonThen create a local directory where you want your HP 16500B to be mounted and mount the /data filesystem as NFS version 2:Code:mkdir mntsudo mount 10.0.0.100:/data mnt -o nfsvers=2Now you should see the files on your LAs disk:Code:root@nuc:~/Downloads/16500B# ls -l mnt/system/insgesamt 2dr-xr-xr-x 4 daemon daemon 638 Jan 21 13:30 diskdr-xr-xr-x 2 daemon daemon 894 Jan 21 13:30 graphics-rw-rw-rw- 1 daemon daemon 0 Jan 21 13:30 program-rw-rw-rw- 1 daemon daemon 1 Jan 21 13:30 setup.rawInterestingly in the "graphics" directory are some files with .pcx and .tif endings...but...they are not paintbrush or TIFF files at all...just plain 8-Bit screendump files ( 576 x 368 ) with a offset of 1734:Code:root@nuc:~/Downloads/16500B# ls -l mnt/system/graphics/insgesamt 2-r--r--r-- 1 daemon daemon 1 Jan 21 13:30 screenbw.epi-r--r--r-- 1 daemon daemon 1 Jan 21 13:30 screenbw.tif-r--r--r-- 1 daemon daemon 1 Jan 21 13:30 screen.pcx-r--r--r-- 1 daemon daemon 1 Jan 21 13:51 screen.tifNow a simple python script, which I'm sure it can be further optimizted and enhancded, reads out this data and saves it as a local PNG file:Code:from matplotlib import pyplot as pltimport numpy as npimage = np.empty((368,576), np.uint8)screen = open('/home/klingler/Downloads/16500B/mnt/system/graphics/screen.tif')screen.seek(1734)image.data[:] = screen.read(211968)plt.imshow(image)plt.savefig('/home/klingler/Bilder/screen.png')Okay...the resulting image is a bit...strange...as here blue and orange are exchanged....so the data needs a little modification...or there is some option in pyplot library to do that...At least you can do now simple screen shots without going via RS232 or HPIB (o;

author: BloodyCactus
author_rank: Frequent Contributor
timestamp: January 22, 2015, 02:13:46 pm
content: you can telnet in and issue gpib style commands.or, once you have the directory mounted like you didsend commands to "\system\program"echo ":BEEP OFF" > /mnt/sysytem/programturns beep off!for running...echo ":START> /mnt/sysytem/programecho ":STOP" > /mnt/sysytem/programyou should also telnet to port 5025 on the LA and issues same commands without doing a nfs mounttelnet 10.0.0.100 5025then just type:BEEP OFFetc(the 16500B does not have the LAN stuff, thats in the C guide)take a look in 16500C programming guidehttp://literature.cdn.keysight.com/litweb/pdf/16500-97018.pdf

author: davorin
author_rank: Unknown
timestamp: January 22, 2015, 02:21:31 pm
content: Can a screendump only be sent via RS232 and GPIB? Well...apart from above solution (o;Modified the code a little to reflect the correct colors:Code:from matplotlib import pyplot as pltfrom matplotlib import colorsimport numpy as npimage = np.empty((368,576), np.uint8)cmap = colors.ListedColormap(['black', 'sandybrown', 'white', 'blue', 'lightblue', 'green', 'red', 'yellow'])bounds = [0, 1, 2, 3, 4, 5, 6, 7]screen = open('/home/klingler/Downloads/16500B/mnt/system/graphics/screen.tif')screen.seek(1734)image.data[:] = screen.read(211968)plt.imshow(image, cmap=cmap)plt.savefig('/home/klingler/Bilder/screen.png')"sandybrown" seemed the closest match for me ;-)

author: BloodyCactus
author_rank: Frequent Contributor
timestamp: January 22, 2015, 02:25:00 pm
content: if you wish to take screenshotsCode::SYSTem:PRINt ALL[,DISK, <pathname>[,<msus>]]:SYSTem:PRINt PARTial,<start>,<end>[,DISK, <pathname>[,<msus>]]:SYSTem:PRINt SCReen[,DISK, <pathname> [,<msus>],{BTIF|CTIF|PCX|EPS}The PRINt command initiates a print of the screen or listing buffer over thecurrent PRINTER communication interface to the printer or to a file on thedisk. PRINt ALL is only available in menus with an ASCII representation.PRINt SCReen allows you to specify a graphics type. The BTIF optionformats the screen data in black-and-white TIF. The CTIF and PCX optionsformat the data in color TIF and color PCX respectively. EPS specifiesEncapsulated PostScript format.If a file name extension is not specified in the command, the correctextension will be appended to the file name automatically. The file nameextension is TIF for both BTIF and CTIF options.PRINT PARTial is valid in certain listing menus. It allows you to specify astarting and ending state number so you can print just a portion of the listingto the printer or to a disk filePATHNAMEA string of up to 10 alphanumeric characters for LIF in the following form:NNNNNNNNNNorA string of up to 64 alphanumeric characters for DOS in one of the followingforms:NNNNNNNN.NNNwhen the file resides in the present working directoryor\NAME_DIR\FILENAMEwhen the files does not reside in the present working directoryMSUSMass Storage Unit specifier.INT0 for the hard disk drive and INT1 for the flexible disk driveThis instruction prints a black-and-white TIF file to the hard drive::SYSTEM:PRINT SCREEN, DISK, ’PICTURE’, INT0, BTIFif you do PCX, you should get the rgb pallete information in there as well. (I have not checked).there is also:SYSTEM:PRINT? SCREENbut not entirely sure what you get back with that one.

author: davorin
author_rank: Unknown
timestamp: January 22, 2015, 02:32:18 pm
content: Well....I prefer my method...as accessing the screen.tif file directly triggers also the screendump without any command upfront...But I will definitively try the "echo 'command' > " approach to generate some screenshots and see, if it is possible in any screen....

author: davorin
author_rank: Unknown
timestamp: January 22, 2015, 02:58:03 pm
content: Some little mods to remove the white space around...dunno how to specify an image size in pixels though...that's why the strange 93dpi (o;Code:from matplotlib import pyplot as pltfrom matplotlib import colorsimport numpy as npimage = np.empty((368,576), np.uint8)cmap = colors.ListedColormap(['black', 'sandybrown', 'white', 'blue', 'lightblue', 'green', 'red', 'yellow'])bounds = [0, 1, 2, 3, 4, 5, 6, 7]screen = open('/home/klingler/Downloads/16500B/mnt/system/graphics/screen.tif')screen.seek(1734)image.data[:] = screen.read(211968)fig = plt.imshow(image, cmap=cmap)plt.axis('off')fig.axes.get_xaxis().set_visible(False)fig.axes.get_yaxis().set_visible(False)plt.savefig('/home/klingler/Bilder/screen.png', bbox_inches = 'tight', pad_inches = 0, dpi = 93)

author: davorin
author_rank: Unknown
timestamp: January 22, 2015, 06:30:07 pm
content: Even X-Windows works with todays Ubuntu version....took me few minutes to get the xorg configs right (o;And doing a print screen to a TIF file on the hard drive has much better quality than the PyPlot version...hmmm....seems PyPlot library does some scaling where it looses data...

author: BloodyCactus
author_rank: Frequent Contributor
timestamp: January 22, 2015, 06:50:18 pm
content: what x windows settings did you use. i spent lots of timming messing with stuff but not getting it coming up on my local ubuntu machine.

author: davorin
author_rank: Unknown
timestamp: January 22, 2015, 06:59:00 pm
content: Okay...hope I remember it well (o;First you need to download the two fonts from the LAs disk, convert and gzip them. This step is also documented here:http://www.philpem.me.uk/elec/testgear/hp16500b/rc/But I've uploaded them here (o;Code:bdftopcf lg165.bdf > lg165.pcfbdftopcf sm165.bdf > sm165.pcfgzip *.pcfCopy them to the "misc" font directory and reload it:Code:sudo cp lg165.pcf.gz sm165.pcf.gz /usr/share/fonts/X11/misccd /usr/share/fonts/X11/miscsudo mkfontdirAdd following lines to "/etc/lightdm/lightdm.conf"Code:xserver-allow-tcp=truedisplay-setup-script=/usr/local/bin/xhost.shThe bash script is just a simple "xhost +" inside:Code:#!/bin/bashxhost +Change "/etc/X11/xinit/xserverrc" to:Code:#!/bin/shexec /usr/bin/X "$@"Think this was all...and a simple logout/login might cause X11 to restart already...How to connect from the 16500B should be clear I guess (o;