09-25-2018 06:52 AM
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 ?
09-26-2018 05:19 PM
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.