LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems by deleting file after writing data with write png

I create a file by using the LabVIEW standard vi "write PNG". The file I generate is a logfile, after the program will close, the file should be deleted.
Bus the problem is, that the standard vi for clos file doesn't work, I get the error 8, file permission error.
I closed the file everytime I use the function open file. But as soon as I use the write or read png file, the file can't be closed, and not be deleted. The vi's read and write png doesn't have the refnum as an output, so it's not possible to close the file.

Do anywone have a solution for this?

Best regards

Alessandro Sebaste
0 Kudos
Message 1 of 6
(2,766 Views)

I don't quite understand the problem you're having...it looks like you're mixing the File I/O functions with the Picture File functions, which isn't generally done.  Can you perhaps attach a simple VI demonstrating the problem so we can more easily diagnose it?

-D

0 Kudos
Message 2 of 6
(2,753 Views)
Are you aware that png is an image format (at least, as far as LabVIEW is concerned)? Unless the data is actually an image, you should use text files instead.
www.vartortech.com
0 Kudos
Message 3 of 6
(2,751 Views)
Hy, i attached an example of the problem. The example shows the coding of a simple text into png, I need this for comprassion of data, it was a easy way to reduce a 40MB file to a 2 MB file :-).

OK, the VI creates a file und then writes the data into the file, after this is done, you can read out the data to wrote in. By cloesing the VI the logfile should be closed, but it doesn't work, as you will see.

I use LabVIEW 7.0.

Thanks for your help.

Regards

Alessandro
0 Kudos
Message 4 of 6
(2,738 Views)
You don't need to create the file. Write PNG File will do it for you. Actually you are disturbing its work.

P.S. Maybe it's better to use pastel colours?Smiley Happy

Ciao

Paolo
Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 5 of 6
(2,731 Views)
Hello Paolo

Your'ar right, I really don't need both, creating a file with some standard VIs and then creating the same file with write png file.

Now it works, thanks.

Accttualy it wasn't so difficult, but you know, sometimes you waist time in such thing and finaly it was easy to solve the problem only by talking about.

OK, thanks and by

Alessandro
0 Kudos
Message 6 of 6
(2,726 Views)