Open Com activates DTR, how to avoid ?

For issues with communication ports, protocols, etc.
Post Reply
jmg
Posts: 89
Joined: Mar 11, 2009 3:42

Open Com activates DTR, how to avoid ?

Post by jmg »

In experimenting with FreeBASIC I find Open COM activates DTR on open, and I can control the width of that pulse with a later command to de-assert DTR, but I cannot find a way to avoid that initial assert ?
Ideally, I want to connect to a port and some time later assert DTR

I have C and Pascal pgms that can open serial without this effect, so I know it is possible. ie not a HW or Windows dictate

The change log has only this single mention of DTR, way, way, back in Version 0.17 Beta:
- Serial driver on windows was not setting DTR high when opening the device (jeffm)
Some may want this feature, but it would be more useful to have user control over this at open com time ?
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Open Com activates DTR, how to avoid ?

Post by MrSwiss »

Simple, you go and read FB-Manual: Open Com (statement).
Scroll down to the "extended_options" (table).
jmg
Posts: 89
Joined: Mar 11, 2009 3:42

Re: Open Com activates DTR, how to avoid ?

Post by jmg »

MrSwiss wrote:Simple, you go and read FB-Manual: Open Com (statement).
Scroll down to the "extended_options" (table).
Not quite. Those options do not control the assert of DTR, they only control the default width.
What I am looking for is a way to not assert DTR at all, on open. DSn does not provide that.
DamageX
Posts: 130
Joined: Nov 21, 2009 8:42

Re: Open Com activates DTR, how to avoid ?

Post by DamageX »

In the win32 API you can control this with SetCommState. But you need a handle to an open port before you can use SetCommState... so I'm not sure how it would be possible. What if you open the port as write-only??
Post Reply