LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Close Database/Resource

Solved!
Go to solution

This is very specific. I'm opening up the database of an MSI, but can't edit the file untill labVIEW stops.

 

I've tried different strategies such as using an invoke node to close, or just simply the close reference, and neither works.

 

Is it obvious to anyone what I'm doing wrong? 

 

error.jpg

0 Kudos
Message 1 of 4
(2,628 Views)

Make sure you close reference wires in the reverse order that you opened them.  Right now you have a race between when the close reference function runs and the close method ont he View oject runs.  Also the reference wire from the OpenDatabase method never gets closed.

 

If you close wires in the wrong order, you may be leaving a reference open (do you get any error messages?) and that reference may be getting hung up until LabVIEW's garbage collection runs.

0 Kudos
Message 2 of 4
(2,624 Views)

There's more than just the OpenDatabase reference you are not properly handling.

 

You need to close the references of:

  1. Record (from the Fetch) - this needs to be done inside the while loop.
  2. View (from Open View) - using the close method does not close the reference.
  3. Database (from OpenDatabase)
  4. Installer (you're already doing this)

As Raven's fan mentioned, you may have an issue if you do not close references in the proper order.  I have never run into this personally, but you most definitely have an issue with trying to run the Close method on the view while you are trying to Close the view.

 

I am not familiar with the MSI methods and properties,  but is there a Close method for the Database (similar to the Close method for the View)?  Your code opens the database, but never closes it.

0 Kudos
Message 3 of 4
(2,612 Views)
Solution
Accepted by topic author Nyne

Thanks a bunch, it makes sense what you guys mentioned. I'll try to implement it.

 

Thanks!

 

Nyne 

0 Kudos
Message 4 of 4
(2,609 Views)