Jump to content

Best way to start-stop a subpaneled VI?


Recommended Posts

When using subpaneled VI's the need always arises to send a message to it telling the subpaneled VI to stop execution. This apparently is not required when you run the "remove VI" method. Labview automaticaly aborts execution of the subpaneled vi. This might be a problem if you wan the subpaneled vi to exit gracefully.

I guess you could send a message via a queue mechanism but if you run the "remove VI" method after that, there is no way to know for sure if the subpaneld Vi has finished execution.

Any suggestions to perform synchronization? It would be nice to have the "remove VI" method contain a switch that you could set to have it "wait until vi completes".

Link to comment
When using subpaneled VI's the need always arises to send a message to it telling the subpaneled VI to stop execution. This apparently is not required when you run the "remove VI" method. Labview automaticaly aborts execution of the subpaneled vi. This might be a problem if you wan the subpaneled vi to exit gracefully.
I think that your assumption is wrong. The Remove VI method's documentation states:
Remove VI - Unloads the VI in the subpanel control. If no references to the VI remain, LabVIEW removes the VI from memory. If references to the VI remain and the VI stays in memory, this method does not change the state of the VI.

If you have an open reference to the VI it should keep running. It may be aborting because LabVIEW is unloading due to the fact that you don't have an open reference to the VI.

I guess you could send a message via a queue mechanism but if you run the "remove VI" method after that, there is no way to know for sure if the subpaneld Vi has finished execution.
Use a "Message Queue" which allows you to use "Response Notifiers" (visit the OpenG.org site to take a look at this project)
Any suggestions to perform synchronization? It would be nice to have the "remove VI" method contain a switch that you could set to have it "wait until vi completes".

Take a look at the other thread that I started here. There are lots of different ways to use subpanels and most will require some wrappers that implement the desired functionality. The wrappers have access to the VI reference so they can look at the VIs state, set/get control values of the VI, etc.

Link to comment

Remove VI - Unloads the VI in the subpanel control. If no references to the VI remain, LabVIEW removes the VI from memory. If references to the VI remain and the VI stays in memory, this method does not change the state of the VI.

Thanks Jim for pointing that out. There were other things going on in my project that was causing the VI to abort so It wasn't the remove panel method. That's what happens when you're debugging at 3am. :cry:

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.