5 Received Character Processing

General

This chapter describes how the VT102 processes received characters. There are two types of received characters, display characters and control functions. The chapter covers all display characters and control functions used by the terminal.

Received Characters

The terminal processes characters according to American National Standards Institute (ANSI) standards X3.64-1979, X3.4-1977, and X3.41-1974. ANSI standard X3.4 defines the American Standard Code for Information Interchange (ASCII). Table 5-1 shows each ASCII character with its binary, octal, decimal, and hexadecimal values. ASCII corresponds to the International Standards Organization (ISO) Standard 646 and International Telegraph and Telephone Consultative Committee (CCITT) Alphabet 5.

The terminal processes a received character based on character types defined by ANSI. Position in the ASCII table tells you whether a character is a control function or display character. The ASCII table is 8 columns wide and 16 rows long. The control functions are in columns 0 and 1. The display characters are in columns 2 through 7. However, the terminal uses space (SP) as either an information separator control function or display character. Delete (DEL) is always a control function.

Display Characters

Display characters are received characters displayed on the screen. The actual character displayed depends on the character set selected. You select the character set by using control functions. See Character Sets and Selection in this chapter for more information.

Control Characters

These single-character control functions start, modify, or stop terminal operations; the control functions are not displayed. Table 5-2 defines the control characters recognized by the terminal. All other control characters are ignored.

Each control character in this chapter has a mnemonic, listed in Table 5-2. The mnemonic is an abbreviation of the control character name.

Escape and Control Sequences

Escape and control sequences provide additional control functions not provided by the single-character controls of the character set. These multiple-character sequences are not displayed; instead, they control terminal operation. Escape and control sequences are defined by ANSI X3.41-1977 and X3.64-1979. See Appendix D for more information about sequences and sequence formats.

The terminal provides upward and downward software compatibility. It can respond to control functions created to meet private DIGITAL standards and present ANSI standards. Therefore, you can use existing software designed for previous terminals (such as the VT52), or new software designed for ANSI standards. However, future video terminals may not accept private DIGITAL sequences. Therefore, all new software should use ANSI-compatible sequences.

The terminal uses VT52 mode to respond to private DIGITAL sequences like a VT52 terminal.

The terminal uses ANSI mode to respond to a subset of control functions specified by ANSI. All control functions not presently specified by ANSI are created to comply with the extensions permitted by ANSI standards. These sequences are considered ANSI private sequences.

The ANSI-compatible control functions in this user guide have a mnemonic assigned by ANSI. If the control function is an ANSI private control function (defined by DIGITAL), the mnemonic begins with DEC. The escape and control sequences shown here use ASCII characters. You must type the characters in the sequences exactly as shown (upper or lowercase). The text provides the octal equivalent of each character in the sequence as a second reference. See Table 5-1 for decimal and hexadecimal representations.

The following section groups sequences by software compatibility (ANSI or VT52) and function (Table 5-3). Appendix C summarizes all control functions.

Error Recovery

Current standards do not specify the action performed when the terminal receives a control function with an error. Errors are incorrect parameters, invalid control functions, or control characters embedded in control function sequences. The terminal usually recovers from these errors by performing as much of the function as possible. The specific error recovery procedures are as follows.

ANSI-Compatible Sequences

ANSI-compatible sequences meet ANSI standards X3.64-1979 and X3.41-1974. This section describes the ANSI control functions used by the terminal. You can select ANSI compatibility from the keyboard in SET-UP (Chapter 3) or have the computer use a sequence. (See VT52-Compatible Sequences in this chapter).

SET-UP Feature and Mode Selection

SET-UP features change how the terminal operates. You can select these features from the keyboard in SET-UP. The computer can select some SET-UP features by using control functions. However, features selected by the computer are stored in operating memory. The computer cannot store feature selections in user memory. (See Chapter 3 for more information about SET-UP feature memories).

Some SET-UP features are modes. A mode affects terminal operation. The terminal uses the selected mode until you or the computer change the selection. Table 5-4 lists SET-UP features and modes. The computer changes modes by using set mode (SM) and reset mode (RM) sequences. Set and reset the terminal modes by using the following sequences.

NOTE: Ps represents a variable parameter selected from a list of parameters. A series of asterisks (***) represent the parameter in the octal sequence. The parameter is transmitted using ASCII characters. When you set several modes with a single SM or RM sequence, a semicolon (;, octal 073) separates parameters.

Set Mode

