|
"Gary B" <bargaryg@tcd.ie> wrote in message
news:g8cdm9$ifd$1@fred.mathworks.com...
> 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.
|