06-20-2011 08:19 AM
Hi,
If the Instrument connected in the interface is not configured, and measurement parameters are tried to read from the instrument by using Query(textToQuery) call, VisaNS class throws Exception. After catching this exception, if writing to the instrument (as resetting the instrument(*RST) or Clearing screen(*CLS)) is tried, Exception is again thrown from VisaNS class. Error message for the same exception says "NationalInstruments.VisaNS.VisaException was unhandled; Message="Timeout expired before operation completed. VISA error code -1073807339 (0xBFFF0015), ErrorTimeout"; Source="NationalInstruments.VisaNS"".
Can't this exception be handled?
How to decide the timeout duration? (However, I am not specifying any timeout duration while opening any session for the instrument)
However, I am new to C# and help and support would be highly appreciated.
Br,
Ajit
06-20-2011 10:42 PM
Please take a look the following link http://digital.ni.com/public.nsf/allkb/E6DFA2B8D7E99F9886256C14005E82F7?OpenDocument
06-21-2011 07:11 AM
Hi Sumit,
Thanks for the reply. But, I am not using any serial communication for interaction. I am communicating with instrument using GPIB.
Today, again I tried to check the StatusByteFlags after writing the query to the session. It's coming with the value 84 (0b1010100). This clearly indicates, 2nd, 4th and 6th bits of Status byte register are set (EAV, MAV and RSQ bits are set). But after that, when I tried to read the message string using ReadString() method, it gives me timeout exception as explained in my earlier post.
I am a novice to these. Please rectify me if I am wrong somewhere.
Br,
Ajit