ESC  [  Ps   ;  ...  ;  Ps   h
033 133 *** 073     073 *** 150

Sets one or more modes specified by selective parameters (Ps) in the parameter string.

Reset Mode (RM)

ESC  [  Ps   ;  ...  ;  Ps   l
033 133 *** 073     073 *** 154

Resets one or more modes specified by selective parameters (Ps) in the parameter string.

Table 5-5 lists the ANSI-specified modes and their selective parameters (Ps). Table 5-6 lists the ANSI-compatible private modes and their selective parameters. When you change ANSI-compatible private modes, the first character in the parameter string is a question mark (?, octal 077). All parameters in the sequence are interpreted as ANSI compatible private parameters. This chapter explains each mode in detail and provides the sequences to set and reset each mode.

The following example shows the use of the question mark (used with ANSI private parameters) and semicolon (used with multiple parameters). The sequence sets both column and scroll modes.

ESC  [   ?   3   ;   4   h
033 133 077 063 073 064 150

Table 5-7 describes modes specified in ANSI X3.64-1979 that are permanently set, permanently reset, or not applicable. See the ANSI standard for more information about these modes.

ANSI/VT52 Compatibility

The terminal is compatible with both ANSI and private DIGITAL standards. Therefore, you can use new software that meets both ANSI standards, and existing software designed for previous terminals (such as the VT52).

ANSI-compatible sequences meet ANSI standards X3.64-1979 and X3.41-1974. You select ANSI compatibility by using the ANSI/VT52 mode (DECANM) sequence in VT52 mode. See VT52-Compatible Sequences in this chapter for details on selecting ANSI sequence compatibility. In ANSI mode, the following sequence selects compatibility with private DIGITAL sequences (VT52 mode).

Features and modes selected in ANSI mode are also used in VT52 mode. However, these features and modes usually cannot change in VT52 mode.

VT52 Mode (DECANM)

ESC  [   ?   2   l
033 133 077 062 154

In ANSI mode, reset selects private DIGITAL sequence compatibility. In VT52 mode, the terminal responds like a VT52 to private DIGITAL sequences.

Scrolling

Scrolling is the upward or downward movement of existing lines on the screen. This makes room for more display lines at either the top or bottom of the scrolling region. There are two methods of scrolling, jump scroll and smooth scroll. Select the type of scrolling by using the following sequences.

NOTE: In full-duplex communication, the auto XON/XOFF SET-UP feature prevents the loss of received characters when using smooth scroll. If auto XON/XOFF is not used, fill characters are needed.

Scroll Mode (DECSCLM)

ESC  [   ?   4   h
033 133 077 064 150

Set selects smooth scroll. Smooth scroll lets the terminal add 6 lines per second to screen (power feature = 60 Hz), or 5 lines per second (power feature = 50 Hz).

ESC  [   ?   4   l
033 133 077 064 154

Reset selects jump scroll. Jump scroll lets the terminal add lines to the screen as fast as possible.

Scrolling Region

This region is the area of the screen between the top and bottom margins. The margins determine which screen lines move during scrolling. Characters added outside the scrolling region do not cause the screen to scroll. The minimum size of the scrolling region is two lines. Therefore, the line number of the top margin must be less than the number of the bottom margin. The origin mode selects line numbers.

After the margins are selected, the cursor moves to the home position. The origin mode feature also selects the home position. Select the top and bottom margins of the scrolling region by using the following sequence.

NOTES: When you power up or use the Reset command, the scrolling region becomes the full screen.

Pt and Pb represent variable numeric parameters. The parameters are decimal numbers transmitted to the terminal as ASCII characters. Asterisks (***) represent one or more variable numeric parameters in the octal sequence.

Set Top and Bottom Margins (DECSTBM)

ESC  [  Pt   ;  Pb   r
033 133 *** 073 *** 162

Selects top and bottom margins, defining the scrolling region. Pt is line number of first line in the scrolling region. Pb is line number of bottom line. If Pt and Pb are not selected, the complete screen is used (no margins).

Origin

This mode determines if the cursor can move outside the scrolling region (the area between the top and bottom margins). You can move the cursor outside the margins with the cursor position (CUP) and horizontal and vertical position (HVP) sequences.

Lines on the screen are numbered according to the location of the home position. Home position is always line 1, column 1. The cursor moves to the new home position whenever origin mode is selected. Select origin mode by using the following sequences.

NOTE: When you power up or use the Reset command, origin mode resets.

Origin Mode (DECOM)

ESC  [   ?   6   h
033 133 077 066 150

Set selects home position in scrolling region. Line numbers start at top margin of scrolling region. The cursor cannot move out of scrolling region.

ESC  [   ?   6   l
033 133 077 066 154

Reset selects home position in upper-left corner of screen. Line numbers are independent of the scrolling region (absolute). Use CUP and HVP sequences to move cursor out of scrolling region.

Cursor Positioning

The cursor indicates the active screen position where the next character will appear. The cursor moves:

You can also move the cursor by using the following sequences.

NOTE: Pn represents a variable numeric parameter. The parameter is a decimal number transmitted to the terminal by using ASCII characters. If you select no parameter or 0, the terminal assumes the parameter equals 1. Asterisks (***) represent one or more characters in the octal sequence.

Cursor Up (CUU)

ESC  [  Pn   A
033 133 *** 101

Moves cursor up Pn lines in same column. Cursor stops at top margin.

Cursor Down (CUD)

ESC  [  Pn   B
033 133 *** 102

Moves cursor down Pn lines in same column. Cursor stops at bottom margin.

Cursor Forward (CUF)

ESC  [  Pn   C
033 133 *** 103

Moves cursor right Pn columns. Cursor stops at right margin.

Cursor Backward (CUB)

ESC  [  Pn   D
033 133 *** 104

Moves cursor left Pn columns. Cursor stops at left margin.

NOTE: Pl and Pc represent variable numeric parameters. The parameter is a decimal number that represents one or more characters transmitted to the terminal as ASCII characters. Asterisks (***) represent the variable parameter in the octal sequence.

Cursor Position (CUP)

ESC  [  Pl   ;  Pc   H
033 133 *** 073 *** 110

Moves cursor to line Pl, column Pc. If Pl or Pc are not selected or selected as 0, the cursor moves to first line or column, respectively. Origin mode (DECOM) selects line numbering and ability to move cursor into margins.

NOTE: CUP operates the same as the horizontal and vertical position (HVP) sequence.

Cursor Position (Home) (CUP)

ESC  [   H
033 133 110

Moves cursor to home position, selected by origin mode (DECOM).

Horizontal and Vertical Position (HVP)

ESC  [  Pl   ;  Pc   f
033 133 *** 073 *** 146

Moves cursor to line Pl, column Pc. If Pl or Pc are not selected or selected as 0, the cursor moves to first line or column, respectively. Origin mode (DECOM) selects line numbering and ability to move the cursor into margins.

NOTE: HVP operates the same as the cursor position (CUP) sequence.

Horizontal and Vertical Position (Home) (HVP)

ESC  [   f
033 133 146

Cursor moves to home position selected by origin mode (DECOM).

Index (IND)

ESC  D
033 104

Moves cursor down one line in same column. If cursor is at bottom margin, screen performs a scroll-up.

Reverse Index (RI)

ESC  M
033 115

Moves cursor up one line in same column. If cursor is at top margin, screen performs a scroll-down.

Next Line (NEL)

ESC  E
033 105

Moves cursor to first position on next line. If cursor is at bottom margin, screen performs a scroll-up.

Save Cursor (DECSC)

ESC  7
033 067

Saves cursor position, character attribute (graphic rendition), character set, and origin mode selection. (See restore cursor).

Restore Cursor (DECRC)

ESC  8
033 070

Restores previously saved cursor position, character attribute (graphic rendition), character set, and origin mode selection. If none were saved, the cursor moves to home position.

Columns Per Line

This mode selects the number of columns in a display line, 80 or 132. With either selection, the screen can display 24 lines. Select the number of columns per line by using the following sequences.

NOTE: When you change the number of columns per line, the screen is erased. This also sets the scrolling region for full screen (24 lines).

Column Mode (DECCOLM)

ESC  [   ?   3   h
033 133 077 063 150

Set selects 132 columns per line.

ESC  [   ?   3   l
033 133 077 063 154

Reset selects 80 columns per line.

Auto Wrap

This mode selects where a received character will appear when the cursor is at the right margin. Select auto wrap by using the following sequences.

NOTE: Regardless of the auto wrap SET-UP feature selection, the tab character never moves the cursor to the next line.

Auto Wrap Mode (DECAWM)

ESC  [   ?   7   h
033 133 077 067 150

Set selects auto wrap. Any display characters received when cursor is at right margin appear on next line. The display scrolls up if cursor is at end of scrolling region.

ESC  [   ?   7   l
033 133 077 067 154

Reset turns auto wrap off. Display characters received when cursor is at right margin replace previously displayed character.

Screen Background

This mode selects either light (reverse) or dark display background on the screen. Select screen mode by using the following sequences.

Screen Mode (DECSCNM)

ESC  [   ?   5   h
033 133 077 065 150

Set selects reverse screen, a white screen background with black characters.

ESC  [   ?   5   l
033 133 077 065 154

Reset selects normal screen, a black screen background with white characters.

Linefeed/New Line

This mode selects the control character(s) transmitted by RETURN. Linefeed/new line also selects the action taken by the terminal when receiving linefeed, form feed, and vertical tab. Table 5-8 provides a summary of the feature. Select linefeed/new line mode by using the following sequences.

Linefeed/New Line Mode (LNM)

ESC  [   2   0   h
033 133 062 060 150

Set causes a received linefeed, form feed, or vertical tab to move cursor to first column of next line. RETURN transmits both a carriage return and linefeed. This selection is also called new line option.

ESC  [   2   0   l
033 133 062 060 154

Reset causes a received linefeed, form feed, or vertical tab to move cursor to next line in current column. RETURN transmits a carriage return.

Keyboard Action (FDX)

This mode is only used during full-duplex, not half-duplex communication. Keyboard action lets the computer turn the keyboard on or off. This mode always resets when you enter SET-UP. Select keyboard action mode by using the following sequences.

Keyboard Action Mode (KAM)

ESC  [   2   h
033 133 062 150

Set turns off keyboard and turns on KBD LOCKED.

ESC  [   2   l
033 133 062 154

Reset turns on keyboard and turns off KBD LOCKED.

Auto Repeat

This mode selects automatic key repeating. A key pressed for more than one-half second automatically repeats the transmission of the character. Key repeating does not affect SET-UP, ESC, RETURN, ENTER, NO SCROLL, and CTRL. Select auto repeat mode by using the following sequences.

Auto Repeat Mode (DECARM)

ESC  [   ?   8   h
033 133 077 070 150

Set selects auto repeat. A key pressed for more than one-half second automatically repeats.

ESC  [   ?   8   l
033 133 077 070 154

Reset turns off auto repeat. Keys do not automatically repeat.

Local Echo (Keyboard Send-Receive)

This mode selects local echo, which causes every character transmitted by the terminal to automatically appear on the screen. Therefore, the computer does not have to transmit (echo) the character back to the terminal for display. When local echo is off, the terminal only transmits characters to the computer. The computer must echo the characters back to the terminal for display. Select send-receive mode by using the following sequences.

Send-Receive Mode (SRM)

ESC  [   1   2   h
033 133 061 062 150

Set turns off local echo. The terminal transmits characters to the computer, which must echo characters for display on screen.

ESC  [   1   2   l
033 133 061 062 154

Reset selects local echo. Characters transmitted to the computer automatically appear on the screen.

Cursor Key Character Selection

In application keypad mode (DECKPAM), cursor key mode selects the set of characters transmitted by the cursor keys. In numeric keypad mode (DECKPNM), cursor key mode resets and cannot change. See Table 5-9 for the codes transmitted by the cursor keys. Select cursor key mode by using the following sequences.

NOTE: When you power up or use a Reset command, cursor key mode resets. This mode also resets during a communication line connection in all communication except full-duplex no modem control (FDX A). See Chapter 6 for more information about communication.

Cursor Key Mode (DECCKM)

ESC  [   ?   1   h
033 133 077 061 150

Set selects cursor keys to generate control (application) functions.

ESC  [   ?   1   l
033 133 077 061 154

Reset selects cursor keys to generate ANSI cursor control sequences.

Keypad Character Selection

The numeric keypad generates either numeric characters or control functions. Selecting application or numeric keypad mode determines the type of characters. The keypad mode also affects the cursor keys. See Cursor Key Character Selection in this chapter for more information. The program function (PF) keys generate the same characters regardless of the keypad character selection. See Table 5-10 for the characters generated by the keypad. Select the keypad mode by using the following sequences.

NOTE: When you power up or use a Reset command, the terminal selects numeric keypad mode. This mode is also selected during communication line connections, except full-duplex no modem control (FDX A). See Chapter 6 for more information about communication line connections.

Application Keypad Mode (DECKPAM)

ESC  =
033 075

Selects application keypad mode. Keypad generates control functions. Cursor key mode (DECCKM) selects type of characters generated by cursor keys.

Numeric Keypad Mode (DECKPNM)

ESC  >
033 076

Selects numeric keypad mode. Keypad generates characters that match the numeric, comma, period, and minus sign keys on main keyboard. Cursor keys generate ANSI cursor control sequences.

Character Sets and Selection

The terminal can display up to 254 different characters; however, the terminal only holds 127 display characters in basic read only memory (ROM). You must install an alternate character set ROM for the remaining 127 display characters.

The terminal can select only 94 characters (one character set) at a time. Therefore, the terminal uses the following five character sets, with some characters appearing in more than one set.

Tables 5.11, 5.12 and 5.13 show the character sets. The United States and United Kingdom character sets meet the standard of the "ISO international register of character sets to be used with escape sequences". The space (SP) and control characters are the same in all sets.

The terminal uses two active character sets at any one time. The computer designates these sets as G0 and G1, using the select character set (SCS) sequence. Then a single control character can switch between sets. Shift In (SI, octal 017) invokes the G0 character set; shift out (SO, octal 016) invokes the G1 character set.

The designated character sets are active until the terminal receives another SCS sequence. You can use the SCS sequence as often as needed to designate G0 and G1. Designate G0 by using the following sequences.

NOTE: The terminal uses the character set selected in SET-UP after all communication line connections, except full-duplex no modem control (FDX A). See Chapter 6 for more information about communication line connections.

Select Character Set (SCS)

ESC  (   A
033 050 101

Designates the UK character set as G0.

ESC  (   B
033 050 102

Designates the US character set as G0.

ESC  (   0
033 050 060

Designates the special characters and line drawing character set as G0.

ESC  (   1
033 050 061

Designates the alternate ROM character set as G0.

ESC  (   2
033 050 062

Designates the alternate ROM special characters character set as G0.

Designate G1 by using the following sequences.

Select Character Set (SCS)

ESC  )   A
033 051 101

Designates the UK character set as G1.

ESC  )   B
033 051 102

Designates the US character set as G1.

ESC  )   0
033 051 060

Designates the special characters and line drawing character set as G1.

ESC  )   1
033 051 061

Designates the alternate ROM character set as G1.

ESC  )   2
033 051 062

Designates the alternate ROM special characters character set as G1.

The terminal also has G2 and G3 character sets. However, these are always the default (selected in SET-UP) character sets. You select G2 and G3 for only one character at a time. The terminal returns to the previous character set after displaying a single character. Select G2 and G3 for one character by using the following sequences.

Single Shift 2 (SS2)

ESC  N
033 116

Selects G2 (default) character set for one character. You select G2 in SET-UP.

Single Shift 3 (SS3)

ESC  O
033 117

Selects G3 (default) character set for one character. You select G3 in SET-UP.

The terminal can transmit characters displayed on the screen to the optional serial printer. When transmitting characters to the printer, the terminal attempts to select the correct character set. If the printer does not support multiple character sets, using multiple character sets causes unexpected characters to print. Remember the following rules when the terminal transmits characters from more than one character set.

Before transmitting characters to the printer, the terminal must determine the character set selected. If the character is not in the currently selected G0 character set, the character sets are searched as follows.

  1. US/UK (selected in SET-UP)
  2. US/UK (not selected in SET-UP)
  3. Special characters and line drawing
  4. Alternate ROM
  5. Alternate ROM special characters

NOTE: The substitute character appears on the screen when the terminal receives a parity error, the SUB or CAN control characters, and the checker (octal 141) character in the special character and line drawing character set. The terminal always transmits the substitute character to the printer as the SUB (octal 032) character.

Character Attributes

The terminal can display the following character attributes that change the character display without changing the character.

You can select one or more character attributes at one time. Selecting an attribute does not turn off other attributes already selected. After you select an attribute, all characters received by the terminal appear with that attribute. If you move the characters by scrolling, the attribute moves with the characters. Select the character attributes by using the following sequences.

Select Graphic Rendition (SGR)

ESC  [   m   or  ESC  [   0   m
033 133 155      033 133 060 155

Turns off character attributes.

ESC  [   1   m
033 133 061 155

Selects bold (increased intensity).

ESC  [   4   m
033 133 064 155

Selects underline.

ESC  [   5   m
033 133 065 155

Selects blink.

ESC  [   7   m
033 133 067 155

Selects reverse video.

Tab Stops

You select tab stop positions on the horizontal lines of the screen. The cursor advances (tabs) to the next tab stop when the terminal receives a horizontal tab (HT, octal 011). If no tab stops are set, horizontal tab moves the cursor to the right margin. Set and clear the tab stops by using the following sequences.

Horizontal Tabulation Set (HTS)

ESC  H
033 110

Sets a horizontal tab stop at cursor position.

Tabulation Clear (TBC)

ESC  [   g   or  ESC  [   0   g
033 133 147      033 133 060 147

Clears a horizontal tab stop at cursor position.

ESC  [   3   g
033 133 063 147

Clears all horizontal tab stops.

Line Attributes

These are display features that affect a complete display line. The cursor selects the line affected by the attribute. The cursor stays in the same character position when the attribute changes. However, if the attribute would move the cursor past the right margin, the cursor stops at the right margin. When you move lines on the screen by scrolling, the attribute moves with the line. Select line attributes by using the following sequences.

NOTE: If you erase an entire line by using the erase in display (ED) sequence, the line attribute changes to single-height and single-width.

Double-Height Line (DECDHL)

Top Half:      Bottom Half:
ESC  #   3     ESC  #   4
033 043 063    033 043 064

Makes the line with the cursor the top or bottom half of a double-height, double-width line. Sequences work in pairs on adjacent lines. The same character must be used on both lines to form full characters. If the line was single-width, single-height, all characters to the right of center are lost.

Single-Width Line (DECSWL)

ESC  #   5
033 043 065

Makes the line with the cursor single-width, single-height. This is line attribute for all new lines on screen.

Double-Width Line (DECDWL)

ESC  #   6
033 043 066

Makes the line with the cursor double-width, single-height. If the line was single-width, single-height, all characters to the right of center screen are lost.

Erasing

Erasing removes characters from the screen without affecting other characters on the screen. Erased characters are lost. The cursor position does not change when erasing characters or lines.

If you erase a line by using the erase in display (ED) sequence, the line attribute becomes single-height, single-width. If you erase a line by using the erase in line (EL) sequence, the line attribute is not affected.

Erasing a character also erases any character attribute of the character. Erase characters by using the following sequences.

Erase In Line (EL)

ESC  [   K   or  ESC  [   0   K
033 133 113      033 133 060 113

Erases from cursor to end of line, including cursor position.

ESC  [   1   K
033 133 061 113

Erases from beginning of line to cursor, including cursor position.

ESC  [   2   K
033 133 062 113

Erases complete line.

Erase In Display (ED)

ESC  [   J   or  ESC  [   0   J
033 133 112      033 133 060 112

Erases from cursor to end of screen, including cursor position.

ESC  [   1   J
033 133 061 112

Erases from beginning of screen to cursor, including cursor position.

ESC  [   2   J
033 133 062 112

Erases complete display. All lines are erased and changed to single-width. Cursor does not move.

Computer Editing

Editing allows the computer to insert or delete characters and lines of characters at the cursor position. The cursor position does not change when inserting or deleting lines. Delete characters or insert and delete lines by using the following sequences.

NOTE: Insertion-replacement mode (IRM) selects how characters are added to the screen. See Inserting and Replacing Characters in this chapter for more information.

Delete Character (DCH)

ESC  [  Pn   P
033 133 *** 120

Deletes Pn characters, starting with the character at cursor position. When a character is deleted, all characters to the right of cursor move left. This creates a space character at right margin. This character has same character attribute as the last character moved left.

Insert Line (IL)

ESC  [  Pn   L
033 133 *** 114

Inserts Pn lines at line with cursor. Lines displayed below cursor move down. Lines moved past the bottom margin are lost. This sequence is ignored when cursor is outside scrolling region.

Delete Line (DL)

ESC  [  Pn   M
033 133 *** 115

Deletes Pn lines, starting at line with cursor. As lines are deleted, lines displayed below cursor move up. Lines added to bottom of screen have spaces with same character attributes as last line moved up. This sequence is ignored when cursor is outside scrolling region.

Inserting and Replacing Characters

The terminal displays received characters at the cursor position. This mode determines how the terminal adds characters to the screen. Insert mode displays the character and moves previously displayed characters to the right. Replace mode adds characters by replacing the character at the cursor position. Select insertion-replacement mode by using the following sequences.

NOTE: This mode resets after a communication line connection in all communication except full-duplex no modem control (FDX A). See Chapter 6 for more information about communication line connections.

Insertion-Replacement Mode (IRM)

ESC  [   4   h
033 133 064 150

Set selects insert mode and turns INSERT on. New display characters move old display characters to the right. Characters moved past the right margin are lost.

ESC  [   4   l
033 133 064 154

Reset selects replace mode and turns INSERT off. New display characters replace old display characters at cursor position. The old character is erased.

Printing

The terminal has a serial printer interface for local printing. The computer can select all print operations by using sequences. You can only select two of the print operations from the keyboard, auto print and print screen.

When you print characters from the screen, terminal and printer tab stops are ignored. Print characters are spaced with the space (SP, octal 040) character. The terminal transmits a carriage return (CR, octal 015) and linefeed (LF, octal 012) after the last printable character of a line -- but not a space character.

A line of double-height characters prints as two identical lines of single-width characters. Double-width characters print as single-width characters on a single line.

Before selecting a print operation, check the printer status by using the printer status report (DSR) in ANSI mode. Do not select a print operation if the serial printer is not ready to print. Select print operations by using the following sequences.

Media Copy (Auto Print On) (MC)

ESC  [   ?   5   i
033 133 077 065 151

Turns on auto print. A display line prints after you move cursor off the line, using a linefeed, form feed, or vertical tab (also transmitted to printer).

The line also prints during an auto wrap. Auto wrap lines end with a CR, LF.

Media Copy (Auto Print Off) (MC)

ESC  [   ?   4   i
033 133 077 064 151

Turns off auto print.

NOTE: Printer controller has a higher priority than auto print. Therefore, you can select printer controller and print characters during auto print.

Media Copy (Printer Controller On) (MC)

ESC  [   5   i
033 133 065 151

Turns on printer controller. The terminal transmits received characters to printer without displaying them. The terminal does not insert or delete spaces, provide line delimiters, or select the correct printer character set.

Media Copy (Printer Controller Off) (MC)

ESC  [   4   i
033 133 064 151

Turns off printer controller. Always move printhead to left margin before turning off printer controller.

Media Copy (Print Cursor Line) (MC)

ESC  [   ?   1   i
033 133 077 061 151

Prints display line with cursor. Cursor position does not change. Print cursor line ends when line prints.

Media Copy (Print Screen) (MC)

ESC  [   i   or  ESC  [   0   i
033 133 151      033 133 060 151

Prints the screen. Printer extent (DECEXT) selects full screen or scrolling region to print. Select scrolling region by using the set top and bottom margins (DECSTBM) sequence. Print screen ends when screen prints.

Printer Extent

This mode selects the full screen or the scrolling region to print during a print screen. Select printer extent mode by using the following sequences.

Printer Extent Mode (DECPEX)

ESC  [   ?   1   9   h
033 133 077 061 071 150

Set selects the full screen to print during a print screen.

ESC  [   ?   1   9   l
033 133 077 061 071 154

Reset selects the scrolling region to print during a print screen.

Print Termination Character

This mode determines if the terminal should transmit a print termination character after a print screen. The form feed (octal 014) control character serves as the print termination character. Select printer form feed mode by using the following sequence.

Printer Form Feed Mode (DECPFF)

ESC  [   ?   1   8   h
033 133 077 061 070 150

Set selects form feed as print termination character. The terminal transmits this character to printer after each print screen.

ESC  [   ?   1   8   l
033 133 077 061 070 154

Reset selects no termination character.

Reports

The terminal transmits reports in response to computer requests. Reports determine terminal type and status, and cursor position. The report requests and responses are as follows.

NOTE: The terminal does not respond to the DSR, DA, or DECID sequences during printer controller operation.

Device Status Report (DSR)

ESC  [   5   n
033 133 065 156

Computer requests a status report (using a DSR sequence).

ESC  [   0   n
033 133 060 156

Terminal response: Ready, no malfunctions detected.

ESC  [   3   n
033 133 063 156

Terminal response: Malfunction, error in self-test. Reset and retry.

ESC  [   ?   1   5   n
033 133 077 061 065 156

Computer requests a printer status report. Terminal checks status of printer. This report should be requested before any printer operation.

ESC  [   ?   1   3   n
033 133 077 061 063 156

Printer not connected to terminal. Data terminal ready (DTR) signal of the printer has not been on since terminal turned on.

ESC  [   ?   1   1   n
033 133 077 061 061 156

Printer not ready to print. Printer DTR was on, but is now off.

ESC  [   ?   1   0   n
033 133 077 061 060 156

Printer ready to print. Printer DTR is on.

ESC  [   6   n
033 133 066 156

Computer requests a cursor position report from terminal.

Cursor Position Report (CPR)

ESC  [  Pl   ;  Pc   R
033 133 *** 073 *** 122

Terminal reports cursor position in response to DSR sequence request from computer. Pl indicates line and Pc indicates column. No parameters, or parameters of 0, indicate cursor is at home position. Origin mode (DECOM) selects line numbering.

Device Attributes (DA)

ESC  [   c   or  ESC  [   0   c
033 133 143      033 133 060 143

Computer requests terminal identify itself.

Identify Terminal (DECID)

ESC  Z
033 132

Computer requests terminal to identify itself. Terminal uses device attributes (DA) to respond. Future DIGITAL terminals may not support this sequence. Therefore, new software should use device attributes.

Device Attributes (DA)

ESC  [   ?   6   c
033 133 077 066 143

Terminal response: VT102.

Reset

Reset initializes the terminal and causes it to perform the internal power-up self-test, erase the input buffer, and use the SET-UP selections in user memory. Characters received during a reset are lost. To prevent this, the computer may act in one of two ways.

  1. (With auto XON/XOFF) Immediately after sending the reset sequence, the computer should assume an XOFF from terminal. The computer stops sending characters until it receives XON. The terminal transmits XON only after it completes the reset.
  2. (Without auto XON/XOFF) Use a delay of no less than 10 seconds to allow the terminal to complete the function. This method, however, does not guarantee against loss of characters when a reset error is detected.

The terminal disconnects from the communication line during a reset. After a reset, the terminal selects keypad numeric mode (DECKPNM) and resets origin mode (DECOM). The terminal also selects the top and bottom margins (scrolling region) for the full screen (DECSTBM). Reset the terminal by using the following sequence.

Reset to Initial State (RIS)

ESC  c
033 143

Resets the terminal to its initial state.

Tests

DECTST selects the self-tests used to verify terminal operation. Self-tests provide error indications on the keyboard indicators or screen. See Chapter 9 for the meaning of the displayed errors. The terminal reports the test results (pass or fail) to the computer by using a device status report (DSR) sequence.

The terminal loses received characters while performing the test. To prevent this, the computer may act in one of two ways.

  1. (With auto XON/XOFF) Immediately after sending the invoke confidence test sequence, the computer should assume an XOFF from terminal. The computer stops sending characters until it receives XON. The terminal transmits XON only after it completes the test.
  2. (Without auto XON/XOFF) Use a delay of no less than 10 seconds to allow the terminal to complete the test. This method, however, does not guarantee against loss of characters when an error is detected.

Select terminal self-tests by using the following sequences.

Invoke Confidence Test (DECTST)

ESC  [   2   ;   1   y
033 133 062 073 061 171

Power-up test. Terminal resets and performs power-up test.

ESC  [   2   ;   2   y
033 133 062 073 062 171

Data loopback test. Uses test connector on modem interface connector.

ESC  [   2   ;   4   y
033 133 062 073 064 171

EIA loopback test. Uses test connector on modem interface connector.

ESC  [   2   ;   1   6   y
033 133 062 073 061 066 171

Printer loopback test. Uses test connector on printer interface connector.

ESC  [   2   ;   9   y
033 133 062 073 071 171

Repeats power-up test continuously until failure or power turned off.

ESC  [   2   ;   1   0   y
033 133 062 073 061 060 171

Repeats data loopback test continuously until failure or power turned off. Uses test connector on the modem interface connnector.

ESC  [   2   ;   1   2   y
033 133 062 073 061 062 171

Repeats EIA loopback test continuously until failure or power turned off. Uses test connector on modem interface connector.

ESC  [   2   ;   2   4   y
033 133 062 073 062 064 171

Repeats printer loopback test continuously until failure or power turned off. Uses test connector on printer interface.

Adjustments

The terminal has a screen alignment pattern that lets Field Service personnel adjust the screen. Display the screen alignment pattern by using the following sequence.

Screen Alignment Display (DECALN)

ESC  #   8
033 043 070

Fills screen with uppercase E's for screen focus and alignment. This command is used by DIGITAL Manufacturing and Field Service personnel.

Keyboard Indicator

You can program the L1 indicator (LED) for specific applications. Turn L1 on or off by using the following sequences.

Load LED (DECLL)

ESC  [   0   q
033 133 060 161

Turns L1 off.

ESC  [   1   q
033 133 061 161

Turns L1 on.

VT52-Compatible Sequences

VT52-compatible sequences meet private DIGITAL standards. Therefore, the terminal can use existing software designed for previous terminals (such as the VT52). You can select VT52 compatibility from the keyboard in SET-UP (Chapter 3), or the computer can use a sequence. (See ANSI-Compatible Sequences in this chapter).

Modes

In VT52 mode, you cannot select most terminal features by using sequences. You can, however, select the following three modes by using sequences: ANSI mode, application keypad mode on, and application keypad mode off (numeric keypad mode on).

ANSI/VT52 Compatibility

The terminal is compatible with both ANSI and private DIGITAL standards. Therefore, the terminal can use new software that meets ANSI standards and existing software designed for previous terminals (such as the VT52). ANSI-compatible sequences meet standards X3.64-1979 and X3.41-1974. You use ANSI mode to select most terminal features; the terminal uses the same features when it switches to VT52 mode. You cannot, however, change most of these features in VT52 mode. Select ANSI compatibility by using the following sequence.

ANSI Mode (DECANM)

ESC  <
033 074

The terminal interprets all sequences according to ANSI standards X3.64-1979 and X3.41-1974. The VT52 escape sequences described in this chapter are not recognized.

Cursor Positioning

The cursor indicates the active screen position where the next character will appear. You must select the margins for VT52 mode in ANSI mode. If you do not select margins, the terminal uses the complete screen. The cursor moves:

You can also move the cursor by using the following sequences.

Cursor Up

ESC  A
033 101

Moves cursor up one line in same column. Cursor stops at top margin.

Cursor Down

ESC  B
033 102

Moves cursor down one line in same column. Cursor stops at bottom margin.

Cursor Right

ESC  C
033 103

Moves cursor one column to right. Cursor stops at right margin.

Cursor Left

ESC  D
033 104

Moves cursor one column to left. Cursor stops at left margin.

Cursor to Home

ESC  H
033 110

Moves cursor to home position.

Direct Cursor Address

ESC  Y   line  column
033 131  ***   ***

Moves cursor to specified line and column. Line and column numbers are ASCII character whose codes are their octal value plus octal 037. For example, line 1 column 8 parameters are octal 040 (first line) and octal 050 (eighth column).

Reverse Linefeed

ESC  I
033 111

Moves cursor up one line in same column. If cursor is at top margin, screen performs scroll-down.

Keypad Character Selection

The numeric keypad generates either numeric characters or control functions. Select application keypad mode to generate control functions. Exit application keypad mode (select numeric keypad mode) to generate numeric characters. See Table 5-14 for the characters generated by the keypad. Enter and exit application keypad mode by using the following sequences.

NOTE: When you power up or use a Reset command, the terminal exits application keypad mode (selects numeric keypad mode). This mode is also selected during communication line connections, except full-duplex no modem control (FDX A). See Chapter 6 for more information about communication line disconnects.

Enter Application Keypad Mode

ESC  =
033 075

Keypad generates sequences used by the applications program.

Exit Application Keypad Mode (Numeric Keypad Mode)

ESC  >
033 076

Keypad generates characters that match the numeric, comma, period, and minus sign keys on main keyboard.

Character Sets and Selection

In VT52 mode, the terminal uses either the US/UK character set selected in SET-UP or the special characters and line drawing character set. Tables 5-11 and 5-12 show the United Kingdom and United States character sets. Table 5-13 shows the special characters and line drawing character set. Table 5-15 compares the special characters and line drawing character set to VT52 graphics mode (character set). Select the character sets by using the following sequences.

NOTE: The character set selected in SET-UP is used after all communication line connections, except full-duplex no modem control (FDX A). See Chapter 6 for more information about communication.

Enter Graphics Mode

ESC  F
033 106

Selects the special characters and line drawing character set.

Exit Graphics Mode

ESC  G
033 107

Selects the character set selected in SET-UP.

Erasing

Erasing removes characters from the screen. Erased characters are lost. Erase characters by using the following sequences.

Erase to End of Line

ESC  K
033 113

Erases all characters from cursor to end of current line, including cursor position. Cursor does not move.

Erase to End of Screen

ESC  J
033 112

Erases all characters from cursor to end of screen, including cursor position. Cursor does not move.

Printing

The terminal has a serial printer interface for local printing. The computer can select all print operations by using sequences. You can only select two print operations from the keyboard, auto print and print screen.

When you print characters from the screen, terminal and printer tab stops are ignored. Characters printed are spaced with the space (SP, octal 040) character. The terminal transmits a carriage return and linefeed - but not a space character - after the last printable character of a line.

A line of double-height characters prints as two identical lines of single-width characters. Double-width characters print as single-width characters on a single line.

Before selecting a print operation, check the printer status by using the printer status report (DSR) in ANSI mode. Do not select a print operation if the serial printer is not ready to print. Select print operations by using the following sequences.

Auto Print

ESC  ^
033 136

Turns on auto print. A display line prints after you move cursor off the line, using a linefeed, form feed, or vertical tab (also transmitted to printer).

The line also prints during an auto wrap. Auto wrap lines end with CR, LF.

ESC  _
033 137

Turns off auto print.

NOTE: Printer controller has a higher priority than auto print. Therefore, you can select printer controller and print characters during auto print.

Print Controller

ESC  W
033 127

Turns on printer controller. The terminal transmits received characters to printer without displaying them. The terminal does not insert or delete spaces, provide line delimiters, or select printer character set.

ESC  X
033 130

Turns off printer controller. Always move printhead to left margin before turning off printer controller.

Print Cursor Line

ESC  V
033 135

Prints display line with cursor. Cursor position does not change. Print cursor line ends when the line prints.

Print Screen

ESC  ]
033 126

Prints the screen. Printer extent (DECPEX) selects full screen or scrolling region to print. Select scrolling region by using DECSTBM sequence. Print screen ends when screen prints.

Reports

The terminal transmits reports in response to computer requests. The terminal generates only one report in VT52 mode. The report requests and responses are as follows.

Identify

ESC  Z
033 132

Terminal sends an identify sequence to computer.

ESC  /   Z
033 057 132

VT102 response to identify sequence. (Same as VT52).