LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Latch issue with passing by reference

I'm having an issue where I have a latch on my front panel. I'm passing the button by reference to by sub vi where it read and then write the value of bool.

To describe it better, if the button is pressed down, I want my sub VI is do something (long computation). After the computation is down, I want to button to pop back up so the user can click it again

The entire VI is running on parallel processes (multiple while loops). Labview of course won't let me pass the button as reference when it's acting like a latch, and I was wondering what should I do? If I replace the mechanical action with a switch, not all the user's action gets registered. How do I get around this? Thanks.
0 Kudos
Message 1 of 4
(2,744 Views)
Rather than passing the button itself to the subVI, use a notifier or queue to pass the value of the button to the subVI. Then you can continue to use the latched mechanical action. Queues and notifiers are intended for use in situations like this and do not tie the subVI to the UI of the main VI.

Lynn
0 Kudos
Message 2 of 4
(2,740 Views)
you could also use a switch when released, and pass a control reference to reset it when the operation is complete.  if it's as long as you say, the inefficiency won't matter a bit.
0 Kudos
Message 3 of 4
(2,731 Views)
ahh that switch when released works perfectly. Thanks!
0 Kudos
Message 4 of 4
(2,728 Views)