LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to populate an array from a specified list of possible entries?

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!

0 Kudos
Message 1 of 8
(3,176 Views)

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..

-----

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

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...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 8
(3,164 Views)

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

Antoine Chalons

Message 4 of 8
(3,161 Views)

 


@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

Antoine Chalons

0 Kudos
Message 5 of 8
(3,154 Views)

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?

0 Kudos
Message 6 of 8
(3,130 Views)

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

Antoine Chalons

0 Kudos
Message 7 of 8
(3,110 Views)

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

Antoine Chalons

Message 8 of 8
(3,103 Views)