LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Save multiple images with one dialogue box

Solved!
Go to solution

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!

0 Kudos
Message 1 of 9
(3,473 Views)

Can you convert the vi to 2009 version and post am curious to see the 2 MB code

 

-----

The best solution is the one you find it by yourself
0 Kudos
Message 2 of 9
(3,471 Views)

Ok, I saved it for as early a version as I could:

0 Kudos
Message 3 of 9
(3,467 Views)
0 Kudos
Message 4 of 9
(3,460 Views)

Hi lzynier,

 

Could you save that as version 10.0? Thanks.

0 Kudos
Message 5 of 9
(3,439 Views)
Solution
Accepted by topic author MOI_maker

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.

Message 6 of 9
(3,434 Views)

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)

0 Kudos
Message 7 of 9
(3,433 Views)
Message 8 of 9
(3,418 Views)

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.

0 Kudos
Message 9 of 9
(3,413 Views)