05-15-2013 12:53 PM - edited 05-15-2013 12:55 PM
I have a list of text files and I need to select and open one of them based of radio button selection. How do I synchronize radio button with string control so that I can get the name in the string control and open the proper filename?
The attached vi is not working as I would like to.
Edit: Or is there a better way?
Solved! Go to Solution.
05-15-2013 01:56 PM
I am not completely grasping what you are trying to do. Perhaps though I am confusing myself...
My thought process:
You have some files which will be in string controls. As they choose a radio button the proper string control with file name will be used to open said file?
I guess I am not seeing the use case for all these UI elements.
If you have a bunch of related strings (like file names) you can use a list control. If you have a list control you no longer need the radio buttons -- I.E., you can double click the list element to select.
If you want to use radio buttons you can but you would need a while loop and an event structure with the proper logic.
05-15-2013 02:08 PM
Thanks Don_Phillips,
"You have some files which will be in string controls. As they choose a radio button the proper string control with file name will be used to open said file?" Yes. You are absolutaly right about your asumption.
And the reason for this approach is to add more files in the future without recompiling the labview application. Is there a simpler way?
05-15-2013 02:43 PM
Depends on where the file list comes from. If you embed it in LabVIEW via an array, or other method, then obviously a recompile would need to be performed.
If the file list will come from a specific directory then simply read the file list from there when starting the VI (see example).
Or you could store the list in text file and read the file when starting the VI. You could change the text file anytime without a recompile.
05-15-2013 03:22 PM
Great! Thanks Don_Phillips
I wonder if it will not be too difficult to duplicate without event structure?