Measurement Studio for .NET Languages

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the number of bytes read before timeout exception?

I am using the NI VISA library ReadByteArray method to read approx. 100,000 bytes. I am receiving a timeout exception, which I believe is caused by not enough bytes being received before timeout occurs. Is there anyway to programatically get the number of bytes that were received before a timeout? Or the number of bytes available before the ReadByteArray executes?

0 Kudos
Message 1 of 2
(2,008 Views)

d61218,

 

There is no way to get the amount of bytes read if an exception is thrown. The only thing that I can suggest is to read smaller arrays and append them if you need all of that data in one array.

C. Weeks
Product Support Engineer
NI
0 Kudos
Message 2 of 2
(1,983 Views)