03-24-2016 10:00 AM
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
Solved! Go to Solution.
03-24-2016 10:06 AM
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.
03-24-2016 10:29 AM
@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...
03-24-2016 10:29 AM
Can you upload your code please? (Or a small piece that illustrates the problem)
03-24-2016 10:41 AM
@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?
03-24-2016 10:57 AM
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