Forum Index > Handling of Unexpected Removal of USB to Serial Adapters - Part 2

By: MM Posted on: Jun 21 2012 at 03:46:50 PM
As mentioned on a previous post, the .Net SerialPort component pathetically crashes when disconnecting a USB-RS232 bridge.

The Comm64 handles this much better raising trappable errors in most cases.
However, when the bridge is disconnected in the middle of a RX-TX loop sometimes (not every time but it is easily repeatable) the application hangs.

I placed error traps on all sections dealing with the port.
The OnComm-Event does not return any error.
One post regarding Bluetooth adapters mentioned a .getPortStatus function. I attempted calling it before re-entering the loop but it seems the function is not implemented in Com64 Ver 6.4.1.26.

I write debug info to a log file and it shows no trapped errors but the execution never returns to the next logical part of the RX-TX loop. It even hangs the Visual Studio if running in debug mode.

This is running on Win XP. I have not tested on Win7 yet. The USB-RS232 bridge uses a Prolific PL2303HXD chip.

Any suggestions are appreciated.
Dealing with bridge removal is the reason I purchased the component. It is a great step forward. We just need to finish it up.

PS
Sorry I also posted this under a wrong topic.

By: Support Posted on: Jun 22 2012 at 12:00:20 AM
It sounds as if the com driver prolific device driver has crashed taking everything else down with it.

Are you able to make a small project that exhibits this problem. We'll test it and if possible find a way to generate a trappable error.

support at comm32.com

By: MM Posted on: Jun 22 2012 at 09:32:33 AM
Thank you for such fast reply!!!
The good news is that the problem seems restricted to WinXP.

I tested repeatedly on Win7 both from the VStudio environment and directly from the release compiled executable. Every time the error traps worked and the program recovered gracefully after removing the USB-RS232 bridge.

As you suggested, it may be the WinXP Prolific driver and not the Comm64 after all. When the problems occurs on WinXP, Device Manager shows the Prolific USB-to-Serial Port as present even though the device has been unplugged. In Win7 it disappears immediately every time after unplugging.
For the record, this is using the latest PL2303_Prolific_DriverInstaller_v1.6.0.

I am fine working on Win7 since many of the XP systems are being phased out anyway.
Let me know if you are still interested in a code snippet for your tests. It is not much really. It is a polled RX-TX loop. TX a 4bytes command, then checks the buffer for the expected 1024 bytes and a 500ms timeout. Please provide an email address since support at comm64.com returns 50.87.24.234 does not like recipient.


By: Suppport Posted on: Jun 22 2012 at 12:30:40 PM
It would still be interesting to see the error.

That email address should be working now.

 

Reply - add comment to this topic
You may enter letters, numbers and standard punctuation only. HTML and other scripts/tags will be rejected
  Topic:- Handling of Unexpected Removal of USB to Serial Adapters - Part 2

Your Name


 


Forum scripts and databases - Copyright (c) 2009 - 2012 AxCoL.com