none
Reg problem in opening Serial port after device is restarted RRS feed

  • Question

  • Hello,

    I am closing the serial port before device restarts. After device is restarted, if I try to open serial port, it gives error "Device attached is not functioning properly". Any idea on this?

    Actually, it works fine when serial port is closed, device is unplugged and plugged in, the port is opened.

    If fails to work when device is restarted.

    Any suggestions will be helpful.

    Regards,

    Harish


    Harish

    Wednesday, May 28, 2014 4:13 AM

Answers

  • this is typically a problem in the driver in that it doesn't cleanup the symbolic link name (COMX) at the right time (Surprise remove) and does it at pnp remove instead. when doing it incorrectly and the device is plugged in before the original instance is pnp removed, the bug will delete the symbolic link for the new instance. talk to the driver vendor.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, May 30, 2014 5:30 AM

All replies

  • Hi Harish,

    Welcome to post in MSDN forums.

    I think it's not the problem with the C# code, it's more like a problem with the device itself. Make sure you have installed the correct driver for the device. Probably when you have closed the serial port, the device still sends data to the port when it is restarting. Something may happen during this time. You could try not to close the serial port and make sure if there's any problems.

    Check this document: http://msdn.microsoft.com/en-us/library/ms837516.aspx

    I'am moving your question to the moderator forum ("Where is the forum for..?"). The owner of the forum will direct you to a right forum. Thanks for your understanding.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.




    • Edited by Caillen Thursday, May 29, 2014 3:16 AM
    Thursday, May 29, 2014 3:10 AM
  • This could be a driver problem or a hardware problem. Are you using the system serial driver? What type of serial port are you using?

     -Brian


    Azius Developer Training www.azius.com Windows device driver, internals, security, & forensics training and consulting. Blog at www.azius.com/blog

    Friday, May 30, 2014 3:33 AM
    Moderator
  • this is typically a problem in the driver in that it doesn't cleanup the symbolic link name (COMX) at the right time (Surprise remove) and does it at pnp remove instead. when doing it incorrectly and the device is plugged in before the original instance is pnp removed, the bug will delete the symbolic link for the new instance. talk to the driver vendor.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Friday, May 30, 2014 5:30 AM
  • Thanks all for your suggestions. Will look into it.

    Regards,

    Harish


    Harish

    Friday, May 30, 2014 7:56 AM