03-30-2020 06:00 PM
I am trying to write a program read byte by byte until return <0, then quit the while loop. Somehow the program kept on show non-fatal errors telling me the the return -99, which made my program not usable.
Can anyone tell me what should I do.
I tried to reply on event, eventMask = LWRS_RXFLAG | LWRS_BREAK , and use the following code, but the programm lost many messages. Unless it is a single line of message that is received.
/* read until time out or line feed or carriage */
rtn = ComRdTerm (COM_PORT, readBuf, 512, terminationByte);
while ( rtn > 0 )
{
SetCtrlVal (panelHandle, PANEL_TEXTBOX_Output, readBuf);
rtn = ComRdTerm (COM_PORT, readBuf, 512, terminationByte);
}
Solved! Go to Solution.
03-31-2020 06:29 PM
Error -99 is simply the timeout error: it is possible that you are reading more characters that those effectively on the queue. Anyway, to avoid having interrupted you could remove the checkmark to Run >> Break on >> Library Errors menu option.
04-02-2020 08:55 AM
Thank you ... removed the checkmark to Run >> Break on >> Library Errors menu option, the annoying break is gone.