Internet PLC Forum
General => Technical support => Topic started by: tipster on August 08, 2005, 07:58:43 AM
-
Is it possible, through some undocumented command/procedure to clear the serial buffer and/or test the buffer for content, prior to issuing the INPUT$ command ?
It has been my experience that until an INPUT$ command is issued,it is possible for multiple <CR> terminated strings to reside in the buffer. I have a program where I am trying to read a string at a specific instance in the program, if I were to make multiple scans prior to reading the contents, then I am reading the first scan to enter the buffer, the next command reads the next string and so on.
Any help would be greatly appreciated
-
You can issue a loop command to read the serial buffer until there is no more characters, as follow:
FOR I = 1 TO 256
IF INCOMM(1) < 0 GOTO @10
NEXT
@10 ..... ' incoming Serial buffer for comm 1 cleared.