comp.lang.ada
 help / color / mirror / Atom feed
* serial port programming
@ 2001-05-30 16:13 EtienneB
  2001-05-30 17:17 ` David C. Hoos, Sr.
  0 siblings, 1 reply; 15+ messages in thread
From: EtienneB @ 2001-05-30 16:13 UTC (permalink / raw)


I'd like to know if there is a way (library or anything else) to program the
serial port on a PC (is it OS dependant ?)

Thanks
Etienne Baudin





^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: serial port programming
  2001-05-30 16:13 serial port programming EtienneB
@ 2001-05-30 17:17 ` David C. Hoos, Sr.
  2001-05-30 17:40   ` EtienneB
  0 siblings, 1 reply; 15+ messages in thread
From: David C. Hoos, Sr. @ 2001-05-30 17:17 UTC (permalink / raw)


It is OS-dependent -- so, naturally, that leads to the question -- which OS/

"EtienneB" <etienne.baudin@wanadoo.fr> wrote in message
news:E_8R6.2486$Au7.4142207@nnrp5.proxad.net...
> I'd like to know if there is a way (library or anything else) to program
the
> serial port on a PC (is it OS dependant ?)
>
> Thanks
> Etienne Baudin
>
>





^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: serial port programming
  2001-05-30 17:17 ` David C. Hoos, Sr.
@ 2001-05-30 17:40   ` EtienneB
  2001-05-30 20:12     ` Ted Dennison
  2001-05-30 20:24     ` Stephen Leake
  0 siblings, 2 replies; 15+ messages in thread
From: EtienneB @ 2001-05-30 17:40 UTC (permalink / raw)


> It is OS-dependent -- so, naturally, that leads to the question -- which
OS/
I thought it may exist portable libs...

=>    For win9x or NT

Thanks
Etienne Baudin





^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: serial port programming
  2001-05-30 17:40   ` EtienneB
@ 2001-05-30 20:12     ` Ted Dennison
  2001-05-31  3:15       ` Randy Brukardt
  2001-05-30 20:24     ` Stephen Leake
  1 sibling, 1 reply; 15+ messages in thread
From: Ted Dennison @ 2001-05-30 20:12 UTC (permalink / raw)


In article <SfaR6.2518$Fw2.4216934@nnrp5.proxad.net>, EtienneB says...
>
>I thought it may exist portable libs...
>
>=>    For win9x or NT

None that I know of (not even for non-Ada languages).

For NT there are special serial port mode setting calls you can make, which may
or may not work on 9x. You should consult a good Win32 reference manual. If you
are using Gnat, there are bindings the Win32 system calls that come with the
compiler. I believe the same goes for Aonix.

Also, there's most likely a nice, high-level way to do it with the Claw
facility.

---
T.E.D.    homepage   - http://www.telepath.com/dennison/Ted/TED.html
          home email - mailto:dennison@telepath.com



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: serial port programming
  2001-05-30 17:40   ` EtienneB
  2001-05-30 20:12     ` Ted Dennison
@ 2001-05-30 20:24     ` Stephen Leake
  2001-06-01  2:36       ` DuckE
  1 sibling, 1 reply; 15+ messages in thread
From: Stephen Leake @ 2001-05-30 20:24 UTC (permalink / raw)


"EtienneB" <etienne.baudin@wanadoo.fr> writes:

> > It is OS-dependent -- so, naturally, that leads to the question -- which
> OS/
> I thought it may exist portable libs...
> 
> =>    For win9x or NT

http://users.erols.com/leakstan/Stephe/index.html

get the "com_ports" package.

-- 
-- Stephe



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: serial port programming
  2001-05-30 20:12     ` Ted Dennison
@ 2001-05-31  3:15       ` Randy Brukardt
  2001-06-01  0:21         ` Stream IO, was " tmoran
  0 siblings, 1 reply; 15+ messages in thread
From: Randy Brukardt @ 2001-05-31  3:15 UTC (permalink / raw)


