LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Error: -1073807300, probably due to multiple VISA sessions open. How do I close them all?

Solved!
Go to solution

I have a simple vi that takes a reading from a picoammeter, using sub-vis specific to the instrument. I guess I'm opening new VISA sessions every time I run it. Recently I've been getting the 1073807300 error: insufficient system resources to perform necessary memory allocation. I've tried adding a close command but I still think I have VISA sessions open.

 

Any suggestions on how to close them will be very appreciated!

 

Attached is the original vi (picoamm_1) and the initialisation sub vi if it helps.

Download All
0 Kudos
Message 1 of 10
(4,603 Views)

The inialization vi open a visa session at each iteration of the for loop and your session are not closed at the end. Your vi structure should be as follow:

 

picoamm.png

 

Ben

Message 2 of 10
(4,596 Views)

Note that they are probably already open visa sessions, you can use the attache utility VI to close them.

 

Ben

0 Kudos
Message 3 of 10
(4,586 Views)

JKLH,

 

You are using an IVI session handle for your instrument.

You may have problems if you try to close it using a Close VISA.vi.

 

R

0 Kudos
Message 4 of 10
(4,568 Views)

Hello,

 

My vi is now as below. It didn't seem to work last night but it does now! Maybe I attached something differently today. Regarding the close VISA sub-vi do you recommend I use the driver close VI instead?

 

Many thanks to you both for your help.

  picoamm_errorfixing.JPG

0 Kudos
Message 5 of 10
(4,552 Views)

Although the session count still appears to be climbing...

Unforutunately I can't open the GPIB close vi that you attached as this version of labVIEW is earlier. Could you send an image of it so I can recreate it please?

 

Thank you 🙂

0 Kudos
Message 6 of 10
(4,542 Views)
Solution
Accepted by topic author JKLH
That's all wrong. First, you don't have an IVI resource name control. It's the wrong class. Right click on the input of the initialize function and select 'Create Control'. Second, you are not closing the IVI sessions because you don't have it wired correctly. That shift register is just silly. Do NOT wire your control through the loop and back out. You want to wire the session reference of the Read function out of the loop to the Close function that is in the driver. As you wire the session out, the for loop will autoindex it into an array. Just right click on the exit tunnel and select 'Disable Indexing'.
Message 7 of 10
(4,535 Views)

What ben posted is the same one as the one you are using.

 

For some reason, the Keithley vi's use IVI sessions. Which explains the red dot in front of the icon.  That means since the session is of the wrong class, it opens a new session.  In other words, you are closing a session that was never opened.

 

If you try to use a Close VISA vi, you may not be able to wire it because they are different session types (VISA vs IVI).  This is what I was trying to explain in my original post... that you may have problems if you try to use Ben's solution.

 

R
Message 8 of 10
(4,531 Views)

Thanks you both. My vi now looks like this and it isn't counting up the sessions! Thanks for helping me to understand the problems involved.

 

 

 picoamm_errorfixing.JPG

0 Kudos
Message 9 of 10
(4,523 Views)

That looks much better.  The Keithley Close VI was the solution.   The regular VISA Close would (probably) not have worked because they are of different class.

 

The only comment I would make is to place the Error Out cluster after the Keithley Close VI.

 

R

Message 10 of 10
(4,508 Views)