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

How to Control Terminals

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

DTS helps control the operation of terminals. It automatically handles the input and output of data to the terminal as explained earlier in this chapter under "How to Control the Flow of Data." Alternative methods for controlling terminals are as follows:

  • Echoing characters to the terminal screen as they are typed at the keyboard.

  • Allowing special characters to be processed as intended. For example, [Enter] signals the end of input data and the backspace character causes an unwanted character to be deleted from input data. Other examples of special characters include system break ([Break]) and subsystem break (usually [CTRL]-Y).

  • Modifying the transmission speed through the SPEED or SET commands.

It is possible to programmatically change the method that the DTS uses to control a terminal. A program can change the following attributes:

  • Parity error checking.

  • The method of input for a read from character mode to block mode.

  • The set of special characters recognized by the DTC.

  • The maximum byte count or a maximum time to enter data.

Each of the methods for controlling terminals is explained in the following pages. Refer to the Asynchronous Serial Communications Programmer's Reference Manual for more information on programmatic device control.

Echo

When characters are typed on a keyboard, the terminal user expects each character to appear on the screen as it is typed. This is referred to as echo. Any of the following settings determine whether echo occurs:

  • Local echo enabled.

  • The modem echo is enabled.

  • DTC echo is enabled.

  • Typeahead echo is enabled.

Only one of these settings should be enabled at any time. Each of these settings are described below. Hewlett-Packard recommends setting DTC echo. (DTC echo is automatically enabled for devices configured as terminals.)

Local Echo

When terminals are installed, local echo is turned off. If local echo is turned on, the terminal will echo each character to the screen as it is typed. Local echo is used with half-duplex communications lines and some statistical multiplexers. Note that block mode applications usually turn local echo on because input characters are sent to the DTC in a block of data, instead of one character at a time.

Modem Echo

Modems are able to echo characters as they are typed. This feature should not be used. This feature is usually disabled in the modem's default configuration setting.

DTC Echo

DTC echo is enabled for both terminal type file 10 and terminal type file 18. The DTC will echo to the terminal screen each character as it is typed. DTC echo provides a simple form of data protection since data that appears after it is typed has been successfully transmitted to the DTC and back to the terminal screen again. Disable DTC echo for block mode reads; Local echo takes over the function of DTC echo because data is transferred to the DTC in a block of characters, instead of one character at a time.

Typeahead Echo

Typeahead allows the terminal user to continuously enter data without having to wait for the system to process the data and return the MPE prompt (:). Typeahead echo mode determines whether input characters will be echoed to the terminal screen once or twice.

Disabling Echo

Sometimes characters should not be echoed to the screen, for instance, when entering a password. In this case, the computer disables echo. However, if characters should not be echoed to the screen at other times, the SET ECHO=OFF command can be used. Echo can also be disabled by a program through the use of the FCONTROL or FDEVICECONTROL intrinsic. Note that programs controlling block mode reads must disable DTC echo.

Special Characters

Special characters are ASCII characters that have certain functions assigned to them; they signal the DTC to take a particular action. The results of using special characters are called special control functions. These include the characters described below, as well as the characters used for protocols. The following characters described here are defaults and are modifiable by applications.

Backspace

When a backspace character is entered, the DTC deletes the previous character from the input data and echoes the backspace character to the terminal (provided echo is enabled). When the echoed backspace character is received, the cursor on the screen moves back one character and is positioned at the character that was deleted. Use [Backspace] or [CTRL]-H to backspace.

Line Delete

To delete a line of data while in character mode, press [CTRL]-X. After [CTRL]-X is pressed, three exclamation points (!!!), along with a carriage return and line-feed, are displayed, signaling that all read data was deleted.

End-of-Record Character

When a terminal operates in character mode, a special character is set to enable the user to end a read. This is called the End-of-Record (EOR) character. It is also called a record terminator or line terminator. Two types of EOR characters exist: standard EOR character and additional EOR character.

Standard EOR Character

When users finish typing a line and press [Return] (the standard EOR character), data is transmitted. The carriage return character terminates the read but it is not included in the data of the read or counted in the number of actual characters read. When the EOR character is detected, a carriage return is echoed to the screen and the ASC software generates a line feed. This places the cursor at the beginning of the next line. The EOR character can be replaced with another character during transparent editing; this is done through the FCONTROL 41 intrinsic.

Additional EOR Character

Also referred to as an alternate EOR character, this character is included in the data and the actual character count (byte count) of the data. The read does not end normally, but terminates in an error stating that the additional EOR character was encountered. The program that initiated the read must recover from the error by deleting the additional EOR character from the input data, subtracting one from the byte count, and sending a carriage return and line feed to place the cursor in its proper place.

AEOR characters can be defined through the FCONTROL 25 or, 40 intrinsics. Note that when a read terminates, the program must call the FCHECK intrinsic to see why the read terminated. If returns an error code of 31, it means the read ended with the additional EOR character.

Up to 16 AEOR's are available but only through the use of FDEVICECONTROL 192, 66.

System Console Attention Character

When [CTRL]-A is entered on the system console, it signals a [CTRL]-A console command. The computer sends the system console a carriage return and line feed along with an equals sign prompt (=), signaling that it is ready for the command. [CTRL]-A commands are allowed only on the system console. For more information on the system console and its special commands, refer to MPE/iX Managing Peripherals.

NOTE: [CTRL]-A is not accepted as a special character from a terminal that is connected to a DTC.

System Break

Using default operating conditions, the ASC software responds to a system break signal from the terminal and alerts the computer. The system break function interrupts the execution of programs, subsystems, and most MPE/iX commands. Once the program or subsystem is interrupted, it can be aborted by entering the ABORT command or the program or subsystem can be restarted by entering the RESUME command.

To transmit a system break signal, press [Break]. System break can be disabled programmatically. Refer to the MPE/iX Intrinsics Reference Manual for more information on system break.

Some application programs, such as block mode programs, change the settings of terminals and the characteristics of their device files. These programs should return the devices to normal operating mode before they complete.

If a program does not disable break (through the FCONTROL or FDEVICECONTROL intrinsic), the user can still use [Break]. If [Break] is pressed, the program might not be able to recover but the MPE/iX operating system will by assuming that the terminal is in normal operating mode.

A VPLUS block mode application can be reset by pressing [CTRL], [Shift], and [Reset] simultaneously. Other block mode applications are harder to reset. Sometimes, it is necessary to turn the terminal off and on. Other times, the port must be reset. Refer to Troubleshooting Terminal, Printer, and Serial Device Connections for information on resetting ports if host-based management is being used. Refer to Using OpenView DTC Manager for more information on resetting ports if PC-based management is being used.

Subsystem Break

Subsystem break stops a program-local or subsystem-local command and enables the user to enter a different command. The default subsystem break character in standard editing mode is [CTRL]-Y.

Subsystem break is not enabled by default. It must be enabled programmatically through the FCONTROL 17 intrinsic. A subsystem break character can also be defined when entering transparent editing through the FCONTROL 41 intrinsic.

Transmission Speed

Asynchronous data transmission speeds on MPE/iX computers range from 300 bps to 19200 bps. The following speeds are supported:

300, 1200, 2400, 4800, 9600, and 19200 bps. 38400 bps is also supported for direct connected devices on DTC 16iX/16MX and DTC 72MX.

The speed chosen must be supported by the terminal. A terminal can be changed to any supported speed if it is directly connected to the DTC. The speed of a terminal connected to a modem should be set to the speed of the modem and the telephone line being used.

Parity

Parity verifies that each character of data is transmitted between a device and the system without error. It detects data transmission errors, but does not correct them.

Parity can be used only with 7-bit character sets, such as USASCII, because the eighth bit is used as a parity bit. Character sets that use all eight data bits cannot use parity. Examples include the terminal's alternate character set and character sets used for European languages.

Two types of true parity exist: odd and even. Odd parity counts the number of ones in the seven data bits for each character. Every character has an odd number of bits set to one. If there is an odd number of ones, the eighth bit (parity bit) is set to zero; if there is an even number of ones, the eighth bit is set to one. When the character is transmitted, the receiver verifies that the number of bits set to one is an odd number.

If one of the bits is transmitted incorrectly, the number of bits is even and an error is detected. If two bits are transmitted incorrectly, the character might contain an odd number of ones and the error won't be detected. Since most data transmission errors involve only one bit of the character, most transmission errors are detected.

Even parity works the same way as odd parity, except the total number of bits set to one in each character is set to an even number.

Hewlett-Packard asynchronous devices and the ASC software use two other parity settings as well. These are called ones and zeros. With ones parity, the parity bit of each character is set to one; with zeros parity, the parity bit is set to zero. If the eighth bit is involved in a transmission error, it is detected because the bit is not what was expected.

It is possible to not use parity at all. This is called none parity or 8-bit pass-through. Neither the sender nor receiver of data sets the eighth bit or checks it for parity. (A terminal using a 7-bit character set and no parity places a zero in the eighth position so that characters being transmitted are always eight bits long.)

Parity can be enabled through the FCONTROL intrinsic or the FDEVICECONTROL intrinsic. When enabled, the ASC software generates parity on outgoing data and checks for parity errors on incoming data. After the parity is checked, the parity bit is set to zero because the program using the data has no need for parity information. Parity checking is handled the same way in block mode as in character mode.

Parity settings for terminals must match the type of parity used by the ASC software. The default parity setting for HP terminals is to generate zeros parity, but not to check parity on data from the computer. HP terminals will work correctly with the ASC software without having to modify any configuration values.

If enabling parity, verify that the program which uses the FCONTROL or the FDEVICECONTROL intrinsic either requests that the user change the terminal's parity setting to the new setting of the ASC software or pass the proper escape sequences to change the terminal's settings. When a parity error is detected, the read is completed in error. The ASC software reports the error to the program reading the data.

Input Modes

Data can be input in character mode or block mode. Characteristics and limitations for each are determined by the ASC software and the attached terminal.

Character Mode

Characters are transmitted to the DTC as they are typed. The DTC expects to receive them this way. If DTC echo is enabled, characters are echoed back to the screen as they are received.

Character mode is how terminals are opened, whether by a session or a program. Character mode reads are terminated with the carriage return character ([Return] or [CTRL]-M).

Block Mode

When a terminal operates in block mode, characters are held in the terminal's memory (buffer) as they are typed. Characters are not transmitted to the DTC until a specific action is taken. Pressing [Enter] at the end of a block of data will normally send it to the DTC.

An application program can use an alternate method to end a block mode read. Refer to "Terminating Reads" later in this chapter for more information on ways to end a block mode read.

Block mode is enabled programmatically by executing a block mode application at the terminal. The program needs to change the terminal's configuration settings. It should do this automatically by sending escape sequences to the terminal.

Blocks of characters can be input to the DTC a line at a time (called line block mode) or a page at a time (called page block mode), depending on the type of block mode used. Because characters are displayed on the screen as they are entered, local editing and cursor control features can be used to alter a line or page before it is transmitted to the DTC.

Data is transmitted one character (literally one byte) at a time, with each character bound by start bits and stop bits. Block mode sends data in one transmission "burst," although the characters are transmitted one by one in a long stream.

Data Editing Modes

Data input from a terminal is usually intended as data for the computer: commands, input to a program, etc. Some characters are not interpreted as data, but as special characters. When these characters are encountered, the DTC or the ASC software is signaled to perform a specific function. The functions vary from deleting a character to interrupting a program or subsystem.

The data editing mode defines which characters are recognized as special characters by the system. The types of data editing modes are as follows:

  • Standard editing.

  • Transparent editing.

  • Binary editing.

Special character sets are defined for each editing mode. All special characters apply in standard editing mode, fewer apply in transparent editing mode, and no special characters are recognized in binary editing mode. Refer to the Asynchronous Serial Communications Programmer's Reference Manual for more information on data editing modes.

Terminating Reads

Reads can be programmatically terminated in one of several ways:

  • An EOR or AEOR character is sent from the terminal.

  • The input byte count is reached.

  • The read limit timer expires.

  • The block mode read timer expires.

  • The system break character (if it is enabled) is sent from the terminal.

  • The subsystem break character is sent from the terminal.

  • The [CTRL]-A character is sent from the system console.

  • The DTC encounters a parity error (only when parity checking is enabled).

Note that when using binary editing mode, a read cannot be terminated by any character. Binary reads can be terminated only if either:

  • The input byte count is reached.

  • The read limit timer expires.

Feedback to webmaster