LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Plot file (HPGL PLT file) conversion to image

Highlighted

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!

0 Kudos
Message 1 of 29
(3,063 Views)

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?

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 2 of 29
(3,031 Views)

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)...

0 Kudos
Message 3 of 29
(3,010 Views)

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!

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 4 of 29
(3,006 Views)

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 Smiley Wink

 

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...

0 Kudos
Message 5 of 29
(3,002 Views)

Hi cassaniti,

 

I tried this webpage for free and got this:

pltfile.png

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 6 of 29
(2,994 Views)

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?

0 Kudos
Message 7 of 29
(2,990 Views)

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…

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 8 of 29
(2,984 Views)

I'm in for the second choice (my company pays for my time Smiley Very Happy ) 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

0 Kudos
Message 9 of 29
(2,980 Views)

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…

Best regards,
GerdW
CLAD expired, using 2009SP1 + LV2011SP1 + LV2017 (+LV2018 sometimes) on Win7+cRIO
Kudos are welcome Smiley Wink

0 Kudos
Message 10 of 29
(2,960 Views)