In article <947597144.1660.0.nnrp-09.c2de4527@news.demon.co.uk>, "TAMS Team" wrote: > How do I read and write to a serial port (e.g. COM2) using Ada? What > we intend to do is read serial data coming down an RS422 line > formatted to RS100 protocol, and also transmit back up using the same > standards. The flip answer is that you can do it the same way you'd do it in C. Just call the appropriate system calls. However, depending on your OS (and perhaps on your compiler) there may be an even easier way. But, to quote from the Microsoft documentation, "Serial communications in Microsoft� Win32� is significantly different from serial communications in 16-bit Microsoft Windows�." DOS is different yet agian. If your needs are simple, you may be able to just open the "COM2:" port using Ada.Sequential_IO. When I had to do this same thing on WinNT, I used the CreateFile system call to open the port, so that I could set the parity etc. from my program and use the blocking, non-blocking I/O, and timed I/O calls. So what we get down to is that I'm not really sure what your question is. I've listed below some possiblities, along with their answers: Q: Do I need system calls to do this? A: Maybe, it depends on what OS you are using. Q: Can an Ada program make system calls? A: Yes. Q: What system calls do I need to make to do this? A: That isn't an Ada question, its an OS question. It also depends on your exact I/O needs (eg: Blocking or non-blocking? Timeouts or no timeouts? What does your protocol look like?) Q: How do I make OS calls in Ada? A: Check your compiler docs. If you are still confused after that, post your questions here, making sure to mention your compiler and target OS. -- T.E.D. Sent via Deja.com http://www.deja.com/ Before you buy.