12-14-2010 03:54 AM
Hello everyone,
What I would like to do, is to populate an array of strings, but the possible entries should be just the file names of a specific folder.
The contents of the specific folder should appear at the front panel and the user should be able to add, remove and substitute entries while the vi is running, perhaps by using an add/remove button.
Is this possible with Labview and do you have any idea of how i could implement it?I'm using Labview 2010.
Thank you very much!
12-14-2010 04:06 AM
Yes its possible and can be easily done using LabVIEW... Use the List folder.vi to list out the Files and the folder names in a specified path... Then do the operation accordingly..
12-14-2010 04:09 AM
Hi panagiov,
"Is this possible with Labview and do you have any idea of how i could implement it?"
Yes and yes...
Ideas:
- use ListFolderContents to get all the files in a folder
- use a Listbox to display all the file names
- allow multiple selection and let user pick several files
- get the selected files by their index and do your processing on them...
12-14-2010 04:17 AM
Hello,
How about using a listbox with glyph?
1. select the folder
2. populate the listbox with files in the selected folder
3. set "unchecked" glyph for all the items (files)
4. when double clic on an item, chnage the corresponding glyph to "checked"
5. when selection is done, clic ok
6. then filtre the array depending on the glyph
See attached example in LV 8.6
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
12-14-2010 04:21 AM
@GerdW wrote:
- allow multiple selection and let user pick several files
- get the selected files by their index and do your processing on them...
That's a possibility too. depending on WHO is going to use the software it might be better to use glyphs + "clic to select" paradygm. If users are not computer geeks, trying to teach them to use the "ctrl" key to multiple-select can be difficult (just my experience in the industry ;))
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
12-14-2010 06:36 AM
Thank you very much for all your suggestions!
They are really helpful!
One more question: Is it possible to somehow select twice or more times the same element from the listbox and place it to specific positions in the array, while the vi is running?
12-14-2010 08:18 AM
Hmmm... I think no.
To do that you would need to modify the example I posted this way :
- add a second listbox
- when you double clic on an item add this item in the second lisbox
Maybe you will also need a way to remove items from the second listbox for if you made a mistake while selecting.
Is this clear enough for you to make that modification?
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
12-14-2010 08:31 AM
Here's a quick shout, and in fact it's even simpler than the previous example because it doesn't use the glyphs.
Hope this helps
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus