rustycar54
Programmer
I'm working on a program which makes heavy use of a serial port. In this case, a *real* serial port not a usb-to-serial adapter.
It is currently a windows-only program (unfortunately ), running on Windows XP. The TCL version is 8.5.1.0 - it may or may not be an 'official' TCL, not sure. The script is 'compiled together' (made into an executable) so that the user doesn't run the tcl directly - they run the executable which runs the script.
Everything works perfectly until the device on the other end sends a BREAK (or, just disconnect the serial port as that also gives a BREAK condition).
Once that happens, data is still received fine, but sending data to the port via 'puts' results in no data going to the serial port. In fact, when I do send a character using puts, if I ask fconfigure for the last error, it always says BREAK. Of course, that 'BREAK' condition may simply be the last error, and the current state is 'no error'...
If you try closing the port and re-opening it while running in the same TCL script, the open fails (permission denied).
Until I exit the 'program', the serial port is not available in any way anywhere. Once I exit the tcl script/program, other programs can open the COM port - and if you re-run the script/program you can open the port again. But you must EXIT the program in order to actually free up the port. This ONLY happens with TCL programs/scripts - for example TeraTerm does not exhibit the same issue (so its probably not hardware).
In any case, HOW in the world does someone clear the 'break' condition on a serial port in TCL so that one can send characters to the device again?
(I tried
Thanks!
Rusty