Showing results for 
Search instead for 
Did you mean: 

Darren's Occasional Nugget 08/11/2008

Hi all,

For those of you who attended NI Week 2008 last week, I hope you all had a great time!  During my presentation on Thursday, I offhandedly mentioned a VI I wrote, and everybody in the room said they wanted it, so here it is.  Place this VI somewhere on disk where you'll remember you have it.  If you ever get in a situation where you have a modal VI that is running, and is in a state where you can't abort it, this VI should come in handy.  Navigate to this VI (attached below) in your file system and double-click on it.  The VI will launch (and will appear on top of your other modal VI), and you can select the offending modal VI in the ring and abort it:

Prior to writing this VI, I always had to resort to killing the LabVIEW.exe process and starting over...a massive headache if I had a bunch of VIs and probes open while debugging.  Anyway, I hope this VI comes in handy for some of you.  It works in LabVIEW 8.0 and later.  Unfortunately, since I'm using some private functionality to get information about VIs in memory, this VI is password-protected.


P.S. - Check out past nuggets here.

Message Edited by Darren on 08-11-2008 02:46 PM
Download All
Message 1 of 34
Hi darren,
                 YEs this will defenitely be handy.Can you share as to how you have done that?
0 Kudos
Message 2 of 34
Thanks! I don't know how many times I had to terminate LabVIEW.exe because of this annoying feature... This helps a lot!


Message 3 of 34
Thanks Darren for a very useful program.
It may not be helpful in a situation where there is a popup message that occurs in a loop, so every iteration of the loop causes another popup.  The interaction with the popup will prevent the operator from being able to select which VI to terminate.  Even when clicking on the popup message with the hope of "jumping" to the VI selection screen.
Is there a tweek that could be done to compensate for that situation?  
An example of such a situation is to have a 2D array (not transposed) that is wired to a Waveform Graph, where every iteration of the loop you get a popup message saying that there is "Not Enough Memory ... "
Message 4 of 34

I always use the AllVIsInMemory property, and it works just fine. Do you use
scripting to get the VI's from other contexts as well?



0 Kudos
Message 5 of 34

Thanks Darren.

But let me confess. These "secret" nuggets (password protected) are a little frustrating since all I can do is post winks and nods about how you did it. Smiley Mad

Or should I just toss caution to the wind and and post what I know. Smiley Surprised

Until the day when LabVIEW Scripting is opened-up supported and documented,

"I know nothing!"  Sergent Shultz, Hogan's Heroes


Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 34

I posted code a quick example for how to do this here (7.0). In that case, I built the VI into an executable and enabled VI server access on LabVIEW, so that I don't have the problem JLV mentioned with modal dialogs. To be honest, that quick example isn't exactly polished, but I left the EXE on my PC and I still use it occasionally when this happens to me. Just be sure to enable VI server access, or this won't work.

I never checked how this works in 8.x, with the multiple instances, but I expect that it should still work.

Try to take over the world!
Message 7 of 34
thanks Darren, and thanks for a good sesson last thursday Smiley Happy

0 Kudos
Message 8 of 34
Ok, here's what the diagram looks like:

Off to the left of the diagram (not shown) is the private functionality I was talking about.  Basically, I have to get all the Application Instances where you might have VIs running...unfortunately, I don't think there's a way to do this without private VI Server properties.  Anyway, once I have all the Application Instances, I iterate over each of them and get the All VIs in Memory property.  I remove the "Abort" from the list, in case it's running in one of these Application Instances.  Then, I open each VI Reference (with option '2' so that I open template VIs themselves instead of instances of them), and I check the Execution State of each VI.  If any VI is "Run top level", then I add its reference to an array.  Once I have done this for every Application Instance, I put the names of those VIs in the ring and let you choose which one you want to abort.

I hope this helps,

Message Edited by Darren on 08-12-2008 11:08 AM
Message 9 of 34

tst wrote:

I never checked how this works in 8.x, with the multiple instances, but I expect that it should still work.

I've been using a slightly modified version of your VI since you posted it.  It also works with LV8.x.  The one I use does not look for which one is running, it simply stops execution for any opened VI.  Thus, as you mentionned, it works for modal dialogs like the example I provided.
Thanks tsts. 
Message 10 of 34