Ted Dennison wrote in message ...
>In article <SfaR6.2518$Fw2.4216934@nnrp5.proxad.net>, EtienneB says...
>>
>>I thought it may exist portable libs...
>>
>>=>    For win9x or NT
>
>None that I know of (not even for non-Ada languages).
>
>For NT there are special serial port mode setting calls you can make,
which may
>or may not work on 9x. You should consult a good Win32 reference
manual. If you
>are using Gnat, there are bindings the Win32 system calls that come
with the
>compiler. I believe the same goes for Aonix.


The serial port mode routines do work on 9x etc.

>Also, there's most likely a nice, high-level way to do it with the Claw
>facility.


Thanks for the plug, but in fact there isn't a facility in Claw for
this. When we started building Claw, we decided to avoid creating stuff
that already exists in Ada 95. I/O clearly is in that category, although
the serial port access clearly is a special case. It would be easy
enough to build such a thing (Janus/Ada has a package for that purpose,
based on the Windows 3.1 (16-bit) version of serial access; adapting
that code to use Streams wouldn't be too hard). But, of course, we only
promise to implement new features for customers.

            Randy Brukardt
            R.R. Software, Inc.






^ permalink raw reply	[flat|nested] 15+ messages in thread

* Stream IO, was Re: serial port programming
  2001-05-31  3:15       ` Randy Brukardt
@ 2001-06-01  0:21         ` tmoran
  0 siblings, 0 replies; 15+ messages in thread
From: tmoran @ 2001-06-01  0:21 UTC (permalink / raw)


>Thanks for the plug, but in fact there isn't a facility in Claw for
>this. When we started building Claw, we decided to avoid creating stuff
>...
>that code to use Streams wouldn't be too hard).
  Directly using Stream input may block, which is often undesirable.
Claw contains a Marshalling package that makes it easy to do 'read,
'write with automatic buffers, and do the IO with a full buffer.
That's available for sockets and for the clipboard, and could be used
for serial IO equally well.



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: serial port programming
  2001-05-30 20:24     ` Stephen Leake
@ 2001-06-01  2:36       ` DuckE
  0 siblings, 0 replies; 15+ messages in thread
From: DuckE @ 2001-06-01  2:36 UTC (permalink / raw)


A word of caution, this version appears to not handle overlapped I/O.  This
only comes into play if you plan on having separate tasks reading and
writing the same serial port.  If you need that capability I'm sure I can
dig up my driver that does handle overlapped I/O.

SteveD


"Stephen Leake" <stephen.a.leake.1@gsfc.nasa.gov> wrote in message
news:uitiitwje.fsf@gsfc.nasa.gov...
> "EtienneB" <etienne.baudin@wanadoo.fr> writes:
>
> > > It is OS-dependent -- so, naturally, that leads to the question --
which
> > OS/
> > I thought it may exist portable libs...
> >
> > =>    For win9x or NT
>
> http://users.erols.com/leakstan/Stephe/index.html
>
> get the "com_ports" package.
>
> --
> -- Stephe





^ permalink raw reply	[flat|nested] 15+ messages in thread

* Serial port programming.
@ 2003-01-23 22:47 Goochie
  2003-01-24  0:25 ` John R. Strohm
                   ` (4 more replies)
  0 siblings, 5 replies; 15+ messages in thread
From: Goochie @ 2003-01-23 22:47 UTC (permalink / raw)


Hi,

I'm totally new to programming in Ada and I need some help with writing code
so I can access the serial port. Initiallt I have to try and do this using
Object Ada on an Intel based PC.

Can anyone give me any pointer to example code or documentation?

Thanks

Goochie





^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Serial port programming.
  2003-01-23 22:47 Serial " Goochie
@ 2003-01-24  0:25 ` John R. Strohm
  2003-01-24  3:38 ` Steve
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 15+ messages in thread
From: John R. Strohm @ 2003-01-24  0:25 UTC (permalink / raw)


There are two parts to your problem.

1) Physically accessing the port.
  1a) Writing to the chip
  1b) Reading from the chip
  1c) Connecting up an interrupt handler

