LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing instruments after VI closes improperly

Hello,

 

I have two instruments (New Focus picomotor and an Allied Vision camera although I suspect this is a general issue) that work unless the last time the VI was run was aborted.  This happens frequently while I am debugging.  Then I get an error like "Invalid camera session." I suspect that this is because the camera is still open somewhere and so is inaccessible to the current VI. Is there a way to close instruments even if the LabView program doesn't recognize it? Right now I have to restart my computer to get LabView to recognize my instruments

 

There are probably many great resources on this, but I don't know the terminology to find it.

 

Thanks

0 Kudos
Message 1 of 6
(1,053 Views)

The first rule any experienced LabVIEW user will swear by - never abort a VI

 

It is like crashing the car into a tree to stop it and then you want it to start up and work normally??

Santhosh
Soliton Technologies

New to the forum? Please read community guidelines and how to ask smart questions

Only two ways to appreciate someone who spent their free time to reply/answer your question - give them Kudos or mark their reply as the answer/solution.

Finding it hard to source NI hardware? Try NI Trading Post
Message 2 of 6
(1,050 Views)

For DAQmx and VISA issues, I typically just need to restart LabVIEW, not necessarily the whole computer.

 

Otherwise, it is pretty much impossible to get old references in order to close them unless, perhaps, they are saved in a global variable (actual Global Variable or a Functional Global Variable/Action Engine).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 6
(1,039 Views)

 

runtime 

use this to get open sessions, close in a FOR loop, clearing errors

C:\Program Files (x86)\National Instruments\LabVIEW 2019\vi.lib\Utility\visa.llb\Open Sessions.vi

 

 

interactive mode

open the VISA CLOSE.vi, select any available sessions and just run that until you start getting errors. then open the next session in the list and repeat until all are closed

 

good luck!

Sr Test Engineer at American Innovations - LabVIEW CLA - Kudo's are appreciated!!
Message 4 of 6
(956 Views)

@mwatkins wrote:

interactive mode

open the VISA CLOSE.vi, select any available sessions and just run that until you start getting errors. then open the next session in the list and repeat until all are closed


I think you meant to point to the Open VISA Session Monitor.vi in the same llb as the other VI you mentioned.  That is a tool I did not know about that can really come in handy when I mess up during driver development.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 6
(927 Views)

Hi @mwatckins,

 

Thanks for responding.  When I run the Open Sessions.vi and the corresponding Open VISA Session Monitor, they both come up blank even if I purposely have other sessions running.  After some digging, I have also tried using the VISA Close function where I directly feed it the known VISA resource name, but that also had no effect.

0 Kudos
Message 6 of 6
(916 Views)