[PD] again comport object win2k

rat at telecoma.net rat at telecoma.net
Mon Apr 8 12:46:07 CEST 2002


hi,

in mail http://iem.kug.ac.at/mailinglists/pd-list/2001-12/0159.html
from mark newman seems to be a solution for the win2k comport
object:
//////////////////////////////////////////////////////////////
 I grabbed Winfried Ritsch's comport object and code from
 http://iem.kug.ac.at/ritsch/programmier/pd_externals/

 ... as I assume you have already done, and I was able to get it to work
on Win2K for reading data, though I had to make one minor adjustment. I
changed the arguments to CreateFile inside the open_serial method so that
it uses non-overlapped (i.e., blocking) reads.
Here's the actual call, with my changes:

    fd = CreateFile( sys_com_port[com_nr],
             rw,
             0,
             0,
             OPEN_EXISTING,

             /* FILE_FLAG_OVERLAPPED */ 0, // changed to non-overlapped --mwn
             0);

  ... and now it works. I believe this is the correct way to open the
port, since the code is in fact polling (every millisecond, by default)
and not in fact using asynchronous reads. Changing the object to use
overlapped/asynchronous reads would probably be an even better fix, but
that'll have to be for another time.
Unfortunately I can't provide an example patch offhand that uses the
fixed comport since for performance reasons I had to further modify the
object to work with the A/D converter I was talking to--so it's not really
the same object anymore.
/////////////////////////////////////////////////////////////////

unfortunately i m not in possession of a win c compiler.
could somebody plz help me out to compile it ?
i would assume that there are more people out there
who would be interested in having it working under win2k.

thx 

erich
 





More information about the Pd-list mailing list