2) What you do with it once you can access it.

Part 1 will vary from toolset to toolset, but the Object Ada vendor should
have example code.

Part 2 has been the subject of literally HUNDREDS of books over the last 20
years.  The books generally address the details in C or 80x86 assembly
language.  Conversion of most of this to Ada will be straightforward, once
you have Part 1 in place.

"Goochie" <nigel_gooch@lineone.net> wrote in message
news:3e3070f8$1_2@mk-nntp-1.news.uk.worldonline.com...
> Hi,
>
> I'm totally new to programming in Ada and I need some help with writing
code
> so I can access the serial port. Initiallt I have to try and do this using
> Object Ada on an Intel based PC.
>
> Can anyone give me any pointer to example code or documentation?
>
> Thanks
>
> Goochie
>
>





^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Serial port programming.
  2003-01-23 22:47 Serial " Goochie
  2003-01-24  0:25 ` John R. Strohm
@ 2003-01-24  3:38 ` Steve
  2003-01-28 19:54   ` Goochie
  2003-01-24 15:18 ` Jerry Petrey
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 15+ messages in thread
From: Steve @ 2003-01-24  3:38 UTC (permalink / raw)


"Goochie" <nigel_gooch@lineone.net> wrote in message
news:3e3070f8$1_2@mk-nntp-1.news.uk.worldonline.com...
> Hi,
>
> I'm totally new to programming in Ada and I need some help with writing
code
> so I can access the serial port. Initiallt I have to try and do this using
> Object Ada on an Intel based PC.

Looking at the ObjectAda web site, it appears ObjectAda is available for
Windows, Unix, Real-Time/Embedded, Real-Time/Raven, Real-Time/Tornado,
Real-Time/LinxOS.  Which one of these are you using?

It is unlikely you will have to do low level programming of the serial chip.
It is more likely that you just need to figure out how to call the OS/Kernel
routines to do the work for you.

Which OS?

If it happens to be Windows NT/W2k, I have a nice thick binding I can send.

Steve
(The Duck)

> Can anyone give me any pointer to example code or documentation?
>
> Thanks
>
> Goochie
>
>





^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Serial port programming.
  2003-01-23 22:47 Serial " Goochie
  2003-01-24  0:25 ` John R. Strohm
  2003-01-24  3:38 ` Steve
@ 2003-01-24 15:18 ` Jerry Petrey
  2003-01-26 18:16 ` William J. Thomsa
  2003-01-28 18:04 ` Goochie
  4 siblings, 0 replies; 15+ messages in thread
From: Jerry Petrey @ 2003-01-24 15:18 UTC (permalink / raw)




Goochie wrote:

> Hi,
>
> I'm totally new to programming in Ada and I need some help with writing code
> so I can access the serial port. Initiallt I have to try and do this using
> Object Ada on an Intel based PC.
>
> Can anyone give me any pointer to example code or documentation?
>
> Thanks
>
> Goochie

I have recently  used Stephen Leake's com port package to do a serial port
driver for a hardware
simulator GUI application running on Windows and using GNAT Ada.  Take a look at
his
packages at http://users.erols.com/leakstan/Stephe/ .  I made some small
modifications to suit my
needs (to handle pure binary data rather than ASCII data) but I think you will
find these very
helpful.

Jerry
--
---------------------------------------------------------------------------------

-- Jerry Petrey
-- Senior Principal Systems Engineer - Navigation (GPS/INS), Guidance, & Control

-- Raytheon Missile Systems          - Member Team Ada & Team Forth
-- NOTE: please remove <NOSPAM> in email address to reply
---------------------------------------------------------------------------------






^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Serial port programming.
  2003-01-23 22:47 Serial " Goochie
                   ` (2 preceding siblings ...)
  2003-01-24 15:18 ` Jerry Petrey
@ 2003-01-26 18:16 ` William J. Thomsa
  2003-01-28 18:04 ` Goochie
  4 siblings, 0 replies; 15+ messages in thread
From: William J. Thomsa @ 2003-01-26 18:16 UTC (permalink / raw)


If you look in the Win32 help that comes with ObjectAda (not the AdaWin32
help, but the orig one from MS), and look up Communications that will take
you to a section that explains all of the functions associated with serial
communications in Win32.

The next thing you want to look for is an article (on msdn.microsoft.com)
entitled "Serial Communications in Win32". This white paper tells you all
about using the above mentioned functions using Overlapped IO which allows
you to set up event, receive and transmit tasks to service the ports.

The whole subject can get quite complex but if you stick with it you can
acheive a nice abstraction for a "port" (using taksking) that will not spend
most of its time polling the ports for traffic.

WJT





^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Serial port programming.
  2003-01-23 22:47 Serial " Goochie
                   ` (3 preceding siblings ...)
  2003-01-26 18:16 ` William J. Thomsa
@ 2003-01-28 18:04 ` Goochie
  4 siblings, 0 replies; 15+ messages in thread
