LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

VISA Close.vi takes long time to close?

This really comes shocking to me, but it takes 110 ms to close the VISA reference, while other open VISA or read/write VISA only used <20 ms. Is it per device? Or it always takes this long to close VISA reference? Any way to reduce this timing?

 

VISA Close.jpg

0 Kudos
Message 1 of 5
(3,320 Views)

It's hard to tell from your small picture but it look like you are opening and closing a VISA session everytime you write?

 

If so, you are doing it wrong.

 

Open a VISA session at the beginning of your program, use that same session for all of your reads and writes, then close the session at the end of your program.

 

 

 

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 5
(3,305 Views)

Hmmmm... that "Watch" glyph on the VISA write makes me think of a quote from Velma Binkley.

Spoiler
"Jinkies! A clue!"

 

Set the synchronous mode to "Synchronous" from the Right Click Menu and the VISA Close won't need to wait for the data transfer to finish before it can act.  (Yup, that benchmark isn't as data dependant as it looks)


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 5
(3,293 Views)

Thanks for the tip, but I tried it and it does not make any difference on timing. 

 

I also tried flushing the receive buffer after the Write, but it did not help either. I guess in this case, I cannot do the open-close every time. 

0 Kudos
Message 4 of 5
(3,231 Views)

There is an Automatically Close VISA Sessions option you can set instead of putting a VISA close in your program.

 

Close.PNG

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 5 of 5
(3,223 Views)