Avi Bar-Zeev (avi++at++oz.net)
Fri, 21 Mar 1997 20:13:45 -0800
The trick that seemed to work for me was for a polhemus driver
that required reading from 2 or 3 serial ports simultaneously for a
real-time (30HZ) motion-capture application.
The trick is to do a read(0) for each port, then go do something else,
and then come back and read the real data, for as much as you want.
The read(0) seemed to prime the queue, so to speak. I had to really
tweak the timing on this so be prepared to search for the magic combo.
For example, when I dropped down to 1 polhemus, I got chugs from the
new timing.
Oddly, there also seemed to be a hit from reading the entire queue,
as if leaving a couple of characters in the queue for next frame helped
prevent stalls. I never figured that out.
If you can afford it, get a serial-port board such as the CDSIO or
ASO boards.
Avi
At 07:13 PM 3/17/97 -0800, David Plew wrote:
>
>Hi:
>
> In my performer application, I interface with the RE2 5.3, serial
>port to read data coming from an external serial device. The port is
>opened with the default blocking mode. I set the termio.c_cc[VMIN] and
>termio.c_cc[VTIME] to 15 and 4 respectively. According to the man pages
>this means that 'read' will wait to read atleast 15 bytes from the port,
>and will time out after 4 units of time in any case and return. What is not
>clear is that: in such a setting, does blocking mode override the termio
>controls or does the 'read' always return after 4 units of time?
>I was not doing anything to the O_NONBLOCK flag so far and sometimes,
>'read' would wait and wait for ever at the port probably 'coz there was no
>data available for it to read. Shouldn't the termio control override what
>ever the setting was, once it has been set? I do set the termio controls
after
>'open' and before any 'read' begins.
>
>Even when I did set the O_NONBLOCK flag, sometimes I can see the same
>thing happening to 'read'. Can someone please explain who overrides whome?
>
>thanks
>-anita
>
>kishore++at++aimnet.com
>=======================================================================
>List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
> Submissions: info-performer++at++sgi.com
> Admin. requests: info-performer-request++at++sgi.com
>
>
=======================================================================
List Archives, FAQ, FTP: http://www.sgi.com/Technology/Performer/
Submissions: info-performer++at++sgi.com
Admin. requests: info-performer-request++at++sgi.com
This archive was generated by hypermail 2.0b2 on Mon Aug 10 1998 - 17:54:56 PDT