Re: Serial port :bytesAvailable




"Gary B" <bargaryg@xxxxxx> wrote in message
news:g8cdm9$ifd$1@xxxxxxxxxxxxxxxxxxxxx
Hello,

I am reading binary data from a serial port (it is actually
a virtual serial port created for FDTI usb connection). I
have no problem reading data, I am reading data from an eye
movement measurement device, however I am trying to
synchronize my measurement with a CRT monitor controlled
through matlab using a purpose built graphics card. Which
requires very specific timing control (my graphics card has
timing control independent of windows so it is very
accurate) and accurate readings of how much bytes are in the
input buffer, for this I am using the bytesAvailable function.

Ok first question once the port is opened can windows
interrupt the flow of data into the input buffer when
reading asychronously, is this flow usually continuous or
does it go in in chunks (maybe this is specific to the
instrument). As I am getting a problem that when a call the
bytesAvailable function after opening the port, the number
of bytes returned are always in multiples of 3968 or 4092 (I
realise these are significant numbers in binary terms) but
is this a general property of bytes available or is it maybe
related to my instrument. Even with the most simplest code
where i might open the port pause for 0.1 second and read
the data the bytesAvailable function always seems to read in
in chunks (being 0 3968 or 4092 in this case).

Does anyone know why this would occur?

Thanks very much,

Hi Gary

The serial input buffer is filled with data as it becomes available and
reporting the bytes available in that buffer. By default, the serial port
is polled every ~20ms for incomming data while using ReadAsyncMode =
continuous. You may be observing behavior related to how the FDTI
USB/Serial driver is delivering data acrossed the USB interface and then
discovered by the serial polling mechanism.


.



Relevant Pages

  • Re: Serial Port interfacing
    ... > I am having a problem reading from a serial port, first of all I have now ... resorted to using the MSComm ActiveX control on my Windows Forms to provide ... me with the interface to my serial port. ... my Card reader up and I plug it in and I swipe my transponder card the ...
    (microsoft.public.dotnet.languages.csharp)
  • Serial port :bytesAvailable
    ... I am reading binary data from a serial port (it is actually ... have no problem reading data, I am reading data from an eye ...
    (comp.soft-sys.matlab)
  • Re: writing serial port data to the gzip file
    ... Petr Jakes wrote: ... (expect reading from serial port is 100% not a problem) ... I was reading in the doc: ... already implements iterator. ...
    (comp.lang.python)
  • Re: Parsing data from pyserial
    ... He's reading with a 1-second timeout ... from the gizmo for the command sent to it. ... transmission mode of the serial port. ...
    (comp.lang.python)
  • Re: Pylab and pyserial plot in real time
    ... Basically the code was supposed to get the values from the serial port, ... more appropriate for the above mentioned task than pylab?? ... > What do you mean when you say it's in ASCII format? ... > problem is with the serial reading or with the plotting. ...
    (comp.lang.python)