From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Write PNG File VI won't overwrite existing file

Solved!
Go to solution

Hi All,

I am using Write PNG File VI to store the graph to a png file. I am able to save the file with a given file name which includes date, model number, serial number etc. After the graph is saved as a png file, if I make changes in the graph (like autoscale, turning on and off legends etc.) and try to save the file again with the same file name, Write PNG File VI does not seem to save the changes I made on the graph. I am looking at the time stamp on windows explorer but it is not getting updated. I opened the VI itself (which is write protected) to see if it generates any error if I provide the same file name, but it does not generate any error.

I am not sure if I am missing anything.

Can you folks please help me to figure out a way to overwrite existing .png file ?

I am using LabVIEW 2013 on Win 7 machine.

p.s. I am using second method mentioned in this article:

http://digital.ni.com/public.nsf/allkb/5AE4ADCBB65A6D8F86256FBF007A1AC1

(Programmatically with the Get Image Method).

Thanks for your help

OPR

0 Kudos
Message 1 of 6
(3,383 Views)

Are you getting any error message on the error wire?

 

Do you have that file open in any other application?

 

Write to PNG overwrites files just fine for me.

0 Kudos
Message 2 of 6
(3,380 Views)
Solution
Accepted by topic author Opr

@Opr wrote:
...Write PNG File VI does not seem to save the changes I made on the graph. I am looking at the time stamp on windows explorer but it is not getting updated.

Are you also looking at the image itself? Windows Explorer might not update the timestamp in the display immediately or you might be looking at the creation time, which doesn't seem to change when you overwrite a file.

 

I can say that I saw a very similar question recently (it was also about PNG, although that's not really relevant), and there it definitely does overwrite - http://forums.ni.com/t5/LabVIEW/LAVA-snippet-overwrite-keeps-old-date-time-of-png-file/m-p/3257059#M...


___________________
Try to take over the world!
0 Kudos
Message 3 of 6
(3,369 Views)

Can you upload your code please? (Or a small piece that illustrates the problem)

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

@Opr wrote:

I am looking at the time stamp on windows explorer but it is not getting updated.


You might have to do a "right-click...refresh" in the explorer window to see the newest date.

Did you actually look at the picture to see if it correspnds to the newest version?

0 Kudos
Message 5 of 6
(3,350 Views)

Hi All,

Thanks all for taking time to reply to my post.

As tst mentioned, the file is actually getting updated with the changes but not the time stamp. (Even if I hit refresh).

Again thanks a lot!

Appreciate your help.

OPR

 

0 Kudos
Message 6 of 6
(3,339 Views)