I am a beginner with Tcl and I start practice with wish85 console
under Win XP sp3
Mi goal is read incoming serial port chars
I use the com port on my PC. Com1 is open from TCL and Com2 from Hyperterminal. My console instructions are
% set comport [open com1 RDWR]
file12e2a18
% fconfigure $comport -mode 9600,n,8,1
% fconfigure $comport -blocking 0 -buffering none -translation binary
% fconfigure $comport -mode
9600,n,8,1
% set data [read $comport]
% set data [read $comport]
aaá
% fconfigure $comport -lasterror
% fconfigure $comport -pollinterval
10
the strange is: If from hyperterminal I type a random sequence like "kfsjhdklj" all work ok and the data var contain exactly the typed sequence
But if I type the same char three times like "aaa" the received sequence is wrong like "aaá" And this happens for all chars.
Also If I type "aa" and after few seconds (or minutes) I type the third "a" the result is the same, and receiving continues alternating "a" and "á" until I press another key. But after two times also the new character alternate whit a wrong value
I think this is not a buffer or polling problem but I have no idea how to fix it.
thanks for help
under Win XP sp3
Mi goal is read incoming serial port chars
I use the com port on my PC. Com1 is open from TCL and Com2 from Hyperterminal. My console instructions are
% set comport [open com1 RDWR]
file12e2a18
% fconfigure $comport -mode 9600,n,8,1
% fconfigure $comport -blocking 0 -buffering none -translation binary
% fconfigure $comport -mode
9600,n,8,1
% set data [read $comport]
% set data [read $comport]
aaá
% fconfigure $comport -lasterror
% fconfigure $comport -pollinterval
10
the strange is: If from hyperterminal I type a random sequence like "kfsjhdklj" all work ok and the data var contain exactly the typed sequence
But if I type the same char three times like "aaa" the received sequence is wrong like "aaá" And this happens for all chars.
Also If I type "aa" and after few seconds (or minutes) I type the third "a" the result is the same, and receiving continues alternating "a" and "á" until I press another key. But after two times also the new character alternate whit a wrong value
I think this is not a buffer or polling problem but I have no idea how to fix it.
thanks for help