Skip to content
Tcl Source Code History Of Ticket 218465ffffffffff
Login

History Of Ticket 218465ffffffffff

Artifacts Associated With Ticket 218465ffffffffff

  1. Ticket change [f1b8046d66] (rid 109406) by nobody on 2000-10-26 01:00:47:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 625 Bug
      Version: 8.0p2
      SubmitDate: '1998-05-25'
      LastModified: '1999-03-12'
      Severity: MED
      Status: Released
      Submitter: hershey
      ChangedBy: stanton
      OS: All
      OSVersion: NA
      Machine: NA
      FixedDate: '1999-03-12'
      FixedInVersion: 8.1b2
      ClosedDate: '2000-10-25'
      
      
      > I've seen a few queries about problems using Windows NT
      
      > serial/comN ports, but no definitive answers on what
      
      > is going on.  I have boiled my problem down to two
      
      > short Tcl scripts that "should" exchange integer data over
      
      > two com ports connected with a Null modem cable.
      
      > These don't cooperate.
      
      > 
      
      > This state evolved from trying to control a modem from
      
      > Tcl over a serial port.  We then found that
      
      > "copy con comX" would allow manual entry of control
      
      > sequences that worked, but "type cntrlStringsInFile.txt > comX"
      
      > does not work - may take the phone off hook with certain
      
      > settings at best.
      
      > 
      
      > It appears that the NT serial ports' drivers don't deal well with
      
      > the hand-shaking of RS-232E.
      
      > 
      
      > I'll provide the scripts to anyone interested and report any
      
      > definitive results.
      
      > 
      
      I posted a query a while back about the serial ports. I'll pass along
      
      what I learned to get serial out of Tcl under windows.I've been using
      
      Tck/Tk 8.1 with serial I/O working at 115.2K for NT and Windows 95 on
      
      portables and desktops.
      
      I was told serial IO wasn't functioning in versions prior to Tcl/Tk 8.0. 
      
      To paraphrase some of my code. 
      
      
      
      #Open the serial port as 
      
          if {[catch {open "COM1:" "RDWR"} sid]} then {
      
              tk_dialog .dialog "Serial IO Error" "Unable to open serial port COM1:"
      
      error 0 OK
      
              unset sid
      
              return ""
      
          }
      
      # configure for speed and binary data transfer
      
          fconfigure $sid -mode {115200 n 8 1} -translation binary
      
      # I don't think this was supposed to work, but since it kind of does
      
      # I used it for asynchronous reads.
      
          fileevent $sid readable {
      
              if {![catch {read $sid} val} {
      
                      binary scan $val H* data
      
      # fileevent is called even though there is no data, so check for 
      
      # valid string
      
                      if {[string length $data] > 0} {
      
                              #do something with your data
      
                              # 
      
                      }
      
              }
      
              
      
      #otherwise for synchronous sends and receives try
      
          puts -nonewline $sid [binary format H* $dataout]
      
      # flush the buffer so you know it sent
      
          flush $sid
      
          
      
          if {![catch {read $sid 1} val]} {
      
              binary scan $val H* datain
      
              }
      
      
      
      With 8.0, you have fconfigure for setting baudrate, comport, and binary
      
      mode. I'd like to see filevent work (better). I am also curious on how
      
      to send a break from Tcl. I have found interference from internal dial
      
      up modem cards when there shouldn't be. I might start by making sure
      
      there is no hardware or software handshaking performed in the control
      
      panel.
      
      03/12/1999 11:09 - stanton - in 8.1, file events on serial I/O should be working
      
      
      
    4. foundin initialized to: "obsolete: 8.0p2"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "62. (unused)"
    10. title initialized to: "serial ports don't seem to work"
    11. type initialized to: "Bug"
  2. Ticket change [e387f8f222] (rid 87814) by welch on 2000-10-26 08:22:17:

    1. closedate changed to: "2000-10-26T01:22:17"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  3. Ticket change [bcddffcbd5] (rid 101823) by dgp on 2001-04-03 06:39:59:

    1. closedate changed to: "2001-04-02T23:39:59"
    2. closer changed to: "dgp"
    3. subsystem changed to: "27. Channel Types"