Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: print to com port  (Read 7224 times)

0 Members and 1 Guest are viewing this topic.

Rasha

  • Guest
print to com port
« on: July 28, 2004, 12:39:27 PM »
need help!

How,in DOS, print to COM port?

MalikTous

  • Guest
Re: print to com port
« Reply #1 on: July 28, 2004, 12:57:43 PM »
Use MODE.

mode com1:=9600,n,8,1,b
mode prn:=com1:


These two lines set the COM1 port to 9600 bits per second, no parity, 8 data, 1 stop bit, and binary. Substitute the string for your Diablo 630 or whatever you use on a serial port. Then the PRN: (default printer) is assigned to COM1: instead of LPT1:.

mode prn:=lpt1:

can be issued after printing to return the output to your parallel printer.

If you ONLY print to the serial printer, make the first two lines part of your Autoexec.BAT file.
« Last Edit: July 28, 2004, 12:58:29 PM by MalikTous »

Rasha

  • Guest
Re: print to com port
« Reply #2 on: July 28, 2004, 02:20:15 PM »
Thank you. This is work!

Rasha

  • Guest
Re: print to com port
« Reply #3 on: July 28, 2004, 10:39:54 PM »
This work, bat if shange question,
How , in DOS, read/write from/to COM port?

MalikTous

  • Guest
Re: print to com port
« Reply #4 on: July 29, 2004, 01:54:04 PM »
If you wish to use a text terminal on com1:, you can issue:

mode=com1:9600,n,8,1,p
mode con:=com1:


to assign con:, the default Console device, to the terminal after setting up the com port to the same settings as the terminal (I'm assuming 9600bits/sec, no parity, 8 data, 1 stop, and no timeoouts).

You would then issue

mode con:=con:

from the terminal to return control to the default console.

If you wish to communicate with a modem on the com1: serial port, run a DOS terminal program.
« Last Edit: July 29, 2004, 01:55:25 PM by MalikTous »