Input Buffer over flow

P

Thread Starter

Prashant Desai

Dear Sir ,

We are communicating PC with one separate Addon card ( which is not part of PC ) which contains DSP chip on it through RS-232C.

For every 200 millisec 110 bytes will come from DSP card. The Problem I am facing is Input Buffer over flow coming. This error is set in the following func.
ClearCommError(CommPortHandle,&dwErrorFlags,&ComStat)
What I am thinking is 19.2 k is high baud rate
This over flow is occurring every 1 or 2 hours.
This time is different in different PC

I am using MFC functions like CreateFile , Writefile and Readfile

the baudrate which we set is 19.2 k
The Input buffer is set to 4096 * 4
The output buffer is set to 1024

The comm time out set to following
CommTimeOuts.ReadIntervalTimeout = MAXDWORD ;
CommTimeOuts.ReadTotalTimeoutMultiplier = 0 ;
CommTimeOuts.ReadTotalTimeoutConstant = 1000;
CommTimeOuts.WriteTotalTimeoutMultiplier = 0 ;
CommTimeOuts.WriteTotalTimeoutConstant = 1000 ;


I am calling Readfile as follows

overlappedRead.hEvent=CreateEvent(NULL,TRUE,FALSE,NULL);

ResetEvent(overlappedRead.hEvent);
DWORD dwBytesToRead=READBUFFER;
BOOL bResult;
DWORD bytesRead=0;
bResult=ReadFile(CommPortHandle,(BYTE*)byteReadBuff,
dwBytesToRead,&dwLength,&overlappedRead);

End of Readfile
Any further details ask me.
Prashant Desai
 
Top