none
COM port read error : 995

    Question

  • hi,

     

    Iam working on windowsxp with vc7. At times when i try to access the com port and read some value, there is an error 995, returned by GetLastError().

     

    the com port is openned using winapi createfile.

    I've also set the flag...

              dcb.fAbortOnError=1;

     

    Can somebody please let me know why this happenns and any possible solution for this.

     

     

    Thanks,

    Srikanth.

     

     

     

    Monday, July 16, 2007 8:37 PM

Answers

  • I have not used fAbortOnError myself, but have you tried using ClearCommError to clear any comms errors such as parity, overrun etc.

    What I have found is that unless ClearCommError is checked on a regular basis, reads/writes after a comms error will fail.

    Monday, July 16, 2007 10:29 PM
  • The first thing to do is to determine what 995 means. You can get that done for you automatically by your program using the FormatMessage function. Or you can use the Error Lookup tool in VS. Or you can open winerror.h and find error 995 there. The advantage of winerror.h is that you can also determine the symbolic name for the error code; for 995 it is ERROR_OPERATION_ABORTED.

    Using ERROR_OPERATION_ABORTED you can search the MSDN for explanations and examples. Based on the description of the error, I think it is necessary to know the context of the error to answer your questions.

     

    Tuesday, July 17, 2007 3:46 AM

All replies

  • I have not used fAbortOnError myself, but have you tried using ClearCommError to clear any comms errors such as parity, overrun etc.

    What I have found is that unless ClearCommError is checked on a regular basis, reads/writes after a comms error will fail.

    Monday, July 16, 2007 10:29 PM
  • The first thing to do is to determine what 995 means. You can get that done for you automatically by your program using the FormatMessage function. Or you can use the Error Lookup tool in VS. Or you can open winerror.h and find error 995 there. The advantage of winerror.h is that you can also determine the symbolic name for the error code; for 995 it is ERROR_OPERATION_ABORTED.

    Using ERROR_OPERATION_ABORTED you can search the MSDN for explanations and examples. Based on the description of the error, I think it is necessary to know the context of the error to answer your questions.

     

    Tuesday, July 17, 2007 3:46 AM
  • Hi Thanks!!,

     

    I'll try this and come back!!

     

    Thanks,

    Srikanth.

    Tuesday, July 17, 2007 7:16 PM