From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,656febe2966a6347 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-04-11 11:39:58 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!news-out.visi.com!hermes.visi.com!newspump.sol.net!news-xfer.siscom.net!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Need your help. How to use ada communicate with hardware? ---A beginner From: Dan Andreatta References: Message-ID: User-Agent: Xnews/4.11.09 X-Original-NNTP-Posting-Host: 129.252.151.109 Date: 11 Apr 2002 12:41:05 -0700 X-Original-Trace: 11 Apr 2002 12:41:05 -0700, 129.252.151.109 X-COMPLAINTS: Report abuse to abuse@mhogaming.com Organization: Newshosting.com - Highest quality at a great price! www.newshosting.com NNTP-Posting-Host: 2d697c2e.news.newshosting.com X-Trace: DXC=o7GjEkeK:MPNcj5L>2VgW]X`1N4>^k1LSiF6BbIV4YYR 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