03-01-2012 09:42 AM
Hi all,
I'm developing an application in c# to communicate with Aglient instrument other NiVISA protocol.
I'd like to use asynchronous reading to raise an event on data reception.
For that, I use BeginRead with AsyncCallback.
Instead of AsyncCallback is called when a data is readen, AsyncCallback is called periodicaly even if there is no data avialable (EndReadString throw a timeout exception).
I can't explain this phenomenum. I've tried changing session Timeout to infinite but in this case I can't write any data (session is totaly blocked).
Can you help me please.
Thanks in advance for your help
Maxime
03-20-2012 06:53 AM
Hi,
Thank you for posting your question on National Instruments' forum.
I am not sure I understood your question correctly. From what you are saying, I suppose that the problem can appear because of the manner used to call the Callback.
Having the program or an example reproducing the issue could help me understand the issue.
On the other hand, you might be able to solve the problem by doing your operation in another way.
For instace, you could use VISA event to react to the information sent by your instrument.
Here is a document talking about such events.
How Do I Use VISA Events in Text-based Programming Languages?
I hope it will help you.
Best regards,
Guillaume H.
National Instruments France