LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Stop Plugin VI execution

Solved!
Go to solution

Hi Experts!

 

I'm wondering about an elegant solution for my problem. I have a top level VI that contains subpanel, in order to call plugin VI interfaces into. The plugin vi itself has own state machine (JKI Queued State Machine) and called by VI Server - Run VI method. 

As the plugin VI starts to run, the State machine While loop activated and the plugin VI can be closed if set the while loop condition value to True. There is no problem with that, but imagine a situation when the user wants to exit the application when both of VIs are running. (Plugin Interface and Top Level VI) The app. wont stops because the loop of the top level vi finishes execution only. 

 

I'm looking for an elegant solution for stopping plugin VI-s, without Closing them normally. There are many topcics about Opening Plugin VIs (Dinamic Calling) but none of Stopping them!

 

Thanks in advance!

---
+++ In God we believe, in Trance we Trust +++
[Hungary]
0 Kudos
Message 1 of 4
(2,406 Views)

 

This a simple architecture to communicate with all the Modules which runs independently,

 

All the modules Queue references will be stored in the Functional Global, if the particular module has to be stopped from the Main Module use the Queue reference of the module and Enque the appropriate states.

 

For example if the Plugin VI's has these two states "Close References" and "Exit", which will close all the references (if it invovling Instrument Communication) and exit the State Machine respectively. These two states will be Enqued from the Main Module using the Plugin VI Queue Reference 

 

 

 

AshwiN,

Message 2 of 4
(2,397 Views)
Solution
Accepted by topic author D60

All methods of cleanly stopping multiple top-level VIs revolve around using the standard message protocols for interprocess communication.  They also presume some sort of state machine or command handler in each of the top-level VIs.  There are two major categories - broadcast and point-to-point.

 

Broadcast methods send out a message from one sender to multiple receivers, usually without expecting a reply.  The best broadcast method is probably user-defined events, but notifiers are easier if you do not require that all messages be processed.

 

Point-to-point methods send out a message from one sender to one receiver.  These are often two way, call-response, message systems.  The best of these is the queue.

 

These methods and examples are shown in a mini-series I wrote awhile back on running top-level VIs.  You can find all the entries from the links on the last one.

 

All of this assumes yours top-level VIs are running on the same machine in the same process.  If you are running in different processes or on different machines, you will need to explore other protocols such as network streams, TCP/IP. or UDP to get your messages across.  However, I have never done this, so cannot coherently comment on it.

 

Message 3 of 4
(2,386 Views)

Thank you very much! 

---
+++ In God we believe, in Trance we Trust +++
[Hungary]
0 Kudos
Message 4 of 4
(2,377 Views)