CHAPTER 12 PRINTING Although you don't need a printer to utilize most of the features of MODEM MGR, a printer can be useful for printing out text received while onl ine, text from the capture buffer, or text from a disk file. To obtain printer support, you must specify your printer interface card when you execute the INSTALL program. You must also connect and configure the printer for your system. It is your responsibility to have your printer interfaced with your system. If your printer and interface are not installed properly, this software will not provide printer support. Printing can be toggled ON or OFF if you use the P command in the terminal comm and mode. We will also present other methods of controlling the printing in this chapter. PARALLEL PRINTER INTERFACING MODEM MGR supports most parallel printer cards and printers which use the standard Centronics-type parallel interface. Typically the printer requires a negative strobe from the printer card and issues a negative acknowledge signal back to the card. In most cases all you have to do is connect a suitable cable between the printer card and the printer. Some parallel printers use a positive strobe and/or acknowledge signal. If your printer or printer card has switches or jumpers which allow you to select the polarity of the strobe and acknowledge signals, then you can set the switches to achieve a compatible combination. Some parallel printer cards do not have switches or jumpers to alter the signal polarities. In this case, the card characteristics must conform to the printer requirements. A few parallel printer cards provide software control of the polarity of the handshake signals. Software patches to alter the strobe or acknowledge signal polarities are available for the following cards: Interactive Structures PKASO/U card Quadram Multicore card SSM AI0 card If you have a parallel printer, skip the following sections on serial printers. SERIAL PRINTER INTERFACING Serial printer cards can be classified into types (Type 2651, 6551, 6850, 8251, 8530, etc). Refer to the serial card descriptions in Chapter 4 to determine the type of serial printer card you have. The card type for a serial card used as a printer card is the same as when it is used as a communications card. In some cases, you can accomplish serial printer interfacing simply by plugging in the connecting cable. However, there are cases when printer interfacing cannot be achieved even with several hours of effort by an "expert" with hands-on access to your equipment and all instruction manuals. The major serial printer interface problems involve the handshake connections between the printer and the serial card. It is beyond the scope of this manual to provide step-by-step instructions on interfacing a serial printer. We assume you have already installed your printer and it is functioning correctly. You must provide some information to MODEM MGR so it can support the serial printer interface you have implemented. Do this by executing the INSTALL program and entering parameters corresponding to your serial printer configuration. SERIAL PRINTER DATA LINES Most serial cards will support printers as well as modems. Some serial cards have a separate cable connector for the printer function or a jumper block which configures the cable connector for printer operation. This provides the correct connections for the data signals and (sometimes) the handshake signals. Some serial cards do not have built-in adaptability. These cards have the data output permanently assigned to pin 2 of the DB-25 connector. Although this is fine for modems, it is incorrect for most printers. Pin 2 on this type of serial card must must be wired to the pin 3 on the printer. The following serial or multi-function cards must have this wiring reversal performed to interface with most serial printers: Apple Communications Card Mountain CPS Multifunction Card Prometheus Versacard Quadram Multicore Card Transend AI0 Card In addition, if you are using printer XON/XOFF handshaking, you must connect the data input on the card to the printer data output. SERIAL PRINTER BUFFER Most printers have a buffer which allows the printer to accept text from the computer at a faster flow rate than the printing speed. Buffers have a finite size limit so the flow of text must be controlled to avoid buffer overflow and loss of text. The printer controls the flow of text from the computer into the buffer by sending handshake signals to the computer. You can prevent buffer overflow by selecting a low baud rate for the printer serial interface and not using any handshake. For example, if your printer can print 100 characters per second, a printer serial baud rate of 300 baud (approximately 30 characters per second) will not cause buffer overflow. Although this avoids your having to set up handshaking, this method results in less than optimum printing speed. If your printer prints a long document for a few paragraphs and then halts, or skips a block of text, you probably have a printer handshake problem. You should determine which handshake method is best for your system and implement that method. This involves configuring your printer and printer card and installing the proper cabling bet ween the card and your printer. Most printer card manufacturers can tell you the best way to interface their card to a particular printer. After you have set up the proper handshaking for your printer, you can install the proper parameters into this program to support the handshake method you have implemented. MODEM MGR supports either hardware handshaking or software XON/XOFF handshaking. SERIAL PRINTER HARDWARE HANDSHAKING For hardware handshaking, you must connect the "busy" line from your serial printer to the appropriate input on your serial printer card. Unfortunately, this "busy" line is never assigned to the same pin number on all serial printers. Your printer manual will usually provide the handshake pin number. It is assumed you have connected this line to the appropriate pin on the DB-25 connector at your serial interface card and know which pin number it is. The handshake pins of several serial printer cards are in Table 12-1 at the end of this chapter. A handshake mask ($nn) used by this program is listed with each signal pin. After you have determined which pin you are currently using for hardware handshaking with your serial card, refer to the list in Table 12-1 to find the proper handshake mask (the hexadecimal number following the $). You will have to execute the INSTALL program and specify this handshake mask. Those interfaces shown with a * do not require a handshake mask because a default value is supplied by MODEM MGR. In some cases a switch or jumper on the card must also be set. For example, if you are using a Seriall card with pin 4 for handshaking, Table 12-1 specifies a handshake mask of $30 for the INSTALL program. You should also verify the HHS jumper on the Serial1 card is on position 1. The handshake mask is always initialized when a new printer driver is installed so set this value AFTER you load the driver. A few more parameters must be installed if you are using hardware handshaking. You must set the value for printer XOFF to $00. This disables XON/XOFF handshaking and enables hardware handshaking. Finally, read the section on serial printer initialization in this chapter and install the printer baud rate and data characteristics. SERIAL PRINTER XON/ XOFF HANDSHAKING If your printer is set up for software XON/XOFF handshaking, you must set the characters used for printer XON and XOFF into this program. This is performed by executing the INSTALL program and specifying the hexadecimal values for printer XON and XOFF. For example, if you are using $11 (sometimes referred to as DCl) for XON and $13 (sometimes referred to as DC3) for XOFF, you must enter 11 and 13 as the default settings in the INSTALL program. If you are using hardware handshaking, be sure to set the printer XOFF to 00. If you are using software XON/XOFF printer handshaking, the control inputs on the printer serial card must be held "high". The DB-25 connector pins which must be held "high" are listed in Table 12-2 at the end of this chapter for some printer serial cards. If the pin has an internal pull-up circuit, it is shown as (pu) and this pin can be left disconnected. In some cases switches or jumpers are used to set the control inputs high. There are probably some pins which must be held "high" on the printer end of the cable. Refer to the printer manual to determine which ones must be kept "high". SERIAL CARD INITIALIZATION Some serial cards will let you set the default baud rate and data parameters by providing dip switches, jumpers, or programmable non-volatile RAM on the card. Some of these cards are listed in Table 12-3. After you have set the desired parameters, the card will retain and use these parameters for initialization. Whenever you power your computer on and enable the print function, MODEM MGR will read the default baud rate and data parameter settings and set the operating parameters accordingly. You may override the switch or jumper settings by specifying a non-zero value for the printer command byte in the INSTALL program. The printer command and control bytes will then be used for initialization. On those cards without the capability to define default settings, MODEM MGR will set the parameters based on hexadecimal values you enter specifically for this program. You can enter these values by executing the INSTALL program and specifying the parameters in the form of printer command and control bytes. If you specify $00 for the printer command byte, the program will default to 9600 baud, 8 data bits, 2 stop bits, no parity for Type 2652, 6551, and 8251 cards, and 1 stop bit for 8530 (IIGS). For Type 6850 cards, the program will default to 8 data bits, 2 stop bits, no parity at the baud rate selected by the card switch. Some settings and the corresponding bytes are listed below. TYPE 2651 SERIAL PRINTER CARDS Printer Printer Command byte Control byte ~~~~~~~~~~~~ ~~~~~~~~~~~~ 9600baud, 8+2+none $CE $3E 9600baud, 8+1+none $4E $3E 9600baud, 8+1+odd $5E $3E 9600baud, 8+1+even $7E $3E 1200baud, 8+2+none $CE $37 1200baud, 8+1+none $4E $37 1200baud, 8+1+odd $5E $37 1200baud, 8+1+even $7E $37 TYPE 6551 SERIAL PRINTER CARDS Printer Printer Command byte Control byte ~~~~~~~~~~~~ ~~~~~~~~~~~~ 9600 baud, 8+2+none $0B $9E 9600 baud, 8+1+none $0B $1E 9600 baud, 8+1+odd $2B $9E 9600 baud, 8+ +even $6B $9E 1200 baud, 8+2+none $0B $98 1200 baud, 8+1+none $0B $18 1200 baud, 8+1+odd $2B $98 1200 baud, 8+1+even $6B $98 TYPE 6850 SERIAL PRINTER CARDS (Baud rate set by switch) Printer command byte ~~~~~~~~~~~~~~~~~~~~ 8+2+none $11 8+1+none $15 8+1+odd $1D 8+1+even $19 TYPE 8251 SERIAL PRINTER CARDS (Quadram Multicore) Printer Printer Control byte Command byte (Baud Rate) ~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~ 8+2+none $CE $00= 150, $01= 300, 8+1+none $4E $02= 600, $03= 1200, 8+1+odd $5E $04= 2400,$05= 4800, 8+1+even $7E $06= 9600 TYPE 8530 (IIGS SERIAL PRINTER PORT) Printer Printer Control byte Command byte (Baud Rate) ~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~ 8+2+none $CC $01= 50, $02= 75, $03= 110, 8+1+none $C4 $04= 135, $05= 150, $06= 300, 8+1+odd $C5 $07= 600, $08= 1200, $09= 1800, 8+1+even $C7 $0A= 2400, $0B= 3600, $OC= 4800, $0D= 7200, $0E= 9600, $0F= 19200 The printer command and control bytes are initialized to 00 when a new printer driver is installed so set their values after you select a printer driver. You do not have to specify a printer control byte for Type 6850 serial printer cards. If you have a Type 2651 printer card, use the 2651 mode register 1 byte as the printer command byte and use the mode register 2 byte as the printer control byte in the INSTALL program . For example, if your are using an Apple Super Serial card (a Type 6551 serial card) and a printer set up for 1200 baud, 8 data bits, 2 stop bits, and no parity, install $0B as the printer command byte and $98 as the printer control byte. ADDITIONAL PRINTING PARAMETERS There are several additional printing parameters and defaults which you may set with the INSTALL program. To install these parameters, execute the INSTALL program and select option 7 on the main installation menu to set the defaults. A description of these additional printer defaults is provided below. PRINTER ON/OFF If you select this default, it will set the initial printing state to ON or OFF when MODEM MGR is first started. Normally you want this to be OFF so the printer will remain off-line until you have something to print. SEND PRINTER LF Some printer/printer card combinations require a line feed be sent to the printer by the program after each CR is sent. If this is true for your system, set this default to ON or you will have continuous over-printing on one line. If you are printing double-spaced lines, set this default to OFF. SET PRINTER BIT 7 Some printer/printer card combinations require bit 7 be set. If this is true for your system, set this default to ON. If your printer prints graphics characters instead of text characters, toggle this default. PRINTER NULLS If your printer requires nulls to mark time while the printer mechanism executes a CR or LF or form feed, you can specify the number of nulls here. The number of nulls can be specified in the range of $00 to $FF. If your printer does not require nulls, set this to $00. PRINTER COLUMNS You can specify the maximum number of columns printed. When the number of characters on a line exceeds the specified column width, the program will insert a CR (and LF if necessary) and the remainder of the line will be printed on the next lower line. The default is 80 columns ($50 hexadecimal). You may specify column widths up to 255 columns ($FF hexadecimal). PRINTER LINES You can specify the maximum number of lines printed before the program sends a form feed character to direct the printer to move to the top of the next page. The default value is 60 lines ($3C hexadecimal). Normally there are 6 printed lines per inch. There are 66 lines on an 11" form, so the setting of 60 lines will provide three blank lines at the top and bottom of each page. This paging feature requires a printer which supports form feeds. To disable printer paging, set the printer form feed default to $00 (see printer form feed). To use this paging feature, you should initialize the printer to the top of the page. Most printers have a switch which you can use to perform this initialization. Set the printer paper so the first line printed will be l/2 inch (3 lines) below the top of the page. Toggle the print ing ON (using the P command). This will reset the line counter used in this program. If the print function is already on, toggle it OFF and then ON again to insure the program line counter is reset. If the printer and program line counter are not both initialized, the page break will occur somewhere within the page instead of at the perforations between forms. PRINTER FORM FEED This defines the printer control character which directs the printer to move to the top of the next page. Usually this is $0C hexadecimal. If you want to manually insert individual sheets in your printer, set this to $FF and the printer will stop at the end of each page. After you insert a new sheet, type any key to restart the printer. If your printer does not support form feeds or you aren't using in dividual sheets, set this to $00. Setting this to $00 will also disable the paging feature described above. CONTROL-P PRINTER CONTROL If you are printing while viewing the capture buffer or reading a disk file to the screen, you can also toggle the printer on or off by entering a [CTRL] P from the keyboard. This is useful if you want to print certain sections of the text. Use the number keys (if you are printing from the buffer) and/or space key to slow the text display or stop where you wish to start printing. Enter a [CTRL] P to start printing and another [CTRL] P to stop printing. When you use [CTRL] P to start printing, it will not zero the line counter used by this program. Therefore, if you are using the paging feature described earlier, the top-of-form condition must be initialized by using the terminal P command to toggle the printer on when it is at the top of the first page before you use the control-P commands. IMBEDDED PRINT CONTROL CHARACTER There is another way you can print selected portions of text in the capture buffer or from a disk file. This is done by imbedding control characters directly into the text to control the printer. First, you must select a control character to use. Suppose you have selected a control-X (hexadecimal $18) as the imbedded print control character. Run the INSTALL program and set the value of 18 for the imbedded print control character. Next, edit the text and set a control-X at the beginning of the text to toggle the printer off (unless you wish to start printing at the beginning). Insert an additional control-X at the beginning and end of the block of text you want printed. You can repeat this for as many separate blocks you wish to print. As an example, look at the next paragraph. Suppose you want to print out only the address. Edit the text to place three control-X characters where shown. The first control-X will toggle the printer off. This is necessary because the printer must be initially in the on state and you want to turn it off at the beginning of the text. The second control-X will toggle the printer on so it can print the address. Finally, the last control-X will turn the printer off again. ^XFor sale: Teletype machine. If interested, write to: ^XJohn Kleinschmidt 123 Main Street Anaheim, CA 92806 ^XThe minimum bid is 10 cents a pound. To use the imbedded print control character, you must use the P command to toggle the printer on initially. If this is not done, nothing will be printed out regardless of the placement of the imbedded print control characters. To disable the imbedded print control feature, toggle the printer off (with the P command), or remove all imbedded printer control characters, or run the INSTALL program and set the imbedded print control character to $FF. Do not use a common control character for the imbedded print control character. For example, control-G, control-H, control-I, control-J, and control-M are often found in ordinary text. If your printing stops and starts in unanticipated places, you may have picked a control character which appears normally in the text. PRINTER INITIALIZATION STRING You may specify a string of characters which will be sent to the printer whenever you use the P terminal command to toggle printing on. The printer must have power on whenever you send the initialization string. Enter the string in individual hexadecimal bytes and enter a $FF at the end. You may enter a maximum of 16 characters. The Multicore serial printer driver will not support this feature. If you have set the printer on/off default to ON with the INSTALL program, the initialization string will be sent to the printer when the program is started. Table 12-1. Serial Printer Card Hardware Handshake Apple IIGS Printer Port -pin 2 -$24 Apple IIGS Printer Port -pin 7 -$0C Apple Communications -(no hardware handshake) Apple Super Serial -pin 4 or 5 (SWl-7 ON) -$30 Apple Super Serial -pin 19 (SW2-7 ON) -$30 Apple Super Serial -pin 20 -$50 Apple // c -pin 5 (DIN connector) * Apricorn Serial -pin 4 -$02 Apricorn Serial -pin 20 -$06 Apricorn Super Serial Imager -pin 4 -$10 Apricorn Super Serial Imager -pin 11 or 20 -$50 Apricorn Super Serial Imager -pin 9/10/13/14/15/16/17/18/ 19/20/21/ 23/ 24/ 25 (select) -$50 AST Multi I/O -pin 20 -$06 CCS 7710 -pin 4 -$02 CCS 7710 -pin 20 -$06 CCS 7711 -pin 4/9/11 (select) (RTS jumper ON) -$50 CCS 7711 -pin 20 (DTR jumper ON) -$30 Mountain CPS -pin 5 -$01 Mountain CPS -pin 6 -$81 Mountain CPS -pin 8 -$41 Orange Serial Grappler -pin 4 -$10 Orange Serial Grappler -pin 20 -$50 Pract. Periph. Seriall -pin 4 (HHS-1) -$30 Pract. Periph. Seriall -pin 5 (HHS-2) -$30 Pract. Periph. Seriall -pin 11 (HHS-3) -$30 Pract. Periph. Seriall -pin 19 (HHS-4) -$30 Pract. Periph. Seriall -pin 20 (HHS-5) -$30 Prometheus Versacard -pin 5 -$02 Prometheus Versacard -pin 6 -$06 Quadram Multicore -pin 5 -$01 Quadram Multicore -pin 6 -$80 Street Alphabits or Businesscard -pin 5 (DIN connector) * Transend AIO -pin 5 - $02 Transend AIO -pin 8 -$06 Transend ASIO -pin 4 (E2, E3 jumpered) -$02 Transend ASIO -pin 20 (E1, E2 jumpered) -$02 Videx PSIO -pin 4 (J2 right-most) -$30 Videx PSI) -pin 20 -$50 Table 12-2. Serial Printer Card XON/ XOFF Handshake Apple Super Serial - Set SWl-7 and SW2-7 OFF Apple //c - pin 5 (pu) * Apricorn Serial - pins 4 and 20 Apricorn Super Serial Imager - pin 4 (pu) AST Multi I/O - pin 20 (pu) CCS 77 10 - pins 4 and 20 CCS 7711 - Set DTR and RTS jumpers to OFF Mountain CPS - pins 5 and 8 Orange Serial Grappler - pins 4 and 20 Pract. Periph. Seriall - pin 20 (pu) (HHS on 5) Prometheus Versacard - pins 5 (pu) and 6 (pu) Quadram Multicore - pin 5 (pu) Street Alphabits or Businesscard - pin 5 * Transend AIO - pins 5 (pu) and 8 (pu) Transend AS1) - Remove jumper at E2 Videx PSIO -Set jumper J2 on left-most side NOTES: (1) For XON/ XOFF printer handshaking, the pin(s) listed above must be held high. If the pin has a pull-up (pu), it may be disconnected instead of held high. (2) The cards marked * have a five-pin round DIN connector. Table 12-3.Serial Printer Card Initialization Apple Super Serial - DIP switches Apricorn Super Serial Imager - DIP switches Pract. Periph. Seriall - DIP switches Quadram Multicore - Non-volatile RAM (virtual slot 1, printer A) Videx PSIO - Non-volatile RAM Other cards - See notes below NOTES: (1) If you set the printer command byte to $00 with the INSTALL program, the serial printer cards listed above will default to the baud rate, number of data bits, number of stop bits, and parity set by the DIP switches or non-volatile RAM. (2) If you set the printer command byte to $00, all other cards with baud rate switches or jumpers will have a default of 8 data bits, 2 stop bits, and no parity at the selected baud rate. (3) If you set the printer command byte to $00, all other cards without baud rate switches will have a default of 9600 baud, 8 data bits, no parity, and 2 stop bits (1 stop bit for IIGS printer port). (4) If you set the printer command byte to a non-zero value, the values used for the printer command byte and printer control byte will establish the printer serial parameters.