From: Harald O. <har...@el...> - 2015-01-28 15:06:05
|
Hi, thank you for the report. What would be interesting to me is if the commands really fail or if they pass. Thus execute "set errorInfo" after each command. In my opinion this is a bug and should be registered as a ticket in core.tcl.tk/tcl IO were rewritten for 8.6.2/3 so there might be issues. Sorry for this experience, Harald Am 28.01.2015 um 15:56 schrieb C. SB: > Hi, > I'm having a strange problem reading a serial port with tcl 8.6.3.1 on winXP. In short, I can only perform one "read", all the following attempts fail. Here's an example, with TX and RX shorted to echo everything back : > > ***** > (tuner-ctl) 306 % catch {set curchan [open $curport r+ ]} > 0 > (tuner-ctl) 307 % chan configure $curchan -buffering none -translation binary -mode 9600,n,8,1 -handshake none -timeout 100 > (tuner-ctl) 308 % puts -nonewline $curchan \x55 > (tuner-ctl) 309 % read $curchan > U > (tuner-ctl) 310 % puts -nonewline $curchan \x55 > (tuner-ctl) 311 % read $curchan > (tuner-ctl) 312 % close $curchan > ***** > If I close+open the same port right after, I will get the same result : first read works regardless, second read gives nothing! > > Here's what I tried : > - different serial ports (USB->FTDI adapter, com0com software virtual port); either configured/wired as simple loopback devices or connected with a known-good, responding device. (I see the responses come in on the RXD line with a scope) > - various combinations of blocking = 1, =0, buffering = full (and calling "flush $curchan" when required) > - sending a longer string with puts : if I do, the first read will correctly give back the entire string echo. Second read still fails. > - [eof $curchan] ==1, and [chan pending input $curchan] ==0 before the second read. So the data is getting lost somewhere before the second read is called ? > > Of course other terminal software (realterm, etc) works fine, so I'm really not sure what's going on inside tcl... > > Is this a bug report or am I doing something wrong ? > Thanks! > > ------------------------------------------------------------------------------ > Dive into the World of Parallel Programming. The Go Parallel Website, > sponsored by Intel and developed in partnership with Slashdot Media, is your > hub for all things parallel software development, from weekly thought > leadership blogs to news, videos, case studies, tutorials and more. Take a > look and join the conversation now. http://goparallel.sourceforge.net/ > _______________________________________________ > Tcl-Core mailing list > Tcl...@li... > https://lists.sourceforge.net/lists/listinfo/tcl-core > -- ELMICRON Dr. Harald Oehlmann GmbH Koesener Str. 85 06618 Naumburg Germany Phone: +49 (0)3445 78112-0 Fax: +49 (0)3445 78112-19 www.Elmicron.de German legal references: Geschaeftsfuehrer: Dr. Harald Oehlmann, Jens Oehlmann UST Nr. / VAT ID No.: DE206105272 HRB 212803 Stendal |