Serial Port Comm. Errors NT/Win2k 
Author Message
 Serial Port Comm. Errors NT/Win2k

My application uses multiple comm. ports.   Sometimes all I/O on one of
the channels fails and Tcl reports and error reading/writing the
fileID.     Other than indicating the failure, there is not much
information in the error message about the cause of the problem.   Can
someone point me to refernces/FAQs which sould explain under what
conditions a serial link which was successfully opened would
subsequently become un-available?

Thanks,
Jim



Sun, 24 Aug 2003 00:55:00 GMT  
 Serial Port Comm. Errors NT/Win2k
Two indications:

1. Did you [fconfigure $chan -translation binary]
   or do you use the default [fconfigure $chan -translation auto] ?
   In the latter case [eof $chan] becomes TRUE after reception of the
   end-of-file character ( \x1A == ^Z for Win32 ).
   A typical fileevent handler testing [eof $chan] could close the channel
   after receiving a \x1A :

        fileevent $chan readable [list reader $chan]
        proc reader {chan} {
                if { [eof $chan] } {
                        puts stderr "eof"
                        catch {close $chan}
                } elseif { [catch {read $chan} data] } {
                        puts stderr "error: $data"
                        puts stderr "com-err: [fconfigure $chan -lasterror]"  ;# for Tcl >= 8.3
                } else {
                        puts "received: $data"
                }
        }

2. Try to [catch {read $chan}] and call [fconfigure $chan -lasterror]
   if you have Tcl >= 8.3 .
   That could give you an indication about what happens on the serial line.

A short list of possible errors:

-lasterror Description                  Solution
----------------------------------------------------------------------
RXOVER   Windows input buffer overrun   The configures a buffer
         Data comes faster then your    of 4096 for input.
         script reads it.               You may use my WinCom
                                        extension to enlarge
                                        the buffer size.
TXFULL   Windows output buffer overrun.
         Analog to RXOVER

OVERRUN  UART (hardware !) buffer       Check your COM-port config
         overrun = character lost       (device manager), enable
         Data comes faster than the     FIFO (16550) and/or choose a
         system driver(!) receives it.  lower (faster) interrupt

RXPARITY Parity error detected by       Check the [fconfig -mode ]
         UART (hardware).               settings.

FRAME    Frame error detected by        Check the [fconfig -mode ]
         UART (hardware).               settings.
         I had also cases where the internal (!) COM-ports failed
         with this error in a hot summer.
         The solution was to buy a simple Serial Port ISA/PCI Card
         for $20.

BREAK    A BREAK detected by hardware

Regards,

Rolf.

Quote:

> My application uses multiple comm. ports.   Sometimes all I/O on one of
> the channels fails and Tcl reports and error reading/writing the
> fileID.     Other than indicating the failure, there is not much
> information in the error message about the cause of the problem.   Can
> someone point me to refernces/FAQs which sould explain under what
> conditions a serial link which was successfully opened would
> subsequently become un-available?

> Thanks,
> Jim

--

---------------------------------------------------------------
Rolf Schroedter
German Aerospace Center
Institute of Space Sensor Technology and Planetary Exploration
D-12489 Berlin, Rutherfordstrasse 2
Tel/Fax:  (+49) (30) 67055-416/384



Sun, 24 Aug 2003 14:54:04 GMT  
 Serial Port Comm. Errors NT/Win2k
Thanks Rolf,

I am using my serial ports in binary mode so I think that your point #1 is covered!

I will try using th fconfigure -lasterror as you suggest.   Somehow the info on this option to the
fconfigure is not documented in any of the Tcl/Tk books that I have or in the on-line Help files
which I have received with the 8.3.2 bundle although the option appears to be understood by the
interps!

Your nice wincom extension seems like a good option too!

Regards,
Jim

Quote:

> Two indications:

> 1. Did you [fconfigure $chan -translation binary]
>    or do you use the default [fconfigure $chan -translation auto] ?
>    In the latter case [eof $chan] becomes TRUE after reception of the
>    end-of-file character ( \x1A == ^Z for Win32 ).
>    A typical fileevent handler testing [eof $chan] could close the channel
>    after receiving a \x1A :

>         fileevent $chan readable [list reader $chan]
>         proc reader {chan} {
>                 if { [eof $chan] } {
>                         puts stderr "eof"
>                         catch {close $chan}
>                 } elseif { [catch {read $chan} data] } {
>                         puts stderr "error: $data"
>                         puts stderr "com-err: [fconfigure $chan -lasterror]"    ;# for Tcl >= 8.3
>                 } else {
>                         puts "received: $data"
>                 }
>         }

> 2. Try to [catch {read $chan}] and call [fconfigure $chan -lasterror]
>    if you have Tcl >= 8.3 .
>    That could give you an indication about what happens on the serial line.

> A short list of possible errors:

> -lasterror Description                  Solution
> ----------------------------------------------------------------------
> RXOVER   Windows input buffer overrun   The configures a buffer
>          Data comes faster then your    of 4096 for input.
>          script reads it.               You may use my WinCom
>                                         extension to enlarge
>                                         the buffer size.
> TXFULL   Windows output buffer overrun.
>          Analog to RXOVER

> OVERRUN  UART (hardware !) buffer       Check your COM-port config
>          overrun = character lost       (device manager), enable
>          Data comes faster than the     FIFO (16550) and/or choose a
>          system driver(!) receives it.  lower (faster) interrupt

> RXPARITY Parity error detected by       Check the [fconfig -mode ]
>          UART (hardware).               settings.

> FRAME    Frame error detected by        Check the [fconfig -mode ]
>          UART (hardware).               settings.
>          I had also cases where the internal (!) COM-ports failed
>          with this error in a hot summer.
>          The solution was to buy a simple Serial Port ISA/PCI Card
>          for $20.

> BREAK    A BREAK detected by hardware

> Regards,

> Rolf.


> > My application uses multiple comm. ports.   Sometimes all I/O on one of
> > the channels fails and Tcl reports and error reading/writing the
> > fileID.     Other than indicating the failure, there is not much
> > information in the error message about the cause of the problem.   Can
> > someone point me to refernces/FAQs which sould explain under what
> > conditions a serial link which was successfully opened would
> > subsequently become un-available?

> > Thanks,
> > Jim

> --

> ---------------------------------------------------------------
> Rolf Schroedter
> German Aerospace Center
> Institute of Space Sensor Technology and Planetary Exploration
> D-12489 Berlin, Rutherfordstrasse 2
> Tel/Fax:  (+49) (30) 67055-416/384




Sun, 24 Aug 2003 18:20:24 GMT  
 Serial Port Comm. Errors NT/Win2k
[fconfigure -lasterror] is documented together with [fconfigure -mode]
in the man-page/help for [open], section "serial communications".

[fconfigure -lasterror] is too new to appear in any tcl-book.

Regards,
Rolf.

Quote:

> Thanks Rolf,

> I am using my serial ports in binary mode so I think that your point #1 is covered!

> I will try using th fconfigure -lasterror as you suggest.   Somehow the info on this option to the
> fconfigure is not documented in any of the Tcl/Tk books that I have or in the on-line Help files
> which I have received with the 8.3.2 bundle although the option appears to be understood by the
> interps!

> Your nice wincom extension seems like a good option too!

> Regards,
> Jim

---------------------------------------------------------------
Rolf Schroedter
German Aerospace Center
Institute of Space Sensor Technology and Planetary Exploration
D-12489 Berlin, Rutherfordstrasse 2
Tel/Fax:  (+49) (30) 67055-416/384



Sun, 24 Aug 2003 20:31:11 GMT  
 Serial Port Comm. Errors NT/Win2k
Thanks.....I guess it sort of makes sense to put fconfigure options under the open command manpage?    I
guess that fact that -mode is not documented on the fconfigure manpage should have tipped me off!

jim

Quote:

> [fconfigure -lasterror] is documented together with [fconfigure -mode]
> in the man-page/help for [open], section "serial communications".

> [fconfigure -lasterror] is too new to appear in any tcl-book.

> Regards,
> Rolf.


> > Thanks Rolf,

> > I am using my serial ports in binary mode so I think that your point #1 is covered!

> > I will try using th fconfigure -lasterror as you suggest.   Somehow the info on this option to the
> > fconfigure is not documented in any of the Tcl/Tk books that I have or in the on-line Help files
> > which I have received with the 8.3.2 bundle although the option appears to be understood by the
> > interps!

> > Your nice wincom extension seems like a good option too!

> > Regards,
> > Jim

> ---------------------------------------------------------------
> Rolf Schroedter
> German Aerospace Center
> Institute of Space Sensor Technology and Planetary Exploration
> D-12489 Berlin, Rutherfordstrasse 2
> Tel/Fax:  (+49) (30) 67055-416/384




Mon, 25 Aug 2003 00:07:08 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Serial Error 0x4002 (Error 16386, character was lost by overwrite / serial port overrun error)

2. Question, serial port comm..

3. Serial comm port dialog (signal lines)

4. Accessing the serial comm ports using the Win32 API

5. serial comm VW2.5 on NT

6. Comm port access on NT

7. Windows NT and Comm Port

8. Comm Ports over comm 10

9. Serial ports with Win 2000/nt.

10. Serial Port and Windows NT

11. serial ports & NT

12. Using serial port under Windows NT

 

 
Powered by phpBB® Forum Software