02-13-2015 02:26 AM - edited 02-13-2015 02:27 AM
Hello everybody! I've been trying to convert an HPGL .plt file generated by the HP 8722D Network Analyzer to an image (jpg or png) without success.
First i saw that there is an interesting llb which is able to parse my PLT file and to convert it to an XY graph: http://forums.ni.com/t5/LabVIEW/HPGL-plotting-of-a-legacy-Agilent-Spectrum-Analyzer-Labview/m-p/1620...
Useful, but i get only the waveform but i lose the other information (frequency start-stop and so on).
Irfanview is able to open the image and show me a preview of what i want (a screenshot of the device screen) and i tried with an online PLT file viewer ( https://www.sharecad.org) and again it shows me what i expect.
I then tried to convert the image with Ghostscript (the idea is to run a command line conversion through labview after i get the plt file from the device) but i get an error at the beginning of the conversion:
gswin32c.exe -sDevice=pngmono -o file.png file.plt
Error: /undefined in ;;;DF;IM;IP250,279,10250,7479;SC0
So my question is: is it possible through labview to simply parse the PLT file and convert it to a RGB (or B/W) image? Can somebody please help me?
I attach the .plt file, a screenshot of the HPGL parser XY Graph and a screenshot of the Irfanview screenshot.
Thanks in advance!
02-13-2015 02:36 AM
Hi cassani,
to answer your question:
You already got the curve data, but you need the correct scaling parameters. Those parameters should be known as you (probably) started the acquisition using them…
There should be other ways to get measurement results than just by analyzing a HPGL formatted data stream. Can't you read the measurement values directly from your NetworkAnalyzer?
02-13-2015 04:28 AM - edited 02-13-2015 04:29 AM
Thanks for the quick reply!
The problem is that i don't need the measurement values (I already have them!).
I want a screenshot exactly as it's shown in the "IrfanviewScreeenshot" file in attachment (where on the top left you can read S11, logMAG, 10dB/Ref, the marker position and so on)...
02-13-2015 04:30 AM - edited 02-13-2015 04:32 AM
What have you tried? What is your problem?
Use graphs and string indicators (or maybe enums?) to create such a user interface…
is it possible through labview to simply parse the PLT file and convert it to a RGB (or B/W) image?
Why don't you use IrfanView for this task?
Call IrfanView using SysExec, it allows a lot of command line options!
02-13-2015 04:40 AM - edited 02-13-2015 04:41 AM
I would use IrfanView if there was not this huge "please purchase CAD Image DLL to remove this text" in the middle of my screenshot 😉
I am making a program that supports several devices which has a simple task: you press the button "screeenshot" and it saves a png image of the device screen. Unfortunately this HP8722 is very old and the only way i can get a screenshot is through this .plt file, so i need a way to convert it to an image (through ghostscript, irfanview, or even better directly through labview)... As i mentioned before I tried through Ghostscript and i tried through this HPGL parser, but no success so far...
02-13-2015 04:46 AM
02-13-2015 04:50 AM
As i mentioned also found a similar website that was allowing this (even though this allows me to download a png file, which gets me closer to my goal!).
The point is that i need to do the conversion somehow programmatically in labview! Do you have any idea how could i get this done?
02-13-2015 04:55 AM - edited 02-13-2015 04:56 AM
Hi cassaniti,
I also downloaded a PNG from that website…
I see two options:
1) Pay 19US-$ for that CADSoft license and use IrfanVIEW to convert from PLT to PNG.
2) Program your own PLT to PNG converter, it seems rather straightforward with those simple HPGL commands.
Either pay some money for ready-to-use software or pay money for your working time. It's your choice…
02-13-2015 04:58 AM - edited 02-13-2015 05:08 AM
I'm in for the second choice (my company pays for my time 😄 ) but i don't know where to start... where did you find the "HPGL Commands"?!
I'm following this: http://en.wikipedia.org/wiki/HPGL
The thing is that i don't know how to convert what i parse to an RGB image
02-13-2015 05:44 AM - edited 02-13-2015 05:45 AM
Hi cassaniti,
Wikipedia also has links to websites with descriptions of the HPGL commands, you just need to read them…
The thing is that i don't know how to convert what i parse to an RGB image
HPGL was intended to be used for plotters: devices, which pick a pen and move that pen over a sheet of paper.
Simple plotters used just one pen (most probably black), better plotters hold more pens. Colors are given by selecting a pen.
All those other commands just move the pen - very similar to those drawing commands in LabVIEW picture functions palette…