LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Most elegant way to accept a variable number of files?

I am writing a program where I would like to accept a variable number of files to process. In my inexperience with LabVIEW I can think of several ways to do this, which aren't as user friendly as I'd like it to be.

I tried an array of file path controls. This will be the easiest to implement, but what I don't like is that you can't really see all the files you've inputted at once and if you select a file and want to erase it, it will query you for a file.

I tried a while loop with an empty file path to my Read Characters from File.vi, but I would like it so that the user can just specify which files they'd like to load without having to wait inbetween. Also, as I mentioned before, I would prefer it if the use
r could see which files they've decided to load and have the option of taking a file out if they should so choose.

I could try just fixing the number of files and have like 5 or so file path controls and do it like that. That seems like it would be clumsy and obviously has the problem of not being variable.

I'm just wondering if there is something that I haven't thought of, or if I have and which avenue would be the best. I feel fine about using an array of file path indicators, but wonder how I can remove indicies that are empty.
0 Kudos
Message 1 of 7
(2,827 Views)
can you use a list box, table or tree control to display your file names etc....

Dan
0 Kudos
Message 2 of 7
(2,827 Views)
Dave

here is a quick example.... it needs work but you'll get the idea..

good luck

Dan
0 Kudos
Message 3 of 7
(2,827 Views)
I'm not quite sure what is going on. When I looked at the block diagram, the Listbox is unwired and when I run it, nothing happens.
0 Kudos
Message 4 of 7
(2,827 Views)
the lsit box doesnt need to be wired , but , do you have a temp directory ?? (c:\temp) if not create the dir and try it again
0 Kudos
Message 5 of 7
(2,827 Views)
Dan, use the special path constant called "Temporary Directory".

Another problem is the fact that you hardwire the path as a string ("c:\temp\...") instead of a path constant. This will make the code useless on any platform except windows.
0 Kudos
Message 6 of 7
(2,827 Views)
Yeah , your right, i only use windows so i forget about that kind of stuff... i'll have to keep that in mind though...

thanks

Dan
0 Kudos
Message 7 of 7
(2,827 Views)