comp.lang.ada
 help / color / mirror / Atom feed
From: Dan Andreatta <andreatta@mail.chem.sc.edu.REMOVEME>
Subject: Re: Need your help. How to use ada communicate with hardware? ---A beginner
Date: 11 Apr 2002 12:41:05 -0700
Date: 2002-04-11T12:41:05-07:00	[thread overview]
Message-ID: <Xns91ED95B16DAF9andreattamailchemsce@12.252.202.62> (raw)
In-Reply-To: ba071575.0204110949.747940b@posting.google.com

kz105@student.cs.york.ac.uk (Jamie) wrote in
news:ba071575.0204110949.747940b@posting.google.com: 

> i'm recently learning ada. we have a project needed using computer to
> control a machine. the machine has a microcontroller. i need to write
> some program to communication with it via RS232 serial link. for
> example, i need to ask the status of machine by sending a request, and
> the machine will return a string to the computer. but i don't actually
> know how to use ada to communicate hardware, becasue i'm a beginner of
> programming. some body said that there is a binding to comms port.
> could anyone please show me how to use it with some examples. Thanks.
> 

If you are working w/ Windows, there are two partial bingings for serial
ports. 

ftp://ftp.usafa.af.mil/pub/dfcs/carlisle/serial/serial.zip
http://users.erols.com/leakstan/Stephe/Ada/win32_com_ports.zip

One side note: I found that to read from a serial port (from a photon
counter) I had to change the DCB settings, enabling the DTR and RTS
controls. In Stephe's package, you have to modify two lines (in 
com_ports.adb), from 

Config.FDtrControl := Win32.WinBase.DTR_CONTROL_DISABLE;
Config.FRtsControl := Win32.WinBase.RTS_CONTROL_DISABLE;

to

Config.FDtrControl := Win32.WinBase.DTR_CONTROL_ENABLE;
Config.FRtsControl := Win32.WinBase.RTS_CONTROL_ENABLE;

HTH,
Dan



  reply	other threads:[~2002-04-11 19:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-11 17:49 Need your help. How to use ada communicate with hardware? ---A beginner Jamie
2002-04-11 19:41 ` Dan Andreatta [this message]
2002-04-12 13:36 ` Stephen Leake
replies disabled

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