🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #4115

Re: Serial port management with RTS_TOGGLE

#4115
From: SF
Date: Fri, 17 Mar 2006 13:12
52 lines
2736 bytes
> The way to enable the TX section of RS485 transceiver is
> drive the RTS signal, so I used the SetCommState API setting
> the fRtsControl field of DCB to RTS_TOGGLE value.

> This approach works fine in any PC I tried from Windows95
> to WinXP.

IMHO, you've only been lucky.

At first, RTS_CONTROL_TOGGLE is not supported under Win95, Win98 
and WinMe as stated in MSDN: 
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/devio/base/dcb_str.asp.

Secondly, as far as I know, there's no way to control the real 
end of transmission under WindowsNT/2000/XP. In the old time of 
DOS, we could read the status of the shift register. That could 
also be done under Win95/98 although not a clean solution. 
Nevertheless, through Windows API, we can check the status 
(empty or not) of the trasmission buffer that is not necessary 
the serial trasmission status (finished or not).

> I have a problem on a DELL notebook with WinXP SP2 and 
> CENTRINO processor.
> My application sends a frame but RTS signal remains high for 
> 15 ms.
> instead of 1-2 ms.!!!!!

That's strange, anyway. RTS goes down sooner than the end of 
transmission, usually. Maybe a particular serial driver is 
installed there.

> I tried to install the trial versione of BDS2006 and recompile 
> my
> project and...suprise...it works well and RTS signal goes down
> in 1 ms.!

I don't know about this.

> Is there someone can explain me this behaviour?

Not the last one. Instead, about how to handle properly a 485 
transmission under WinXP, well, I've been looking for a good 
solution for years... no one found so far.

> How can I work around this bug using C++Builder6?

A good suggestion? Use a "smart" 232/485 converter. No need to 
drive the RTS signal any more.

HTH,

Stefano. 
Technical Details
Message-ID: <441ab5ad@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <441a6f41@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,1bf375dcfb8a7ea5
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "SF" <invalid@NOSPAMinvalid.com>
From: "SF" <invalid@NOSPAMinvalid.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <441a6f41@newsgroups.borland.com>
Subject: Re: Serial port management with RTS_TOGGLE
Date: Fri, 17 Mar 2006 14:12:38 +0100
Lines: 54
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.2180
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
X-RFC2646: Format=Flowed; Response
NNTP-Posting-Host: 81.208.124.114
Message-ID: <441ab5ad@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1142601133 81.208.124.114 (17 Mar 2006 05:12:13 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!news4.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail