From: John A. N. <jr...@fe...> - 2003-06-22 16:51:37
|
I wonder if anyone has done this, or can provide some starting hints to point me in the right direction... I'd like to create a tool that will emulate an HP plotter and create a graphics file output. I have several instruments that have a "plot" function that dumps a screen trace to the GPIB port, and I'd like to emulate that -- basically, I'd run the capture program on the Linux box, push the "PLOT" button on the instrument (or issue a GPIB command), and end up with a PNG file of the dump. I've already written a graphics backend that will handle the image rendering, but I'm not sure how to start with the GPIB side of things -- how do I make the PC look and respond like a plotter when the instrument sends the plot command? Here's a bit of description from an HP manual when using the "PLOT" key: The plotter/printer must be addressed to listen-only and all controllers must be removed from the bus... When the PLOT key is pressed, the instrument checks to make sure there is at least one listener and no controllers on the bus, and if so, begins sending HP-GL commands to the device. Unfortunately, there's no description of what happens when the plot is complete. It appears from some other parts of the documentation that the device is supposed to assert SRQ when it's finished with the dump, but you need to check the status without doing a serial poll as that would abort the plot in process. Alternatively it may work to snoop on the transfer and look for the EOI signal to be true. Thanks for any pointers you might have... once again, I'm delving in way beyond my limited knowledge of GPIB. John jr...@fe... PS -- I've written screen capture programs "the hard way" for the HP 3585B and HP 8569B analyzers; these use GPIB commands to get trace data and instrument settings and prepare PNG plots. They work really well, but it's a pain to write a separate program for each instrument; a plotter emulator seems like a useful way around this problem. If you're interested in the current programs, they're written in perl and are available at ftp://ftp.febo.com/pub/n8ur_programs/ with descriptions available at http://www.febo.com/geekworks/data-capture/hp3585b.html and http://www.febo.com/geekworks/data-capture/hp8569b.html. The 3585B program builds on and improves the current version of the 8569B program; I'll be updating the 8569B program to match as soon as I have time. (Frank, if you want to pick these up for perl examples in the distribution, feel free.) |