Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

imaqWriteFile

Solved!
Go to solution

I am using CVI 2015 SP1 and Vision Acquisition version May 2017.  When I use 

 

error = imaqWriteFile (image, "Combo_myfile_01.tif", NULL);

 

to save an image, a valid image is written to disk.  If I call this function again with the same file name and the file already exists, the file creation date does not change in the file browser.  

Note that I have already set default drive and directory using SetDrive() and SetDir().

Is this normal behavior?  Can I change this behavior so I can overwrite a file?  Do I need to make a system call to delete previous file before saving new file with same name?

thanks, Ron

0 Kudos
Message 1 of 4
(3,539 Views)

Hello Ron,

 

Did you by chance check the actual image that is saved to verify that it is indeed the "newest" image? I'm curious to see if the image save procedure is somehow navigating around the windows file explorer functionality. It could be possible that he Vision Software is saving an image with the same name, but Windows doesn't see a difference and keeps the date the same as it was previously. Is this something you can double check? This will help us understand if the behavior is restricted to the "creation date" or if it expands out to the actual image itself not being saved properly. 

 

Is it also possible that on the second attempt an error is being thrown by the function that we are not seeing due to not having the error handling wrapper around the function itself? If an error is being thrown, we might not be successfully updating the image at all meaning the date will stay the same as it was previously because a new image wasn't saved (because of the error). 

 

Let me know your thoughts!

 

John H.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 4
(3,495 Views)

 I was able to verify that a new file is actually written by writing different image content to the same filename.

After some investigation, I found that the problem I was having may be related to the following known bug in Windows 7

https://social.technet.microsoft.com/Forums/windows/en-US/47895404-7329-4922-82f7-e262f62b9799/windo...

At this point, I see no problem with writing image files to disk

0 Kudos
Message 3 of 4
(3,489 Views)
Solution
Accepted by topic author rbm1024

Hello rbm1024,

 

Thanks for the follow up! I'll assume that this works for your system for now. If you have any follow up questions, please post them here or in a new forum post if it is a new question.

 

Have a great weekend!

John H.
Applications Engineering
National Instruments
Message 4 of 4
(3,480 Views)