LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get a panel in PNG format?

I would like to get a front panel image and post it on the web. While I have a model working, currently it gets the image, saves it to a .png file, and then the .png file is read to the server. I'd like to skip the step of writing it to a file. Does anyone know how to do that?

Mark
0 Kudos
Message 1 of 6
(3,369 Views)
In your LabVIEW directory , the file \www\vis.htm explains how to publish VI
images using the built-in LabVIEW Web Server.
However the computer running LabVIEW must be connected to Internet. Is that
the same computer that runs the Web Server and LabVIEW?

Jean-Pierre Drolet


"markwysong" a écrit dans le message news:
5065000000080000007A200000-991728092000@quiq.com...
> I would like to get a front panel image and post it on the web. While
> I have a model working, currently it gets the image, saves it to a
> png file, and then the .png file is read to the server. I'd like to
> skip the step of writing it to a file. Does anyone know how to do
> that?
>
> Mark


LabVIEW, C'est LabVIEW

Message 2 of 6
(3,369 Views)
I have used the Labview Web Server with the snap and monitor commands. This is not what I am doing in this case. Using the snap or monitor commands really does the same thing: Labview creates a graphics file and then ports that file out to the server. Unfortunately, this could occur at a bad time while I am taking data, so I want to control when that image would get updated.

Therefore, I'm using a different method in which I can control when the image is updated. It still uses the same method, however, because with LabVIEW canned VIs, you can get the front panel image, and then the only way to convert it to .png format is to use the "Write to PNG file" vi, which writes it to the disk. I then have to read that file to send it to the server. If I coul
d make the conversion to png but skip the write to disk portion and directly send it to the server, that would be much, much better. That's what I'm looking for!

Mark
0 Kudos
Message 3 of 6
(3,369 Views)
"markwysong" a �crit dans le message news:
5065000000050000009F2D0000-991728092000@quiq.com...
> I have used the Labview Web Server with the snap and monitor commands.
> This is not what I am doing in this case. Using the snap or monitor
> commands really does the same thing: Labview creates a graphics file
> and then ports that file out to the server. Unfortunately, this could
> occur at a bad time while I am taking data, so I want to control when
> that image would get updated.
>

I would be surprised that LabVIEW use files to transfer panel image data
from the VI part of the application to the Web Server part of the same
application. When the Web Server publishes front panel with .snap? and
..monitor?, there is no noticeable disk activity, at least on my system.
However, it is always possible that Web Server activities interferes with
your data acquisition. Did you consider to programmatically shutdown the Web
Server during critical parts of your data acquisition?


> Therefore, I'm using a different method in which I can control when
> the image is updated. It still uses the same method, however, because
> with LabVIEW canned VIs, you can get the front panel image, and then
> the only way to convert it to .png format is to use the "Write to PNG
> file" vi, which writes it to the disk. I then have to read that file
> to send it to the server. If I could make the conversion to png but
> skip the write to disk portion and directly send it to the server,
> that would be much, much better. That's what I'm looking for!
>
> Mark

You did not reply to my previous question: Is it the same computer that runs
the Web Server and LabVIEW? If it is a different computer, you could run on
the Server a small LabVIEW application that invokes the GetPanelImage method
to the remote data acquisition computer and save the PNG file. That should
free some ressources on the data acquisition computer.

It seems that there is a function in the library lvpng.dll to get the image
to PNG format in memory rather than to a file. Maybe you could ask NI to
have the function prototype. That would fit exactly what you needs.

Jean-Pierre Drolet


LabVIEW, C'est LabVIEW

0 Kudos
Message 4 of 6
(3,369 Views)
Jean-Pierre,

Thank you for your response. The reply to your previous response is yes, the LabVIEW computer and the Web server are on the same PC, and unfortunately, I can't change that, due to company policy.

I am not aware that there is a function in the lvpng.dll that does the image to png format in memory, but it's certainly worth asking. If I can find that out (from NI), you're right, that would solve the problem. It's certainly worth asking.

Mark
0 Kudos
Message 5 of 6
(3,369 Views)
markwysong wrote:
>
> Jean-Pierre,
>
> Thank you for your response. The reply to your previous response is
> yes, the LabVIEW computer and the Web server are on the same PC, and
> unfortunately, I can't change that, due to company policy.
>
> I am not aware that there is a function in the lvpng.dll that does the
> image to png format in memory, but it's certainly worth asking. If I
> can find that out (from NI), you're right, that would solve the
> problem. It's certainly worth asking.

One crude way to do it: create a RAM disk (ramdrive.sys documentation).
Then "write" a PNG file on this disk.

That shouldn't cause any actual hard disk access.

Mark
0 Kudos
Message 6 of 6
(3,369 Views)