APPLICATION NOTE #109 XONXOFF PROTOCOL Rev. 05 RELATED FILES: XONXOFF.COM To use XyWrite to output to serial printers that use the XONXOFF protocol, you must first install XONXOFF.COM onto your working disk and then modify the DOS startup file (AUTOEXEC.BAT). This application note explains the required steps, and also explains the various options available with XONXOFF.COM, Version 1.4. INSTALLING XONXOFF.COM XONXOFF.COM is a program that allows the IBM PC (and compatibles) to communicate with serial printers that use the XONXOFF protocol. The Apple LaserWriter and the QMS PS 800 are examples of such serial printers. XYQUEST provides XONXOFF.COM on request; call our Technical Support Department if you need a copy. To use XONXOFF, copy it onto your working disk using the DOS COPY command. (If you have a hard disk, copy XONXOFF.COM into the root directory.) ACTIVATING XONXOFF.COM XONXOFF, which is run from DOS, establishes the COM port to which the printer is attached, as well as the baud rate, parity, number of data bits, and number of stop bits that the printer uses, and the LPT number of the device being redirected to the COM port. Most of this this information is supplied by your printer manufacturer. XYQUEST has built the most common printer settings into XONXOFF.COM. The defaults are: Port COM1 Baud Rate 9600 Parity None Data bits 8 Stop bits 1 Printer setup P LPT number 1 If you are using the default settings, then you can activate XONXOFF by following this procedure. 1. Be sure XONXOFF.COM is on the current drive (in the root directory if you are using a hard drive). 2. Issue the XONXOFF command before loading XyWrite or any other application program that uses the serial printer. At the DOS prompt: Type: xonxoff If your printer uses settings other than those established by default, you must include those settings when you issue the command. In this case, the form of the command is: XONXOFF COMn:,baud,parity,databit,stopbit,P,lpt# n is a number from 1 to 4 that represents the port to which the printer is˙20attached. baud is the baud rate of the printer you are using (110, 150, 300, 600, 1200, 2400, or 9600) parity is o (odd), e (even), or n (none). databit defines the number of data bits (either 7 or 8). stopbit is either 1 or 2. P indicates that the port is being used for a serial printer. lpt# is a number from 1 to 3 that indicates the LPT port XONXOFF is redirecting. (See Note #4.) For example, the following command establishes port 2 as the printer port as the printer port for LPT1; it also sets the baud rate to 9600, no parity, eight data bits, 1 stop bit. This is the most common combination of non-default settings. At the DOS prompt: Type: xonxoff com2:9600,n,8,1,P,1 Note #1 Changing Settings. If you are changing one of the XONXOFF settings, then you must specify values for all of the settings. For information on what settings apply to your printer, refer to the documentation supplied by the printer manufacturer. RELEASING XONXOFF If you want to release XONXOFF from memory so you can return to using a parallel port, issue the following command from the DOS prompt. Type: xonxoff/r TOGGLING BETWEEN SERIAL AND PARALLEL PORTS If your system has a serial printer (e.g., an Apple LaserWriter) connected to COM1 and a parallel printer (e.g., a dot matrix printer) connected to LPT1, you can use the XONXOFF command to toggle output between the two ports. To switch from the serial port to the parallel port: Type: xonxoff/t To return to the serial port, reissue the same command. DISPLAYING XONXOFF DEFAULTS If you want to display the command format with the default values, issue the following command at the DOS prompt: Type: xonxoff/h DISPLAYING XONXOFF STATUS If you want to display the command format with the current settings, issue the following command at the DOS prompt: Type: xonxoff/s This command also displays the currently active port (serial or parallel). AUTOMATIC STARTUP When you originally installed XyWrite, one of the files that was created was AUTOEXEC.BAT. AUTOEXEC.BAT is a DOS batch file that is automatically executed every time you start your computer. Call this file and enter the appropriate XONXOFF command at the top of the file (that is, before starting the XyWrite editor). Note #2 MODE Command. Usually, serial printers require a DOS MODE command to establish the printer's mode of operation. XyWrite's XONXOFF program replaces the DOS MODE command for serial printers that use the XONXOFF protocol. Do not issue the MODE command if you are running XONXOFF. Note #3 DO Command. You must load XONXOFF from DOS before you run EDITOR. However, once XONOFF is loaded and you are in XyWrite, you can use the DO command to toggle between ports or release XONXOFF. For example: F5do xonxoff/t You can also use the DOS command to exit to DOS so you can display the status or defaults of XONXOFF. You then need to use the EXIT command to return to XyWrite. Note #4 LPT Port. The LPT port setting is designed specifically for network users who have access to more than one printer. It lets you establish which of the ports you want XONXOFF to redirect to the COM port. Data sent to the other parallel ports is passed directly to the attached printers.