K
Ken Breit
I am using the RS232.vb class to talk to the serial port. The problem I am
having is when I try to read if anything is on the comm port. I call the
read method, with the number of bytes I am expecting to read. As long as I
know the length of the command that I will be getting on the input of the
port it works great.
The problem is when I don't know how long the data I am receiving is. If I
request more bytes than I know I am getting back (ie. I would request to
read the entire buffer, and then just see what is in that buffer) the class
throws a timeout error. I'm assuming that it is waiting for of the bytes
that I specified.
With the VB6 Comm control I was able to read the input and if there was
nothing there it would just return a blank string.
Is there any way to tell how many bytes are in the buffer before I try to
read it, or some way to read the port when there is nothing there and not
get an error?
Thanks,
Ken Breit
having is when I try to read if anything is on the comm port. I call the
read method, with the number of bytes I am expecting to read. As long as I
know the length of the command that I will be getting on the input of the
port it works great.
The problem is when I don't know how long the data I am receiving is. If I
request more bytes than I know I am getting back (ie. I would request to
read the entire buffer, and then just see what is in that buffer) the class
throws a timeout error. I'm assuming that it is waiting for of the bytes
that I specified.
With the VB6 Comm control I was able to read the input and if there was
nothing there it would just return a blank string.
Is there any way to tell how many bytes are in the buffer before I try to
read it, or some way to read the port when there is nothing there and not
get an error?
Thanks,
Ken Breit