LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Opening a subvi in a new window using latching Boolean control

Solved!
Go to solution

Hello, please see the attached code. I'm trying to do the following: when user presses a button data1, a new window pups up with corresponding data, data2 opens up windows with second set of data, etc. I've achieved this but making my subvi reentrant, but I don't want to display three sets of data if user presses data1, then data2, and then data3, I only want to display one at a time. If I set my subvi to non-reentrant, no matter what user presses, the subvi gets the last set of data. 

Is there a way to change my code so that only one instance of subvi can be ran with corresponding data? Thanks

edit: there's one way I could accomplish what I want with having compound OR gate to each case selector with FP.Close controlled by the Boolean buttons, but the amount wires that would involve is not acceptable (shown in picture below)

Screenshot 2023-12-05 110713.png

 

0 Kudos
Message 1 of 6
(1,197 Views)

I suggest you look at using "Radio Buttons" instead of three separate Boolean controls.

 

Radio buttons have the option of only allowing one button to be "pressed" at a time..

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 6
(1,146 Views)

Using Radio Buttons wouldn't really work, I want latching action, but it can only do switching action. IF user presses the middle radio button, then closes subvi, and then wants to press the same button again to reopen the same subvi, they won't be able to easily do that, they'd have to switch back and forth. I want my code to be copyable, with Radio Buttons I'd have to drag that enum to ALL of my inputs, not a good solution.

0 Kudos
Message 3 of 6
(1,140 Views)

Please explain why you have such a crazy wiring layout.

Clean it up and I'll take another look.

0 Kudos
Message 4 of 6
(1,124 Views)

So you have three processes running in parallel and while all do some processing, you only want to show one of the front panels.

 

Your things where SubVIs provide their own reference to the caller is somewhat of a "tail-wagging-the-dog" kind of thing. But OK, Here's one possible solution. See if you understand it. Many things could be improved, of course.

 

altenbach_0-1701828105274.png

 

And no, this is probably not something I would consider doing in any kind of serious application.

 

0 Kudos
Message 5 of 6
(1,106 Views)
Solution
Accepted by topic author John32d

This is the solution I came up with. It works for my application. Thanks

0 Kudos
Message 6 of 6
(1,071 Views)