LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Plot file (HPGL PLT file) conversion to image

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
(7,260 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


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 29
(7,228 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
(7,207 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


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 29
(7,203 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 😉

 

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
(7,199 Views)

Hi cassaniti,

 

I tried this webpage for free and got this:

pltfile.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 29
(7,191 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
(7,187 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


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 29
(7,181 Views)

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

0 Kudos
Message 9 of 29
(7,177 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


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 10 of 29
(7,157 Views)