Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > TimeOut Serial Port

Reply
Thread Tools

TimeOut Serial Port

 
 
Steffen
Guest
Posts: n/a
 
      12-01-2004
Hello!

I'm excanging data with an microcontroller (Atmel) via the serial port.

My C++ programm is written in Microsoft Visual Studio .net (7)
I have the following problem:

If I disconnect my controller, then the programm hangs up in the following
line:
WaitCommEvent (m_hCommPort, &dwEvtMask, 0);

Of course it does - but I need to get a TimeOut. After 50 ms the function
should quit and return an timeout message.

Can anybody help me? Would really be great.
Thank you in advance!
Best regards
Steffen


 
Reply With Quote
 
 
 
 
Victor Bazarov
Guest
Posts: n/a
 
      12-01-2004
Steffen wrote:
> I'm excanging data with an microcontroller (Atmel) via the serial port.
>
> My C++ programm is written in Microsoft Visual Studio .net (7)
> I have the following problem:
>
> If I disconnect my controller, then the programm hangs up in the following
> line:
> WaitCommEvent (m_hCommPort, &dwEvtMask, 0);
>
> Of course it does - but I need to get a TimeOut. After 50 ms the function
> should quit and return an timeout message.
>
> Can anybody help me? Would really be great.


AFAICT, 'WaitCommEvent' is not a standard C++ function. Your best bet is
to ask about it in a newsgroup dedicated to your OS or your compiler. For
VC++.NET try comp.os.ms-windows.programmer.* or microsoft.public.vc.*

V
 
Reply With Quote
 
 
 
 
Steffen
Guest
Posts: n/a
 
      12-01-2004
Thank you very much!
I will try it in an other newsgroup.

Steffen


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
emulate a serial port in windows (create a virtual 'com' port) Pom Python 2 01-31-2007 07:49 PM
Timeout::timeout and Socket timeout Mark Probert Ruby 1 10-06-2004 09:30 AM
Can I connect router Serial interface directly to a PC serial port? Faustino Dina Cisco 2 08-18-2004 02:30 AM
Re: Serial port and PS/2 port schematics OR Assistive Tech. suggestion naive.verizon@locality.net Computer Support 1 07-10-2003 11:46 AM
Re: Serial port and PS/2 port schematics °Mike° Computer Support 1 07-09-2003 10:30 PM



Advertisments