P
Pubs
Hi,
I am using the serial and I have a problem with the timeout. I am
defining my array to fixed length and call the read function. I
assumed that the function will not return data until it reads the
number of bytes I requested. My timeout is very large so it will not
timeout. However I noticed that it does return values even before it
gets all the data I requested. I have included some code lines below.
ReadBuffer = new byte[200];
if (ReadPort(ref ReadBuffer))
{
PORT_RESPONS.LastReceivedByte =
ReadBuffer[ReadBuffer.Length-1];
if (ReadBuffer[ReadBuffer.Length - 1] ==
PORT_COMMANDS.CMD_DONE)
In this code I want to read the buffer once it gets 200 data points.
but this code returns the values as soon as the first byte receives
and thus reast of the data in the array shows zero. But If I debug
line by line it shows everything properly.
My external device sends data at 115.2 kbps.
can some one help me in this regard.
I am using the serial and I have a problem with the timeout. I am
defining my array to fixed length and call the read function. I
assumed that the function will not return data until it reads the
number of bytes I requested. My timeout is very large so it will not
timeout. However I noticed that it does return values even before it
gets all the data I requested. I have included some code lines below.
ReadBuffer = new byte[200];
if (ReadPort(ref ReadBuffer))
{
PORT_RESPONS.LastReceivedByte =
ReadBuffer[ReadBuffer.Length-1];
if (ReadBuffer[ReadBuffer.Length - 1] ==
PORT_COMMANDS.CMD_DONE)
In this code I want to read the buffer once it gets 200 data points.
but this code returns the values as soon as the first byte receives
and thus reast of the data in the array shows zero. But If I debug
line by line it shows everything properly.
My external device sends data at 115.2 kbps.
can some one help me in this regard.