LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to have mutually exclusive dialog radio buttons?


@gosenbach wrote:

I ran across this thread trying to recall how to do this.  I thought I would post this simple solution for anyone else looking to do this.



Fortunately, nobody will ever need to do that ever again, because (as mentioed by others already) we now have the radiobutton control. 😄

(A radiobutton control even works if the VI is in edit mode).

 

Some comments:

 

  • The shift register does not seem to have any useful function. Your code works exactly the same without it. In fact the value of the shift register is never used anywhere.
  • You forgot to initialize the cluster to a legal value when the program starts. Starting the program from the default state (no selection) or with multiple selections show an illegal control state until the first selection is made.
  • It is significantly more efficient to use a local variable instead of a value property node. Why did you make that odd choice?
0 Kudos
Message 31 of 33
(596 Views)

Hi Altenbach,

95% of the time I would agree with that 🙂

 

In this case though, I was working on a test select dialog where the user checks the tests they want to run in teststand and only some of them are mutually exclusive.  I did not want to mix just a couple of radios in will all the checkboxes.  Mainly because I thought keeping it all the same style checkboxes would be nicer to look at from a UI perspecitive.

 

Gregory Osenbach, CLA

Fluke

Gregory Osenbach, CLA
Fluke
0 Kudos
Message 32 of 33
(573 Views)

Yes, if you need a custom logic, it is probably best to implement it as an x-control (using similar code in the facade vi) so it also works correctly while in edit mode.

 

(Example: Long ago, I made one that always retains the last two selected buttons, ;))

 

In any case, my suggestions about code improvements still apply. 😉

0 Kudos
Message 33 of 33
(567 Views)