Re: Events on Serial port



Derek wrote, On 03.07.2008 23:02:

I'll take at look at these suggestions at work next week, I have amore
pressing problem in that the polling version that works fine under
linux dosn't under windows.
It seems a write over the serial port is screwwing things up some
where. I have to find out what this issue is before I can get any
further.

Write issues: Many people are not aware, that a non-blocking channel means non-blocking reads *_and writes_* (this was different for Windows-Tcl before 8.4).
Non-blocking writes means, that your [puts $chan] returns immediately buffering the data for background write *_at full baud speed_*. A slower receiving hardware may have problems with those writes.
[fconfigure $chan -queue] opens alternatives to you:
(A) Blocking channel, polling [fconfigure $chan -queue] in an after-script until the expected number of bytes have been received.
(B) Non-blocking channel, waiting for the output bytes to be sent after each write operation.
.



Relevant Pages

  • Re: Bug/Weak Implementation? popen* routines cant handle simultaneous read/write?
    ... You need pseduo-ttys and non-blocking IO. ... Try Pexpect http://pexpect.sourceforge.net/ ... Windows has a really strange idea of non-blocking IO - it uses ... You don't want block buffering ...
    (comp.lang.python)
  • Re: Events on Serial port
    ... pressing problem in that the polling version that works fine under ... linux dosn't under windows. ... Many people are not aware, that a non-blocking channel ... This is fine under Linux, Tcl is quite fast at doing the processing, ...
    (comp.lang.tcl)
  • Re: Nonblocking IO read
    ... Windows provides a selectfunction, too, but it only supports sockets The Win32 API generally doesn't provide non-blocking IO methods, because it's assumed you'll use threads if you want to do something else while waiting for IO. ... my religion is very simple. ...
    (comp.lang.ruby)
  • Re: FTDI & Win/D2xx driver questions
    ... but the Windows side is very new to me. ... I would hope the FTDI driver is non-blocking... ... which also affects writes to normal serial ports. ...
    (comp.arch.embedded)
  • keypressed() function
    ... I need a function (blocking or non-blocking) that tells me if a key has ... but then I would at least like solutions that works on Windows and on ... Linux. ...
    (comp.lang.python)