Article View: borland.public.cppbuilder.nativeapi
Article #4841Re: RTS_CONTROL_TOGGLE
From: Jim Dodd
Date: Wed, 16 Nov 2005 13:22
Date: Wed, 16 Nov 2005 13:22
26 lines
2171 bytes
2171 bytes
Roland wrote: > Hi, > > I have a problem with the serial communication. I have to program a serial transfer which uses the RTS line to toggle the data direction of an RS485 device. So I need in principe a functionality like described for the DCB structure using RTS_CONTROL_TOGGLE for .fRtsControl. Now according to a ms-bug report (support.microsoft.com/support/kb/articles/Q140/0/30.asp) it doesn't work properly. As next step i tried using WaitCommEvent and its relatives (using EV_TXEMPTY) causing the result, that the process returns in the middle of the transmittion process and not at its end as described:"EV_TXEMPTY The last character in the output buffer was sent." > > So I not able to control the RTS line in a suitable way. > > Does anybody has a solution for this problem. > > Roland Hi ROland, Our software doesn't use RTS for much but we do need to control it to signal external devices sometimes. We use the EscapeCommFunction() in Win32. You call it with the handle of the comm port device and either SETRTS or CLRRTS as the second argument depending on which polarity you want on the line. This means you have to do all this yourself without Windows handling it for you, though. Regards, Jim Dodd Onset Computer Corp.
Technical Details
Message-ID:
<437b3253$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<437b1cd2$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,fcae495b335d855 X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit Date: Wed, 16 Nov 2005 08:22:10 -0500 From: Jim Dodd <bcbuilderboy@yahoo.com> User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: RTS_CONTROL_TOGGLE References: <437b1cd2$1@newsgroups.borland.com> In-Reply-To: <437b1cd2$1@newsgroups.borland.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 24.75.243.228 Message-ID: <437b3253$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1132147283 24.75.243.228 (16 Nov 2005 05:21:23 -0700) Lines: 26 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail