LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using radio button to control while loop in subvi

I have a radio button in a while loop in a subvi and I would like to control it using the main vi.

 

I have looked at:

https://forums.ni.com/t5/Example-Code/Using-Control-References-to-Pass-Access-of-Front-Panel-Control...

https://forums.ni.com/t5/Archive-TKB/Using-Control-References-to-Update-Between-Top-Level-VI-and/ta-...

 

My radio button has two states, On and Off, which are indicated by a round led for each. I am having difficult comparing the value of the radio buttons property node to the state that I want. For example I want the while loop to end if Radio Button value is On. I tried using variant to data, but I either did it wrong, or that is not what I am supposed to do.

0 Kudos
Message 1 of 8
(4,436 Views)

do you mean this vi 

0 Kudos
Message 2 of 8
(4,412 Views)

Sort of except this is what it would look like to control it from the subvi. I want to be able to control it from the main vi.

0 Kudos
Message 3 of 8
(4,390 Views)

so you need this 

Download All
0 Kudos
Message 4 of 8
(4,364 Views)

So it will not work without making it an event?

0 Kudos
Message 5 of 8
(4,349 Views)
No I dont think so
0 Kudos
Message 6 of 8
(4,334 Views)

No you don't have to use an Event Structure to perform this task in the Subvi.

 

See the attached example.

 

If you get the "Radio Buttons" reference from the Subvi, you can directly control it from your Main vi.

 

steve

 

 

----------------------------------------------------------------------------------------------------------------
Founding (and only) member of AUITA - the Anti UI Thread Association.
----------------------------------------------------------------------------------------------------------------
Download All
Message 7 of 8
(4,317 Views)
oh your are right stevem
your code is really work nice
0 Kudos
Message 8 of 8
(4,303 Views)