Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading large data through rs232

Solved!
Go to solution

Iam trying to read large file through serial communication(Using  RS232) . If i read small data in a file it works great. when iam trying to read large file means more than thousand lines i am getting this type of error.

1.   "VISA:  (Hex 0xBFFF006C) An overrun error occurred during transfer. A character was not read from the hardware before the next character arrived."(error)

how i overcome this problem.

 

0 Kudos
Message 1 of 2
(2,142 Views)
Solution
Accepted by topic author udayasree

Hi

I edited your vi to show what you really are doing.

I have saved the vi for 2010 so you can edit it again.

In fact you are writing all data and reading from the same port in the second loop after waiting 2 seconds.

The first loop already writes all data, and does not read anything because the 1 second wait in its own sequence is executed in parallel with the Write of the data (probably taking more than 1 second) and reading the bytes at port available immediately. So writing more than reading results in a buffer overflow. In fact you are reading too late.

I removed the first while where you did something that I did not understand but probably did in effect nothing at all.

I also only moved the wait sequence within the sequence to show that it was not connected to any wire meaning it executes in parallel to other code. You can change that by wiring e.g. the error wire through this sequence at the approriate spot.

 

I suggest you write in portions smaller than 4096 bytes and read as long as there is data.

 

And one other thing. You have the termination character enabled in the VISA configure serial port. This means that any number of bytes you want to read bigger than a line (expecting you have a linefeed after each hex line) will only read that line.

So if you want speed read blocks by disabling the termination character or write and read each line by changing the write and remove the bytes available completely. (I think that is the best approach)

Just wire a number bigger than a line of characters to the read (say 1024).

greetings from the Netherlands
0 Kudos
Message 2 of 2
(2,131 Views)