home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!news.tek.com!uw-beaver!micro-heart-of-gold.mit.edu!xn.ll.mit.edu!ames!saimiri.primate.wisc.edu!zaphod.mps.ohio-state.edu!menudo.uh.edu!buster!jpunix!digsol!newton
- From: newton@digsol.jpunix.com (Michael Nichols)
- Newsgroups: comp.lang.pascal
- Subject: Re: Serial port communications in turbo pascal? (COM ports)
- Message-ID: <2wiXTB1w165w@digsol.jpunix.com>
- Date: Sun, 08 Nov 92 10:42:12 CST
- References: <1992Nov6.045149.8295@news.ysu.edu>
- Organization: Digital Solutions, Inc. Houston, TX.
- Lines: 40
-
- ae769@yfn.ysu.edu (Ritesh Patel) writes:
-
- >
- > What are the different ways of sending codes to the serial ports i.e. COM1,
- > COM2 ...
- >
- > I know there are programs that send codes from the dos command line but
- > I need to do this from inside a turbo pascal program.
- >
- > Is there something similar to Lst [print (lst, 'hello')] available for the
- > serial ports?
- >
- >
- > --
- >
-
-
- In TP 3.0, there is the device, AUX, which can be used for Auxiliary I/O,
- such as for a modem. It replaces RDR: and PUN: in CP/M and most likely
- the COM ports as well. In CP/M, RDR: and PUN: are one-way ports. In
- DOS, I don't know, but experimenting with AUX should give you results.
- Try something like:
-
- program ModemTest;
-
- begin
- writeln(aux,'ATQ0V1S0=0S7=5'); { or whatever your modem init is }
- delay(5000);
- writeln(aux,'ATM1');
- delay(5000);
- writeln(aux,'ATH1');
- delay(5000);
- end.
-
- If you use that on a Hayes-compatible modem, you should get a dial tone
- after about ten-seconds.
-
- Let me know if it works,
- Mike Nichols
- newton@digsol.jpunix.com
-