08-30-2011 09:13 PM
For the path input of the List Folder, as of right now I created a constant on the block diagram and specify the folder address ( Refer to my screenshot for the error question). If I create a control, when I run the VI, it will prompt me to select the folder which contain the png images but I can't select the folder and instead I must select one of the images in it and when I did that, it returned me an error. So what must I do to allow the VI to prompt the user to select the folder that contain any png images and it would then display all the png images in the folder on the picture indicator.
Thanks.
08-30-2011 10:04 PM
Please ignore the error post, the problem has been solved.
08-30-2011 10:40 PM
How do I configure it so that the files passed into the array would be the first file in the folder follow by the second, the third till the last file in the folder and not randomly?
08-30-2011 10:45 PM
How do you define what is the first file in the folder vs. the 2nd vs. the 3rd? It seemed to give me an array of filenames that were in alphabetical order.
08-30-2011 10:49 PM
I save the files in the folder as Graylevel 30, Graylevel 45 to Graylevel 255 so how do I configure it so that it will read the Graylevel 30 file first before the Graylevel 45 so on and so forth.
08-30-2011 10:57 PM
Unfortunately, what you want is numerical order which is not the same as alphabetical order.
If you cold rename your files as Graylevel 030, 045 and 255, then alphabetical order will be the same as numerical order.
If you can't name the files differently, then what you could do is go through your array of names and rename the strings there to add the extra digit. Then do a sort 1-D array to get the alphabetical order (and thus numerical order). Then go back through that array and make the strings go back to their original names.
08-30-2011 11:24 PM
Could you show me an example on how I could go through my array of names and rename the strings there to add the extra digit. Then do a sort 1-D array to get the alphabetical order (and thus numerical order). Then go back through that array and make the strings go back to their original names.
This is what I currently have.
Thanks 🙂
08-31-2011 02:02 AM - edited 08-31-2011 02:06 AM
Hi Fred,
it seems to me all you do is asking other people to do your own work...
fredteng wrote:This is what I currently have.
And you just present my snippet with the only extension by a path constant...
To change the filenames you have to parse the string into it's parts, change the parts and rebuild the string. Functions for that can be found in the string palette...
(Just an example, there are other possible ways. Just think of the GetFileExtension.vi...)