02-15-2018 10:23 PM
i am getting this overrun error with my serial communication with VISA .. my device is sending me a frame of 1640 bytes /sec , i perform operation on 82 bytes that gives me 20 packets .. but some how after receiving 1500 packets ,nearly (1500*82=123000 bytes) this error pop up..
i increase the buffer but the problem still exist but it occurs later depending upon the buffer size ..
how can i solve this issue ?
Solved! Go to Solution.
02-15-2018 10:37 PM
Enlarging the buffer only delays how long it takes until the buffer fills up. You need to read the bytes faster. What are you doing with the data you read? Anything else going on in the same loop that slows down the serial read?
I could offer more help, but since you didn't post your VI, I can only speculate what is going on in your code.
02-15-2018 11:46 PM
i have made a state machine which receives 2 bytes to check the starting of a packet and then on the next stage it receive other 80 bytes and perform some operations on it and then display these bytes after parsing on a table ..
i works fine until table shows that i have received somehow 3000 packets (3000*82=246000 bytes) .
i think filling up of table somehow slowing the reading process .
02-15-2018 11:57 PM
here is the attached VI ..
i just a little messy but just attached so you might understand what going on .
02-16-2018 01:16 AM
Hi shaun,
- what's the point of all those local variables? Use shift registers to store data for next iteration!
- what's the point of all those VISAOpen function? Why do you need to open a COM port again and again?
- what's all this stuff in the "append to table" state? When you would supply a typical "received string" you surely would get an example of doing this much simpler…
- why is there a case structure around your VI with a "Play Button"?
- why depends part of that string conversion on that "error in 3"?
02-16-2018 03:21 AM
02-16-2018 04:29 AM
@shaunmarsh123 wrote:
- some of these variables are used for next state.
Then store that data in shift registers. They are a lot more efficient (memory and CPU).
02-16-2018 04:52 AM
ok but this overrun error still exist ..
02-16-2018 05:51 AM
Hi shaun,
general hint for such problems: decouple DAQ loop (serial communication) from data analysis (string parsing) by using a producer-consumer-scheme.
That being said: I still don't think the string parsing is to slow to keep up with your serial communication…
Can you supply an example for this string conversion (input data, format description, expected output data)?
02-16-2018 06:15 AM
i never use a producer consumer loop ,so can u give me an example ?
yup i am receiving data than convert it to hexadecimal string than parse it accordingly . from that hexadecimal string i subset fewer bytes than convert it to decimal so my output is a mix of binary and hexadecimal ..
i observe that this error happens when data on my table gets to bigger .
please provide some solution as this is giving me a headache know..
as you said to use a producer consumer loop so , i have to change my code right ?
😞