09-28-2021 09:01 PM
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
09-29-2021 06:41 AM - edited 09-29-2021 06:43 AM
@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.