home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / lang / pascal / 6448 < prev    next >
Encoding:
Internet Message Format  |  1992-11-09  |  1.5 KB

  1. 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
  2. From: newton@digsol.jpunix.com (Michael Nichols)
  3. Newsgroups: comp.lang.pascal
  4. Subject: Re: Serial port communications in turbo pascal? (COM ports)
  5. Message-ID: <2wiXTB1w165w@digsol.jpunix.com>
  6. Date: Sun, 08 Nov 92 10:42:12 CST
  7. References: <1992Nov6.045149.8295@news.ysu.edu>
  8. Organization: Digital Solutions, Inc. Houston, TX.
  9. Lines: 40
  10.  
  11. ae769@yfn.ysu.edu (Ritesh Patel) writes:
  12.  
  13. > What are the different ways of sending codes to the serial ports i.e. COM1, 
  14. > COM2 ...
  15. > I know there are programs that send codes from the dos command line but
  16. > I need to do this from inside a turbo pascal program.
  17. > Is there something similar to Lst [print (lst, 'hello')] available for the
  18. > serial ports?
  19. > -- 
  20.  
  21.  
  22. In TP 3.0, there is the device, AUX, which can be used for Auxiliary I/O, 
  23. such as for a modem.  It replaces RDR: and PUN: in CP/M and most likely 
  24. the COM ports as well.  In CP/M, RDR: and PUN: are one-way ports.  In 
  25. DOS, I don't know, but experimenting with AUX should give you results.  
  26. Try something like:
  27.  
  28. program ModemTest;
  29.  
  30. begin
  31.    writeln(aux,'ATQ0V1S0=0S7=5');  { or whatever your modem init is }
  32.    delay(5000);
  33.    writeln(aux,'ATM1');
  34.    delay(5000);
  35.    writeln(aux,'ATH1');
  36.    delay(5000);
  37. end.
  38.  
  39. If you use that on a Hayes-compatible modem, you should get a dial tone 
  40. after about ten-seconds.
  41.  
  42. Let me know if it works,
  43. Mike Nichols
  44. newton@digsol.jpunix.com
  45.