LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to stop a VI in a subpanel (the best way)

Solved!
Go to solution

Hi,

I'm trying to figure out the best way to stop a VI, in a subpanel, which normally uses "Window: close" for stopping.

I have tried the following methods (just for testing):

Case 2.PNG

This works, but its not a good way to stop a VI.

 

Case 1.PNG

This also works, but then a "Stop" button must be added to the "TestVI" as an alternativ to the "Window: close" event.

 

Case 3.PNG

This does not work, but I wish it did (as it would trigger the "Window: close" event)😅

 

So, what would be the best approach, in this case, for stopping the VI (in a subpanel)? 🤔

(PS: If the last alternativ with "Close window" can work, if wired differently, please let me know😁)

________________________________________________
"Science is about knowing, while engineering is about doing"
0 Kudos
Message 1 of 2
(1,193 Views)
Solution
Accepted by topic author S.Stock

I recommend you explore the option of using User Events. I usually rely on those when I asynchronous VIs I need to stop from a caller GVI, and still want to be able to test them separately.

 

This is how the caller looks like:

Caller.png

 

 

This is what the called looks like: 

 

Callee.png

 

 

 

Disclaimer: I prefer using the function Start Asynchronous Call and passing the user even through the connector pane. However, this functionality has a bug up to version 5.0, hence my approach of using a Set Control Value and Run VI functions combination.

 

All the best!

Message 2 of 2
(1,115 Views)