LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to check if data is ready on visa/serial

Solved!
Go to solution

That's pretty interesting, I never knew that. 

 

One odd thing I noticed while trying it out is that VISA Close wanted to hang for about 15 seconds regardless of what timeout value I wired.  As long as I could click stop before VISA Read timed out, it didn't seem to matter whether I had set the timeout to a 2,10, or 30 seconds.  Even when I reworked it to try a 100 msec timeout, VISA Close would still hang for 15.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 51 of 52
(393 Views)

@Kevin_Price wrote:

That's pretty interesting, I never knew that. 

 

One odd thing I noticed while trying it out is that VISA Close wanted to hang for about 15 seconds regardless of what timeout value I wired.  As long as I could click stop before VISA Read timed out, it didn't seem to matter whether I had set the timeout to a 2,10, or 30 seconds.  Even when I reworked it to try a 100 msec timeout, VISA Close would still hang for 15.


Wow that's something I haven't been aware of and I find it kind of nasty. I could understand that it takes a second or two but 15 is kind of excessive. Just did a test on an old system with VISA 12.0 and there it is even worse. The VISA Read and VISA Close will both return at the same time after those 15 seconds after the VISA Close was invoked.

 

Now this isn't really how I program VISA, so it has went under my radar, but I knew VISA Close was able to abort an IO Sessions (if you don't set the VISA Read to operate synchronously that is, which I consider an unnecessary limitation too. The VISA API should be able to allow aborting an IO session even in synchronous operation). This whole thing works however pretty flawlessly for TCP and UDP refnums, where I have used it in the past repeatedly.

Rolf Kalbermatter
My Blog
0 Kudos
Message 52 of 52
(367 Views)