Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!unix.cis.pitt.edu!cncst From: cncst@unix.cis.pitt.edu (Christophe N. Christoff) Newsgroups: comp.lang.pascal Subject: About Emptying COM1 port Message-ID: <34753@unix.cis.pitt.edu> Date: 4 Sep 90 17:11:16 GMT Reply-To: cncst@unix.cis.pitt.edu (Christophe N. Christoff) Organization: Univ. of Pittsburgh, Comp & Info Services Lines: 56 I asked the question about how to empty COM1 before, and the problem I put there was too simple for a correct anwser. Now I'll tell the problem in details. I used PD program "COMM_TP4.TPU" in SIMTEL to read from COM1. if everything is okey, the program works well. But most of time, i.e., every morning I turn on the machine, the program will not work until I empty COM1 before I load the program. Once the program begins to work, another warm boot will cause no problem, but a cold boot will cause the same problem until I reempty the COM1 port. That is also the case I have to empty the port each morning since it is a cold boot, of course. I tried to find the problem and finally found out that each cold boot causes some characters left in the port. So I tried to empty it from within the program, but from that PD program, I cannot figure out how to do it. And I cannot find out one program to do it without human interruption, I mean without pressing any key. I tried every method I can think off my head, and there is no luck. By the way, one simple way to clear that is at the DOS prompt level, I typed: COPY AUTOEXEC.BAT COM1 > NUL DOS responds: Write fault error writing device COM1 Abort, Retry or Ignore I just choose Abort. This will clear COM1 for me and enable my program to run. But the question is that nobody like this ugly message and further, we have to type "A" which has nothing to do with data collection program. I tried to pipe an "A" to that COPY command, but in this case, PIPELINE command does not work!!! I learnt the pipe commands from folks around net. echo y | del subdir where subdir is a subdirectory name and it is not empty. I used echo a | copy autoexec.bat com1 DOS simply ignore all this pipeline!! Any idea why does pipeline not work? and why a cold boot place something in the COM1 port? I get rid of every resident program and the problem still exists: I use: IBM DOS v3.2 IBM AT with EGA monitor.