LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

radio button trouble when more than 2 selections

I have a VI that uses 9 radio buttons to select one of nine cases. Each case contains a subVI that essentially creates a dated filename to write varying GPIB data to. The first two selections (1 and 2) work as designed. I get a date-coded filename with each subsequent run of the Main VI. However, my problem lies in selections 3 - 9. Each of these also creates a corresponding filename, however 3 seconds after the initial run, I get a second unprompted filename. It appears that selections 3-9 run twice. One filename reflects the value left in the buffer from the previous selection and the other is new as expected. I have scoured my code for loops and there are none. I would have expected all selctions to perform alike but the first two are working to design. Any ideas?
 
Thanks in advance!
 
Phil
0 Kudos
Message 1 of 5
(3,110 Views)
Let me ask a couple of questions. Is this the radio button control introduced in LabVIEW 7.1, the "slide control" radio button in earlier versions, or something of your creation? You have no loops at all in your program and you run it once just by clicking the Run button on the toolbar? Frankly, I have never seen a case statement execute more than a single case and would like to see your VI.
0 Kudos
Message 2 of 5
(3,102 Views)
Your description dies not make a lot of sense. Do you have nine radio buttons or a single radio button with 9 choices? What exaclty happens 3 seconds after the initial run? Is the program still running at that time? Do you use dataflow or is the code chopped up and uses mostly local variables and value property nodes?
 
Could you strip out your VI to the essentials to demonstrate the problem., Remove all the GPIB and file IO so it just displays the resulting file name in a text indicator... Then attach it here. Thanks! 🙂
0 Kudos
Message 3 of 5
(3,097 Views)
Thanks to all, but I have found the solution myself!
 
To Clarify, I have Labview 8 with the Labview defined Radio Button Control.
 
I have chosen to use it with 9 selectable options (enum mode?). Also, the first two selections of the nine worked properly.
The third selection looped twice visibily and returned 2 results. The fourth thru ninth selections looped invisibly
but returned 2 results. Very Strange Indeed!
 
What I didn't realize was that the Radio Button cases have to be identical in EVERY WAY. That is,
that each case must contain all nine labels but only one applies to the case selected. I found this to be 
a very strange feature but it is what it is.
 
I have invoked the 'add case after' and 'add case before' features to fill in the missing values from each of the nine cases
and the problem was corrected.
 
Further clarification revealed that if I were to eliminate only one label from any of the nine cases the problem returned.
 
Thanks again to all who have responded.
 
Phil
0 Kudos
Message 4 of 5
(3,085 Views)
Your cases weren't looping. What you need to know about case structures in general, is that except for a case driven by a Boolean, you have to define a default case. This is to avoid errors if you pass a value that is not defined. It is the default case that is executed with an undefined value. It is not a strange behavior at all. With an enum like the radio button, all you have to do right click and select "Add Case for Every Value".
0 Kudos
Message 5 of 5
(3,080 Views)