comp.lang.ada
 help / color / mirror / Atom feed
* Need your help. How to use ada communicate with hardware? ---A beginner
@ 2002-04-11 17:49 Jamie
  2002-04-11 19:41 ` Dan Andreatta
  2002-04-12 13:36 ` Stephen Leake
  0 siblings, 2 replies; 3+ messages in thread
From: Jamie @ 2002-04-11 17:49 UTC (permalink / raw)


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.



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

* Re: Need your help. How to use ada communicate with hardware? ---A beginner
  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
  2002-04-12 13:36 ` Stephen Leake
  1 sibling, 0 replies; 3+ messages in thread
From: Dan Andreatta @ 2002-04-11 19:41 UTC (permalink / raw)


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



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

* Re: Need your help. How to use ada communicate with hardware? ---A beginner
  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
@ 2002-04-12 13:36 ` Stephen Leake
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Leake @ 2002-04-12 13:36 UTC (permalink / raw)


kz105@student.cs.york.ac.uk (Jamie) writes:

> 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.

You need to say what operating system you are using. 

I'll go out on a not-very-long limb and assume Windows. If that is
true, you can use my binding to the Windows comm ports:

http://users.erols.com/leakstan/Stephe/Ada/win32_com_ports.zip

-- 
-- Stephe



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

end of thread, other threads:[~2002-04-12 13:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
2002-04-12 13:36 ` Stephen Leake

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