LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

closing a .NET reference after stopping the program

Hi,

I am controlling an IDS camera using the .NET interface.

I am using an "Exit" action with an invoke node at the end of my program and then all is fine and the cameras are relesed.

The problem is that sometimes I have to press the "stop" button of Labview. I then can't open a new session to the camera (since it appears as “in use” by Labview). The reference to the camera is then not released until I close and reopen Labview.

any ideas how to release this camera before starting a new session to it?

Thanks

Amos

0 Kudos
Message 1 of 3
(3,362 Views)

@amose wrote:

Hi,

I am controlling an IDS camera using the .NET interface.

I am using an "Exit" action with an invoke node at the end of my program and then all is fine and the cameras are relesed.

The problem is that sometimes I have to press the "stop" button of Labview. I then can't open a new session to the camera (since it appears as “in use” by Labview). The reference to the camera is then not released until I close and reopen Labview.

any ideas how to release this camera before starting a new session to it?

Thanks

Amos


The "Stop" button is the abort button. A real application shouldn't use this button at all; you should build your own Stop button on the user Interface that will allow your application to properly clean up your references. In the settings for your UI VI you can also disable these buttons etc. so that the user cnnot press them by accident.

 

Other than re-booting the IDE there is no other mechanism to ensure this.

0 Kudos
Message 2 of 3
(3,358 Views)

I have a camera from a different company that uses a Windows service as a "middleman" to its .NET interface.  If I am communicating with that camera using LabVIEW and don't close the reference, I can restart the service and it works again without restarting LabVIEW.

 

Lots of devices don't use these services though.  You can check and see if yours does, but just in general if you have a "must close" reference you need to have a mechanism in your program where you can programatically close all of your references even if your main loop is locked up somehow.

0 Kudos
Message 3 of 3
(3,337 Views)