LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

finding and closing open VIs

Solved!
Go to solution

Hello,

 

I have a VI cloner which i am currently working on and have run into a small problem. If you have any VIs loaded into memory which share the same name as any in the hierarchy you are trying to clone i get reference issues.

 

i know the simple solution to this is to make sure that the cloner is the only VI open however is there anyway of checking as a verification step to make sure that it is the only VI open? If so is it possible to automaticaly close other VIs which are open?

 

thanks in advance

0 Kudos
Message 1 of 5
(3,534 Views)

After 20 minutes of posting the original post i found a method called All VIs In Memory within the application class. It returns a list of VI names which are currently loaded into memory.

 

I have not figured out how to close these however i have made a small verification step that checks to see if any of the VIs that are currently in memory have the same name as any of the VIs which are about to be cloned which allows me to post a message alerting the user that there could be a potential conflict.

 

I acheived the list of VI names that will be cloned through the method Get VI Dependencies within the VI class. I then filtered out any VIs which were not in the same project directory (to exclude labview VIs stored in program files ect) then used the 1D search function to find if the names were contained in the currently loaded names array.

 

Unfortunatly i am unable to post the code from work.

 

Now that i have a list of VIs which are open is there any way of automaticaly closing them?

 

thanks,

0 Kudos
Message 2 of 5
(3,500 Views)

close all.png

"If you weren't supposed to push it, it wouldn't be a button."
Message 3 of 5
(3,472 Views)
Solution
Accepted by topic author carbon32

I did something similar (again because of "mis-behaving clones").  The additional checks are to allow this to be called, but not kill itself or its caller(s).  It returns some counts.

Abort All.png

Bob Schor

Message 4 of 5
(3,455 Views)

Thank you for posting that, its a much neater way of closing everything except the current VI and its callers than what i had.

 

thank you for the help

0 Kudos
Message 5 of 5
(3,412 Views)