12-29-2013 10:02 PM
hello!
Excuse me, why did the same to PC to send serial data, laptops and desktops with USB 232 serial data receiving circuit. But the desktop and notebook receiving data is not the same, not the baud rate of the test.
12-30-2013 02:38 AM
Duplicated post. Discussion continues here.
12-30-2013 02:59 AM
I will accept the 7000 byte why I call serial callback function receiving, receiving incomplete.
The following settings:
InstallComCallback (COM_Port, LWRS_RECEIVE, 1, (int) gEventChar[0], Event_Char_Detect_Func, 0);
Void CVICALLBACK Event_Char_Detect_Func (int portNo, int eventMask, void *callbackData)
{
Txt_FILE[n]=ComRdByte (COM_Port);
ComRd (COM_Port, Txt_FILE, FILE_ESIZE);
FlushInQ (COM_Port);
}
12-30-2013 05:04 AM
Well, your callback is fired on the first byte received in the input queue, there is no guarantee that all subsequent 6999 are there too when you call ComRd, or you have set an insufficient timeout on the read. How much time is your external device expected to take to transmit the whole message?
If you don't want to rely on the timeout on read, you should either wait for all bytes to be present beforre reading or repeat ComRd in a loop and accumulate bytes in a buffer until the message is complete.
In any case you must handle the return code for both ComRdByte and ComRd to be warned for any problem and handle it.