Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Close all currently opened VISA sessions

Hi all,

I have a C# application that opens/closes VISA sessions with instruments via TCPIP. I noticed that if too many VISA sessions are opened without being closed, the following error occurs in NI I/O Trace:

 

-Insufficient system resources to perform necessary memory allocation

 

This situation eventually happens when the C# application crashes before closing the VISA sessions. At this point, the only way to establish a communication with the instrument is to turn it OFF/ON.

Is there a way to list all the currently open Visa sessions and close them in a C# program?

 

Also, this problem with the too many opened VISA sessions only happen with an instrument connected via TCPIP. No problem is reported if the instrument is connected via USB. Is it normal ?

0 Kudos
Message 1 of 2
(2,506 Views)

Hi cedric84,

 

I know that the LabVIEW API for VISA has a VI to list all currently open VISA sessions. It seems reasonable that the .NET API also has this functionality, but I'll need to look into it a little bit to find out how one would go about that.

NickelsAndDimes
Product Support Engineer - sbRIO
National Instruments
0 Kudos
Message 2 of 2
(2,485 Views)