Serial Printers and Flow Control


Contents

About this document
Methods of flow control
Diagnosing flow control problems
Correcting flow control problems

About this document

This document applies to AIX versions 3.2, 4.1, 4.2 and 4.3.

The information in this document applies to those situations where a queue goes to a DOWN state after having printed only a portion of the submitted job, or where there is otherwise some data loss, or where output from the cat command is redirected to the device file and printed output shows data loss.


Methods of flow control

All serial printers require some means of regulating the flow of data to and from the system to which they are attached. The suspension and resumption of data flow is necessary in a variety of circumstances. For example, the host to which the printer is attached must be signaled to stop sending data for the following reasons:

When there is a mismatch between the printer configuration and the configuration used by AIX, the user can expect printed output to be garbled or incomplete.

DTR

DTR refers to the Data Terminal Ready signal. The printer DTR pin is wired to the system DCD (Data Carrier Detect) pin. As the serial port regulates this kind of flow control, it is referred to as "hardware" flow control. When the printer buffer nears capacity, the printer drops DTR, at which point the system no longer has the signal that indicates the presence of the printer and the serial port suspends data transmission. When most of the contents of the the printer buffer have printed, DTR is raised, causing the serial port to detect the presence of the printer and resume data transmission.

Advantages:
immediate response to flow control request; greater reliability
Disadvantages:
requires cabling that conforms to standard specifications

NOTE: DTR pacing is not a possibility for all printers.

XON/XOFF

XON/XOFF refers to the characters sent to resume and suspend transmission respectively. As the operating system must interpret these characters, this method is termed "software" flow control. When the printer buffer nears capacity, the printer sends an XOFF character to the system to signal it to suspend data transmission. After most of the buffer contents have printed, the printer sends an XON character to the system to signal it to resume data transmission.

Advantages:
8-wire cabling unnecessary; compatible with almost all printer devices
Disadvantages:
slower response to flow control request; small additional workload on system CPU, printers with small buffers may overflow before character flow stops.

RTS/CTS

This is another kind of "hardware" flow control. The RTS/CTS method uses Request To Send (RTS) - Clear To Send (CTS) signaling. It is commonly used for terminals and modems. The few brands of printers that use this method drop RTS when the printer buffer nears its capacity. The printer RTS pin is wired to the system CTS pin. The AIX lp driver, however, does not not allow for this kind of flow control; the lp driver requires that CTS be high at all times. When used with AIX these printers must use the tty driver, or a custom cable must be built.

Advantages:
immediate response to flow control request
Disadvantages:
requires custom cabling if an lp driver is used

NOTE: A tty driver must be used where the printer is limited to this kind of flow control and standard cabling is used.

SSD

SSD is a kind of "hardware" flow control used by very few printers. AIX does not support this method. For use with AIX, printers intended for SSD flow control must have the SSD pin wired to the system DCD and the lp driver must be configured for DTR flow control.

Advantages:
immediate response to flow control request
Disadvantages:
requires custom cabling for use with AIX

A "full spec" cable (typically 8 wires) is required for "hardware" flow control (that is, flow control other than XON/XOFF). Modems, multiplexors ("muxes"), and so on that are used on the connection between the printer and the computer's serial port do not allow for the signaling required by hardware flow control. In these situations, XON/XOFF flow control must be used.


Diagnosing flow control problems

lptest generates output in a "barber pole" pattern that makes data loss readily apparent. To redirect the output of lptest to the lp device, execute:

    lptest > /dev/lp# 

# is the number of the lp device file.


Correcting flow control problems

Where data loss (printed output missing characters) is occurring, consider the following resolutions:

  1. There may be a mismatch between the configuration of the lp driver and the configuration of the printer. su to root and execute the following:
    1. smit printer <enter>
    2. select Printer/Plotter Devices <enter>
    3. select Change/Show Characteristics of a Printer/Plotter <enter>
    4. select lp <enter>
    5. Bring the printer and AIX into agreement on the flow control to be used.
  2. Where DTR flow control is possible, use it. DTR flow control is done by the hardware, not the operating system. This results in much more responsive control of the data flow.
  3. If XON/XOFF flow control is used (for example, because of hardware or cabling restrictions), consider the following adjustments:
    1. Transmit Buffer Count (TBC) is the number of characters AIX sends to the printer before checking for an XOFF character from the printer. A higher TBC will result in faster throughput and less CPU usage. A lower TBC causes an increase in attentiveness to printer flow control requests.
    2. Baud rate is the speed of data transmission. Flow control problems can be prevented by not sending data to the printer faster than the printer can print. While most printers are set to 9600bps (bits per second) by default, few are capable of printing at such a rate. Reducing the Baud rate reduces flow control requests.
    3. Printer buffer is the memory where print data accumulate before being printed. Depending on the printer, this may be adjustable. The chance of overrunning the printer buffer is reduced when the printer is set to send an XOFF character at the point the buffer reaches 75% capacity instead of 95%.
  4. RTS/CTS flow control: When the queue for a locally attached serial printer goes to a DOWN state after only a portion of the job has been printed, suspect that the printer is configured to use RTS/CTS flow control. If the printer drops RTS (connected to the CTS pin at the computer's end of the cable), this drop signals AIX to stop data transmission. The AIX lp driver requires the continuous presence of CTS. If possible, set the printer to use XON/XOFF flow control, or modify the cabling in such a way that AIX will have the CTS signal continuously.




[ Doc Ref: 90605202814658     Publish Date: Jun. 19, 2001]