Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

Timeout on VISA Interface SendInterfaceClear command

Issuing a VISA Interface class SendInterfaceClear command seems to timeout if no instruments are connected to the interface. The reported error message is: "Run-time exception thrown : NationalInstruments.VisaNS.VisaException - Timeout expired before operation completed. VISA error code -1073807339 (0xBFFF0015), ErrorTimeout"

Is this an expected behavior?
0 Kudos
Message 1 of 6
(4,201 Views)
This is not expected behavior. Can you generate an NI Spy log file and post it? Go the Spy Options and choose "Log to File" - don't use File>>Save. This will give us some extra information so we can see what's happening at a lower level.
0 Kudos
Message 2 of 6
(4,186 Views)
Also, can you specify what versions of NI-VISA and NI-488 you're using?
0 Kudos
Message 3 of 6
(4,171 Views)
Glenn:

The attached CAPTURE.SPY file includes the sequence recorded when I connected to the interface and then issued a clear. Note that the VISA Manager class throws an exception trying to list the GPIB resources if none are present. Also note that I remaned the file to CAPTURE.SPY.TXT becuase the forum would not upload a file with .spy extension.

I have installed VISA from the November 2004 Device Drivers CD. Max reports VISA.DLL revision 3.2.0.19.

I use the CEC USB-488 interface with CEC-488 version 8 because NI-488 cannot be used with the CEC interface.

David
0 Kudos
Message 4 of 6
(4,166 Views)
David:

Querying the resource manager for GPIB?*INSTR will indeed throw an exception if no resources are found. I can agree that there might be a better way to do that, but for now I'll say that it's at least expected behavior.

Regarding SendInterfaceClear, however, that does seem like a bug. That operation shouldn't return an error when no devices are connected. The software stack under NI-VISA is different for NI GPIB cards and CEC GPIB cards, and using an NI GPIB card, it doesn't return an error. So while you might expect a software fix sometime in the future, your best bet is to add a try/catch block around the call to SendInterfaceClear and just ignore the timeout error for now. In reality, it's not timing out - the "no listeners" error is getting incorrectly translated to a timeout error somewhere along the way.

Hope that helps.

Dan Mondrik
National Instruments
0 Kudos
Message 5 of 6
(4,157 Views)
Dan,

That PDQ--thank you! I already encapsulated and trapped both of these guys. It helps knowing that this is real even if nit picking as in most cases, you would expect the interface to talk to other resources rather than just sitting there.

David
0 Kudos
Message 6 of 6
(4,154 Views)