comp.lang.ada
 help / color / mirror / Atom feed
From: lynch@cci.de
Subject: Re: Win NT + Object Ada: serial port I/O
Date: 1999/02/16
Date: 1999-02-16T00:00:00+00:00	[thread overview]
Message-ID: <7abh8g$bvh$1@nnrp1.dejanews.com> (raw)
In-Reply-To: 79cu2a$4iu$1@nnrp1.dejanews.com

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 3047 bytes --]

In article <79cu2a$4iu$1@nnrp1.dejanews.com>,
  dennison@telepath.com wrote:
> In article <79952r$2t$1@nnrp1.dejanews.com>,
>   lynch@cci.de wrote:
> > Does anyone have any information/experience programming serial ports in Ada
on
> > a Windows platform? I can think of two ways to do this:
>
> If you mean a win32 platform, I have done that. I wrote a program to
> communicate with another machine via a com port on an NT 3.5 machine using
> the old vads Ada83.
>
> > 1) Use the standard Ada.*.IO routines on the file "COM1:". I tested this
with
> >    a) It seems the port needs to be "initialized" by calling MODE COM1: in a
> >       console window, even though the settings are exactly the same as those
> >       in the windows control panel.
>
> There's a Win32 system call to do this for you. Check your documentation.

Which documentation? As I've mentioned before the "documentation" (ring binder
and online help files) that comes with Object Ada is more than useless.

I now know of BuildCommDCB() and SetCommState() etc. but only because I have
seen them in the sample code so kindly provided by various people.


> > 2) Use the Win32Ada binding with CreateFile, SetCommTimeouts etc. however
the
> >  help file provided with Object Ada is utterly useless. I have yet to find
[...]
> Its not quite that simple. Your serial settings have to match the settings the
> machine on the other end is using. Since there's no way for a "higer-level"
> binding to know that information ahead of time. You *have* to have the mode
> call.

Well, the device on the other end is fixed at 9600 8N1. The PC will be
running Windows NT 4.0 and our software, nothing else. We had naively assumed
the settings in the Control Panel would be used as defaults, however the
ports always default to 1200 7E1 no matter we set in the Control Panel. I
have no idea what Windows uses those settings for... (I am talking about
Einstellungen- Systemsteuerung-Anschl�sse on German NT, not sure about the
English name)

I know this is off-topic, but if anyone could shed a light onto what NT uses
the serial settings in Control Panel for I would be most grateful...


Back on topic, I created a simple prototype DLL providing open, read and write
functionality. Object Ada compiles this into 400K, which I have been told is
totally unacceptable. I have checked the "remove uncalled code" box, also this
is a Release version with no debugging information.

I was expecting some overhead from the Ada runtime, but 400K is rather a lot.
Most of this is due to a section in the DLL called .av_dbgi, containing
initialized data. What is this and is there any way to reduce its size?

For comparison I tried to create a DLL with Gnat, using dlltool, however the
instructions (building-dlls.txt) only talk about C code. Is it possible to
create DLLs with Gnat? ld fails with missing symbols from the Ada runtime.

Andrew.

-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/       Search, Read, Discuss, or Start Your Own    




  parent reply	other threads:[~1999-02-16  0:00 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-02-03  0:00 Win NT + Object Ada: serial port I/O lynch
1999-02-03  0:00 ` news.oxy.com
1999-02-04  0:00   ` lynch
1999-02-04  0:00     ` news.oxy.com
1999-02-04  0:00 ` dennison
1999-02-04  0:00   ` Tom Moran
1999-02-16  0:00   ` lynch [this message]
1999-02-16  0:00     ` dennison
1999-02-16  0:00     ` David C. Hoos, Sr.
1999-02-16  0:00       ` dennison
1999-02-16  0:00     ` dennison
1999-02-17  0:00       ` Peter Hend�n
1999-02-16  0:00     ` Steve Doiel
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox