HPlogo Configuring Systems for Terminals, Printers, and Other Serial Devices: HP 3000 MPE/iX Computer Systems > Chapter 9 Describing Asynchronous Devices

How to Control the Flow of Data

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

Flow control is how the transfer of data between the computer and the asynchronous device is regulated. Flow control protects the computer and the device from data overruns. A data overrun occurs when the sender of data transmits the data faster than the receiver can accept it. Because the receiver cannot accept all of the data being sent, it is said to be overrun with data. Therefore, some data may be lost.

When asynchronous devices communicate with a HP 3000 Series 900 computer, one main method of flow control is used: the XON/XOFF protocol. This protocol controls the flow of data between devices and the Datacommunications and Terminal Controller (DTC). Its purpose is to protect devices from data overruns.

An additional mechanism is used for controlling the flow of data from a device to the computer: the read trigger character. The read trigger character tells a device when it is allowed to send data. Its purpose is to protect the DTC from data overruns.

Flow control is also called pacing methods. For instance, terminal settings for the XON/XOFF protocol are called transmit pacing (XmitPace) and receive pacing (RecvPace).

Because flow control guards against data overruns, it is a means of data protection. Other methods of data protection used with asynchronous devices are parity and printer status requests. Refer to "How to Control Printers" later in this chapter for more information on parity and printer status requests.

The XON/XOFF Protocol

The XON/XOFF protocol is controlled by the recipient of the data being transferred. The recipient sends an XOFF character to the sender of the data if it is unable to continue to receive data. The sender then suspends the transmission of data. When the receiver can accept data again, it sends the XON character to the sender, and the transmission of data is resumed.

Assuming that receive pacing is enabled at a terminal (this is not the terminal's default setting), the terminal will send an XOFF character if any one of the following occur:

  • The terminal is placed in local mode. (Remote mode is necessary to communicate to the computer; refer to the manual that came with the terminal for an explanation of local and remote modes.)

  • The terminal's buffer (a temporary data storage area) fills up because data is being received faster than the terminal is able to display it.

  • The terminal user presses [CTRL]-S. (Pressing [Stop] on HP239x terminals also sends the XOFF character to the computer. Note that this key is a toggle switch; the second time it is pressed, it sends an XON character to the computer, the third time, an XOFF character, and so forth.)

After a terminal sends an XOFF character, the DTC waits indefinitely for an XON character.

A printer will send an XOFF character if any one of the following occur:

  • The printer is placed off-line.

  • The printer runs out of paper.

  • The paper in the printer jams.

  • The printer's buffer fills up because data is being received faster than the printer is able to process it.

When printers (using printer type files 21, 22, or 26) send an XOFF character to the computer, an internal timer (called the XOFF timer) starts. If the timer expires before the printer sends an XON character, a message is sent to the system console. The message informs the operator that intervention is needed to get the printer to function again. After a printer using printer type file 18 sends an XOFF character to the computer, the computer waits indefinitely for the XON character, but no message is sent to the system console.

Use of the XON/XOFF protocol assumes the following:

  • Full-duplex communication lines are used.

  • The attached devices are capable of using the XON/XOFF protocol.

  • The attached devices are capable of transmitting and receiving simultaneously.

These requirements are met if supported devices and cables are used. If non-HP devices are used, ensure that these requirements are filled.

NOTE: The two handshake characters, XON (the ASCII DC1 character) and XOFF (the ASCII DC3 character), are defined as special characters and are reserved for the purpose of protocol. These characters cannot be used as data except in binary mode.

The Read Trigger Character

The read trigger character tells an asynchronous device when it can send data to the computer. It prevents a device from sending data before the computer is ready to receive it. Data sent before the read trigger character is received is not accepted unless typeahead is enabled. If typeahead is enabled, data can be entered at any time and the read trigger character is not necessarily sent to the terminal. After the computer sends the read trigger character, the input of data can proceed.

The ASC software generates the read trigger character at the beginning of each read when the computer is ready to accept data. The read trigger character is the ASCII DC1 character (the same as XON). If the device is operating in character mode, the device can begin transmitting without further exchange of protocol characters.

However, if the data is sent through block mode, the device informs the DTC by sending an ASCII DC2 character in response to the read trigger character. The DTC, informed that a lot of data will be coming, sends another read trigger character when it is ready to accept the block of data. This second read trigger character is called a block read trigger character.

Feedback to webmaster