From: Goochie @ 2003-01-28 18:04 UTC (permalink / raw)


Thank you all for your replies.

"Goochie" <nigel_gooch@lineone.net> wrote in message
news:3e3070f8$1_2@mk-nntp-1.news.uk.worldonline.com...
> Hi,
>
> I'm totally new to programming in Ada and I need some help with writing
code
> so I can access the serial port. Initiallt I have to try and do this using
> Object Ada on an Intel based PC.
>
> Can anyone give me any pointer to example code or documentation?
>
> Thanks
>
> Goochie
>
>





^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Serial port programming.
  2003-01-24  3:38 ` Steve
@ 2003-01-28 19:54   ` Goochie
  0 siblings, 0 replies; 15+ messages in thread
From: Goochie @ 2003-01-28 19:54 UTC (permalink / raw)


Steve,

I have to access the COM ports of a PC which is run under the WinNT
operating system. Any help would be greatfully received.

Thanks

Goochie
"Steve" <nospam_steved94@attbi.com> wrote in message
news:uy2Y9.14811$eM6.22827@rwcrnsc51.ops.asp.att.net...
> "Goochie" <nigel_gooch@lineone.net> wrote in message
> news:3e3070f8$1_2@mk-nntp-1.news.uk.worldonline.com...
> > Hi,
> >
> > I'm totally new to programming in Ada and I need some help with writing
> code
> > so I can access the serial port. Initiallt I have to try and do this
using
> > Object Ada on an Intel based PC.
>
> Looking at the ObjectAda web site, it appears ObjectAda is available for
> Windows, Unix, Real-Time/Embedded, Real-Time/Raven, Real-Time/Tornado,
> Real-Time/LinxOS.  Which one of these are you using?
>
> It is unlikely you will have to do low level programming of the serial
chip.
> It is more likely that you just need to figure out how to call the
OS/Kernel
> routines to do the work for you.
>
> Which OS?
>
> If it happens to be Windows NT/W2k, I have a nice thick binding I can
send.
>
> Steve
> (The Duck)
>
> > Can anyone give me any pointer to example code or documentation?
> >
> > Thanks
> >
> > Goochie
> >
> >
>
>





^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2003-01-28 19:54 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-05-30 16:13 serial port programming EtienneB
2001-05-30 17:17 ` David C. Hoos, Sr.
2001-05-30 17:40   ` EtienneB
2001-05-30 20:12     ` Ted Dennison
2001-05-31  3:15       ` Randy Brukardt
2001-06-01  0:21         ` Stream IO, was " tmoran
2001-05-30 20:24     ` Stephen Leake
2001-06-01  2:36       ` DuckE
  -- strict thread matches above, loose matches on Subject: below --
2003-01-23 22:47 Serial " Goochie
2003-01-24  0:25 ` John R. Strohm
2003-01-24  3:38 ` Steve
2003-01-28 19:54   ` Goochie
2003-01-24 15:18 ` Jerry Petrey
2003-01-26 18:16 ` William J. Thomsa
2003-01-28 18:04 ` Goochie

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