Article View: borland.public.cppbuilder.nativeapi
Article #6475Re: Response not in que?
From: Remy Lebeau (TeamB)
Date: Wed, 11 May 2005 17:06
Date: Wed, 11 May 2005 17:06
36 lines
2843 bytes
2843 bytes
"Neil P." <nporve01@hotmail.com> wrote in message news:42820cad$1@newsgroups.borland.com... > I don't use CheckCommStatus() anywhere in my snippet? I meant ClearCommError(), sorry. > I tested the respond time of the embeded unit using Hyperterminal > and it never fails ( < 1ms) you can't even time it, if all your using is > Hyperterminal, just see that it always respond immediately. Then that suggests your code really is not set up properly, if it is taking up to 10 seconds to get that response. I am still of the opinion that you need to get rid of ClearCommError() altogether, for the purpose of polling thequeue status anyway. If the code still runs slowly after removing it, then something else is still messed up in your remaining code. My guess would be that either 1) you did not actually configure the baud rate correctly in your code, or 2) you did not set up the timeouts properly when you opened the serial port. But I cannot say for sure, because you never showed any of that code yet. > I don't understand why? Everything tells me the byte should be there > and maybe it is, but definetly I am doing something terribly wrong in > my Read snippet, because I am not getting that byte???? You are not using overlaped I/O properly to begin with, because you are relying on your queue status and not the overlapped status. For that matter, since your code is processing in a serialized manner anyway, your Read() method can't return until the reading actually finsihes, so why are you using overlapped I/O at all? It is not gaining you anythig in this situation, so you could just remove it altogether and let ReadFile() operate synchronously instead. Gambit
Technical Details
Message-ID:
<42823b43$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<427fa27e@newsgroups.borland.com> <vugv711ona1kdbekucqqkg6csqkcd4agrd@4ax.com> <427fca8b$1@newsgroups.borland.com> <427fce92$1@newsgroups.borland.com> <427fd0af@newsgroups.borland.com> <427ff371$1@newsgroups.borland.com> <42820cad$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,369fa724017da622 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <427fa27e@newsgroups.borland.com> <vugv711ona1kdbekucqqkg6csqkcd4agrd@4ax.com> <427fca8b$1@newsgroups.borland.com> <427fce92$1@newsgroups.borland.com> <427fd0af@newsgroups.borland.com> <427ff371$1@newsgroups.borland.com> <42820cad$1@newsgroups.borland.com> Subject: Re: Response not in que? Date: Wed, 11 May 2005 10:06:01 -0700 Lines: 38 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <42823b43$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1115831107 68.69.17.41 (11 May 2005 10:05:07 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail