LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

graceful abort -- emulate "close panel ?"

Solved!
Go to solution

Hi

 

I need a way to close a VI, that was started from a VI server "runVI" in a way, that the running vi can catch the request to stop.

 

Background is a set of plugin vis that get alternatly opened in a sub panel.

Whenever I a open another one I want the previous one to stop running.

 

Yes, I have the reference, so I could run the method Abort, or I could ask the user to click a button for self termination, or I could send a notification or may be something else.

 

What I really would like to do is generate a "close panel ?"-event, discard the close , do some housekeeping and then stop running.

 

Any good idea ? (LV2013)

 

Gabi

7.1 -- 2013
CLA
0 Kudos
Message 1 of 5
(2,973 Views)

I'm a little hesitant to suggest User Events to a CLA, but...

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 5
(2,960 Views)
Solution
Accepted by topic author GabbyG

Main VI creates the user event and launches the target:

Main.png

 

The target VI waits for, then handles the event:

Target.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 3 of 5
(2,956 Views)

Thanks, Jim for your reply and elaboration.

 

Sure, this is a way to do it.

I'll have very many different VIs to start and I was looking for way to incorporate into my Sub-Panel-Class a "close"-method, that would work without too much knowledge about the loaded vi.

 

But it seems there is no easy way.

 

Since I'll need a way get data in and out anyway, I'll probably set up a queue scheme (QMH or similar) that could handle an EXIT.

 

Thanks again

Gabi

 

 

 

 

7.1 -- 2013
CLA
Message 4 of 5
(2,917 Views)

@GabiTillmann wrote:

[...] without too much knowledge about the loaded vi. [...]


 

I believe that the Actor Framework was designed to do this.  I get the impression that the main VI would send a generic Shutdown message to its child actor(s) without caring how it is handled.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 5 of 5
(2,901 Views)