08-21-2012 01:09 AM
Hi,
I'm trying to add a feature to a program of mine to save multiple images with a single click, however I get these ridiculous errors saying "file not found" from the "Open/Create/Replace File" function, which is set to create. Of course the file is not found, I'm trying to create it!
Can someone look at my code and tell me what's wrong? Thanks!
Solved! Go to Solution.
08-21-2012 01:19 AM
Can you convert the vi to 2009 version and post am curious to see the 2 MB code
08-21-2012 01:24 AM
Ok, I saved it for as early a version as I could:
08-21-2012 02:28 AM
try this 🙂
08-21-2012 07:20 PM
Hi lzynier,
Could you save that as version 10.0? Thanks.
08-21-2012 08:01 PM
Hey MOI maker,
I took a look at your VI, and it looks to me like the problem is that in the File Dialog Express VI, you're choosing a location to save the files, but that location is never created. So if I want to save my images in TestFolder, it looks like your intended functionality is for the images to be saved in a subfolder titled "Images" (or whatever the user enters as a name in the File Dialog box) so that the end result is the images being saved to TestFolder/Images.
If this is the case, you simply need to add a Create Folder function node to your block diagram (Look in Programming > File I/O > Adv File I/O for that). You can directly wire the Selected Path output of the File Dialog to the Create Folder node's path input. I'd recommend placing that node in line with your existing code to ensure that the folder creation finishes before you try to save the files to that location.
If, instead, you're wanting the user to choose an existing folder and save the images directly into that, you just need to have the user click the "Current Folder" button in the File Dialog box, rather than entering a new name and clicking Save.
I hope that helps, and let us know if you have further questions.
08-21-2012 08:07 PM
Yes, the main problem is that you select a new folder, but then don't actually create it. 😉
On a related note, I am wondering why all these VIs are 2+MB and 4+MB, resp.. Seems such a waste of bandwidth. If I save them in LabVIEW 2012, they shrink to 60kB ( or less than 2% of the size). Where is all that data hiding???
(I don't have vision installed, though)
08-22-2012 12:24 AM
10.0 version
08-22-2012 01:06 AM - edited 08-22-2012 01:07 AM
Thanks everyone, turns out Daniel-E was right, I did just need to create the folder before trying to save images there.
Also lzynier had a good idea adding a for loop in there, so I can scale this to save a bunch of other data as well.
As for why this is so large, I think it's that the VI includes a default image for each of the four images, and the last images I was using were pretty big.