Click here to Skip to main content
15,902,634 members
Home / Discussions / Hardware & Devices
   

Hardware & Devices

 
AnswerRe: How to understand the word "function" in the usb protocol? Pin
Luc Pattyn12-Dec-09 1:58
sitebuilderLuc Pattyn12-Dec-09 1:58 
AnswerRe: How to understand the word "function" in the usb protocol? Pin
Richard MacCutchan12-Dec-09 3:24
mveRichard MacCutchan12-Dec-09 3:24 
JokeRe: Thank you Luc Pattyn and Richard MacCutchan. Pin
bdwzz12-Dec-09 17:56
bdwzz12-Dec-09 17:56 
QuestionPC Temperature Sensors Pin
Tony Richards9-Dec-09 3:12
Tony Richards9-Dec-09 3:12 
AnswerRe: PC Temperature Sensors Pin
Indivara20-Dec-09 4:12
professionalIndivara20-Dec-09 4:12 
GeneralHQOTD [moved] Pin
Brady Kelly7-Dec-09 7:46
Brady Kelly7-Dec-09 7:46 
GeneralRe: HQOTD Pin
Ed.Poore7-Dec-09 8:10
Ed.Poore7-Dec-09 8:10 
Question"Port 'COM 3' does not exist"...Except when it does Pin
dybs5-Dec-09 16:13
dybs5-Dec-09 16:13 
Here's something I just don't get. I have a USB device that enumerates as a virtual COM port (CDC device), so I can use the .NET SerialPort class to communicate with it. For the most part, this works fine. However, sometimes the device just gets disconnected or resets and I need to re-open the COM port (this isn't my actual problem right now, I just need to be able to handle it). I should be able to do this:
try
{
  // Serial port communication
}
catch(IOException)
{
  // Device got disconnected, so close our connection.
  port.Close();
  // Wait for device to reconnet.
  Thread.Sleep(5000);
  // We should be able to reconnect to it now (maybe not really, but just assume we can for now).
  port.Open();
}

I get a "Port COM 3 does not exist", but if I look in Device Manager, COM 3 clearly exists. I cannot re-open the port until I power off my device AND close my program, then bring them both back up. This happens on XP, Vista, and Win7.

NOTE: This is not just a problem with my program - this also happens with HyperTerminal!

My colleagues and I suspect it's a problem with the driver, so I've been looking to see if I can find an alternative one.

What is the best way to handle this? I have to run some unattended tests that can last 12 or more hours, so if the device resets I can't really automatically close and re-open my program (well, I suppose I could, but I suspect that's more work than I have time to do, and I'd rather not have to keep track of the entire program state and restore it).

Thanks,

Dybs

The shout of progress is not "Eureka!" it's "Strange... that's not what i expected". - peterchen

AnswerRe: "Port 'COM 3' does not exist"...Except when it does Pin
Luc Pattyn5-Dec-09 16:29
sitebuilderLuc Pattyn5-Dec-09 16:29 
GeneralRe: "Port 'COM 3' does not exist"...Except when it does Pin
dybs5-Dec-09 17:14
dybs5-Dec-09 17:14 
AnswerRe: "Port 'COM 3' does not exist"...Except when it does Pin
fat_boy14-Jan-10 5:47
fat_boy14-Jan-10 5:47 
Questionwhy RES file contain ICO file path? Pin
HOW WHAT3-Dec-09 17:05
HOW WHAT3-Dec-09 17:05 
AnswerRe: why RES file contain ICO file path? Pin
Richard MacCutchan4-Dec-09 23:54
mveRichard MacCutchan4-Dec-09 23:54 
QuestionPL/M-86 Pin
srbohra26-Nov-09 2:56
srbohra26-Nov-09 2:56 
AnswerRe: PL/M-86 Pin
Richard MacCutchan26-Nov-09 3:19
mveRichard MacCutchan26-Nov-09 3:19 
GeneralRe: PL/M-86 [modified] Pin
srbohra26-Nov-09 19:08
srbohra26-Nov-09 19:08 
GeneralRe: PL/M-86 Pin
Richard MacCutchan26-Nov-09 21:32
mveRichard MacCutchan26-Nov-09 21:32 
AnswerRe: PL/M-86 Pin
Luc Pattyn27-Nov-09 0:34
sitebuilderLuc Pattyn27-Nov-09 0:34 
GeneralRe: PL/M-86 Pin
srbohra27-Nov-09 1:24
srbohra27-Nov-09 1:24 
QuestionHow to add CDFS on USB drive Pin
SNI25-Nov-09 5:13
SNI25-Nov-09 5:13 
QuestionPlay all movie in camcorder Pin
Mekong River24-Nov-09 17:41
Mekong River24-Nov-09 17:41 
AnswerRe: Play all movie in camcorder Pin
RWolff8-Jan-10 17:59
RWolff8-Jan-10 17:59 
QuestionIntel Atom Pin
Mekong River23-Nov-09 15:06
Mekong River23-Nov-09 15:06 
AnswerRe: Intel Atom Pin
Dan Neely24-Nov-09 2:34
Dan Neely24-Nov-09 2:34 
QuestionHow to convert any DVD and videos to iPod Touch/Classic/Nano with only one tool Pin
lilihan18-Nov-09 21:25
lilihan18-Nov-09 21:25 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.