From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I want to a list or drop down menu that will load all the files in the Distraction folder and displayed the contains of file in the front panel

Solved!
Go to solution

I have a folder (Distraction) that contains several excel files. Each excel file contains a text column and a time column.
I want to:
1. A list or drop down menu that will load all the files in the Distraction folder. And so the user can choose the file he needs.
2. When the user chooses the file, the text and time in the file should be displayed on my front panel.
Is this possible on Labview?
Can you show me how to do it please?

Thanks you

 

0 Kudos
Message 1 of 9
(970 Views)
Solution
Accepted by topic author Ngouda

Hi Ngouda,

 


@Ngouda wrote:

1. A list or drop down menu that will load all the files in the Distraction folder. And so the user can choose the file he needs.
2. When the user chooses the file, the text and time in the file should be displayed on my front panel.
Is this possible on Labview?


Yes, that's possible!

  1. Use a ListFolder function to get all filenames for the folder. Show those filenames in a listbox.
  2. Upon ValueChange event of the listbox ("user selected an item") you can load the file and display its data…
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 9
(961 Views)
Solution
Accepted by topic author Ngouda

Here's how to add the list to the control. Then just use the value to index into an array of file names to create the path to be read.

 

altenbach_1-1679393232087.png

 

 

See how far you get. Not sure about your program and what e.g. the start/stop button is supposed to d etc.

0 Kudos
Message 3 of 9
(959 Views)

Hi Dear @altenbach,
Yes you are right, I changed my program a bit and it works now.
I still have to read the values with the indexes as you told me.
Thank you very much 🙂

0 Kudos
Message 4 of 9
(944 Views)

Dear GerdW,

I'm going to test this method too (2) to display the values on the front anel.
Thanks a lot to both of you:)

0 Kudos
Message 5 of 9
(937 Views)

Hi guys,

I'm coming back to you, I really tried a lot of things but it doesn't work

How to upload the file when the user has selected a file please?
0 Kudos
Message 6 of 9
(886 Views)
Solution
Accepted by topic author Ngouda
  • First of all, don't end any of your files with MODCA. This is reserved for VIs modified by me personally.
  • You cannot use "read delimited spreadsheet" for excel files (a proprietary Microsoft format!). You need to use the office toolkit (you figure it out. If you don't have office, this might help, read the entire thread). Much easier would be to export the files in excel as tab delimited text and read that using read delimited spreadsheet
  • There is no need to maximize the diagram to the screen.

 

altenbach_0-1679423846709.png

 

Message 7 of 9
(874 Views)

Hi dear @altenbach,

I like your MODCA but okay I won't pick you anymore 🙂
I thank you very much for your help and yes I will read the whole thread.
Thanks again for taking your time to help me.
Have a nice day 🙂

0 Kudos
Message 8 of 9
(808 Views)

No problem! Good luck with your programming and come back if you have another question!

Message 9 of 9
(797 Views)