LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Cluster (radio buttons and string controls) -select proper file

Solved!
Go to solution

 

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?

0 Kudos
Message 1 of 5
(3,923 Views)

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.

0 Kudos
Message 2 of 5
(3,907 Views)

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? 

0 Kudos
Message 3 of 5
(3,899 Views)
Solution
Accepted by frn

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.

 

 

Message 4 of 5
(3,884 Views)

Great! Thanks Don_Phillips

 

I wonder if it will not be too difficult to duplicate without event structure?

 

0 Kudos
Message 5 of 5
(3,879 Views)