The text of a manual · part 33 of 46
TE 2000 VT/ANSI Terminal Emulation Programmer's Guide: Chapter 6: Programming, pages 275 to 283
Pages 275 to 283 of 400, from TE 2000 VT/ANSI Terminal Emulation Programmer's Guide
The original document is the PDF (3.1 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the Intermec 5020
Page 275
Chapter 6, Programming
Device Status Reports (DSR) The following table shows the action taken by the terminal when it receives device status report exchanges, when the host computer asks for the general operating status of the terminal or printer, or both. If the terminal is in printer controller mode, the printer receives the DSR request but cannot answer. DSR Exchange
Communication
Sequence
Action
VT220
Host to VT220 (Request for status)
CSI 5 n
Ignores this code.
VT220 to host (DA response)
CSI 0 n or CSI 3 n Ignores these codes.
Host to VT220 (Request for cursor position)
CSI 6 n
“Please report your cursor position using a CPR (not DSR) control sequence.”
VT220 to host (CPR response)
CSI Pv; Ph R
“My cursor is positioned at _____ (Pv); _____ (Ph).” (Pv=row, Ph=column)
Request for printer status
CSI ? 15 n
What is the printer status?
Response
CSI ? 13 n
No printer.
Request for UDK status
CSI ? 25 n
Ignored in VT100 mode.
Response
CSI ? 20 n
UDKs are unlocked.
CSI ? 21 n
UDKs are locked.
Printer port User-defined keys
Keyboard language Request for keyboard language CSI ? 26 n Response
CSI ? 27; Pn n
What is the keyboard language? North American keyboard dialect.
Identification The terminal supports the identification sequence.
250
Name (Mnemonic)
Sequence
Action
Identification (DECID)
ESC Z
Ignored
TE 2000 VT/ANSI Terminal Emulation Programmer’s Guide
Page 276
Chapter 6, Programming
Terminal Reset Terminal reset escape sequences cause either a soft terminal reset or a hard terminal reset.
Soft Terminal Reset (DECSTR) Note: The DECSTR control function is available for all VT/ANSI modes. DECSTR changes most of the terminal’s current settings to the power-up default settings listed in the following table. The escape sequence is: CSI ! p
DECSTR affects only those functions listed in the following table. Soft Terminal Reset (DECSTR) States Mode
Mnemonic
State After DECSTR
Text cursor enable
DECTCEM
Cursor enabled.
Insert/replace
IRM
Replace. (“Insert” if local editing mode.)
Origin
DECOM
Absolute (cursor origin at upper-left of screen).
Auto wrap
DECAWM
No auto wrap.
Keyboard action
KAM
Unlocked.
Numeric Keypad
DECNKM
Numeric characters.
Cursor keys
DECCKM
Normal (arrow keys).
Edit
DECEDM
Interactive.
Transmit execution
DECTEM
Immediate.
Erasure
ERM
All characters.
Guarded area transfer
GATM
All characters.
Multiple area transfer
MATM
All selected areas.
Selected area transfer
SATM
All areas.
Scanner lock
TE 2000 VT/ANSI Terminal Emulation Programmer’s Guide
Reset.
251
Page 277
Chapter 6, Programming
The following table lists other control functions. All tab stops are reset. User-defined keys are cleared. Soft Terminal Reset (DECSTR) States Mode
Mnemonic
State After DECSTR
Set top and bottom margins DECSTBM
Top margin = 1. Bottom margin = page length.
All character sets
G0, G1, G2, G3, GL, GR VT/ANSI default settings.
Select graphic rendition
SGR
Normal rendition.
Start of selected area
SSA
Cleared.
End of selected area
ESA
Cleared.
Start of protected area
SPA
Cleared.
End of protected area
EPA
Cleared.
Save cursor state
DECSC
Home position with VT/ ANSI defaults.
Hard Terminal Reset (RIS) When the RIS is complete, the terminal sends XON to resume communication. The RIS sequence is: ESC c
RIS resets values to factory default settings. It is the same as DECSTR, but also does the following: S Clears the screen. S Returns cursor to the upper-left corner of the screen. S Sets SGR function to normal rendition.
Tests and Adjustments The terminal has adjustment patterns you can invoke from the host computer with escape sequences. Adjustment sequences send uppercase Es to the terminal’s display. Only qualified technicians perform adjustment procedures. The following table shows the action taken by the terminal when it receives test and adjustment sequences.
252
Name (Mnemonic)
Sequence
Action
Tests (DECTST)
CSI 4 ; Ps ; ..... ; Ps y
Ignored
Adjustments (DECALN)
ESC # 8
Fills display with uppercase Es
TE 2000 VT/ANSI Terminal Emulation Programmer’s Guide
Page 278
Chapter 6, Programming
VT52 Mode Escape Sequence The terminal does not support VT52 mode, which allows the VT/ANSI Terminal to operate with DEC software written for VT52 Terminals.
Define Area Qualification The define area qualification (DAQ) command indicates that the active position is the first character position of a qualified area. The end of a qualified area is indicated by the beginning of the following qualified area. The qualifications of the area are specified according to the parameter(s). The following table lists qualification sequences. Note: DAQ is ignored unless the terminal is in VT340 mode.
Qualification
Sequence and Ps (Single Parameter)
Action
Accept all input
CSI 0 o
Accepts all input
Accept no input (protected) and do not transmit (guarded)
CSI 1 o
Accepts no input
Accept graphics
CSI 2 o
Accepts graphics
Accept numerics
CSI 3 o
Accepts numerics
Accept alphabetics
CSI 4 o
Accepts alphabetics
Right justify in area
CSI 5 o
Right justifies area
Zero fill in area
CSI 6 o
Fills area with zeros.
Horizontal tab stop at start of area
CSI 7 o
Puts horizontal tab stop at start of area
Accepts no input (protected), but select for transmission (unguarded)
CSI 8 o
Accepts no input
Space fill in area
CSI 9 o
Fills area with spaces
Invisible
CSI 1 0 o
Makes passwords invisible
Private Sequences Private sequences enable or disable autosend. Mode
Sequence*
Action
Set
ESC [ = 3 l
Enables autosend. Transmits the screen when the last field is filled. If you are on the last defined field and get data from the bar code reader or RS-232 port, the display will also be automatically sent even if the field not filled.
Reset
ESC [ = 3 h
Disables autosend. Only transmits when a terminating key is pressed.
*
The last character of the set mode sequence is lowercase L (6C hexadecimal).
TE 2000 VT/ANSI Terminal Emulation Programmer’s Guide
253
Page 279
Chapter 6, Programming
Proprietary Sequences Following are INTERMECR extensions to the data stream.
Line Edit and Character Modes Two proprietary escape sequences enable the host to put the terminal into Line Edit (block) mode or Character mode. Note that the terminal enters Character mode when it is cold-started. Mode
Sequence*
Line Edit
CSI = 1 l
Character
CSI = 1 h
*
The last character of the Line Edit sequence is lowercase L (6C hexadecimal).
Norcompress The Norcompress function handles the norrc command, where “a” is the number of iterations that “b” occurs in the datastream. The sequence for Norcompress is CSI a;bz.
Scanner Lock Mode Scanner lock mode is similar to the KAM function; however, you do not need to repeatedly send the Locked command (this command is assumed after each scan). Mode
Sequence*
Action
Set
CSI = 4 h
The host sends this sequence, which puts the terminal into Scanner Lock mode. When the terminal is in this mode, only one scan is allowed; the scanner is then inhibited. After this sequence is sent, the user can scan only once (no additional scans are allowed). To re-enable the scanner, the host must send CSI 2 l to unlock the scanner.
Reset
CSI = 4 l
Resets Scanner Lock mode (default).
*
The last character of the reset sequence is lowercase L (6C hexadecimal).
The scanner lock state can also be reset by the RIS command (ESC c) or the DECSTR command (CSI ! p).
254
TE 2000 VT/ANSI Terminal Emulation Programmer’s Guide
Page 280
Chapter 6, Programming
VT340 Applications VT340 Terminal applications supported by the terminal include setting the right margin, using control functions, and creating text forms.
Right Margin The terminal’s display contains 2 to 80 columns. To ensure that the cursor will not go beyond Column Pn, use the following sequence to set the number of columns (Pn is a number from 2 to 80): CSI Pn $ ¦
Control Functions In editing mode you can use the erasure, deletion, and insertion control functions. The character protection field lets you design text forms that cannot be changed or overwritten. In edit mode, character protection also depends on the setting of erasure mode (ERM): S If ERM is set all characters can be changed, erased, and moved, regardless of protection. S If ERM is reset only unprotected characters can be changed, erased, and moved. These control functions will not affect protected areas in page memory: S Insert line (IL) S Delete line (DL) S Insert character (ICH) S Delete character (DCH) S Erase in display (ED) S Erase in line (EL) S Erase character (ECH)
TE 2000 VT/ANSI Terminal Emulation Programmer’s Guide
255
Page 281
Chapter 6, Programming
Text Forms When using C1 control characters SPA, EPA, SSA, and ESA to create forms on the host, the rows and columns to which the cursor moves must be in sequential order. The following shows some sequences that create a text form, start with the left column. Control Characters for Auto-Login Script File Sequence
Definition
Sequence
Definition
ESC [ 1; 1 H
Home cursor
ESC V
Start protected area
ESC [ 2 J
Clear screen
ESC [ 4; 1 H
Move cursor to Row 4, Col 1
ESC [ ? 10 h
Start local editing mode
“Lot:”
Display literal
ESC V
Start protected area
ESC [ 1 D
Move cursor back 1 position
ESC [ 1; 2 H
Move cursor to Row 1, Col 2
ESC W
End protected area
“Manufacturing”
Display literal
ESC [ 1 C
Move cursor forward 1 position
ESC [ 1 ; 17 H
Move cursor to Row 1, Col 17
ESC F
Start selected area
“Receiving”
Display literal
ESC [ 4; 9 H
Move cursor to Row 4, Col 9
ESC [ 2; 1 H
Move cursor to Row 2, Col 1
ESC G
End selected area
“LIP:”
Display literal
ESC V
Negative Acknowledge
ESC W
End protected area
ESC [ 5; 1 H
Move cursor to Row 5, Col 1
ESC [ 1 D
Move cursor back 1 position
“Qty:”
Display literal
ESC W
End protected area
ESC [ 1 D
Move cursor back 1 position
ESC [ l C
Move cursor forward 1 position
ESC W
End protected area
ESC F
Start selected area
ESC [ 1 C
Move cursor forward 1 position
ESC [ 2; 15 H
Move cursor to Row 2, Col 15
ESC F
Start selected area
ESC G
End selected area
ESC [ 5; 13 H
Move cursor to Row 5, Col 13
ESC V
Start protected area
ESC G
End selected area
ESC [ 3; 1 H
Move cursor to Row 3, Col 1
ESC V
Start protected area
“Item:”
Display literal
ESC [ 24; 80 H
Move cursor to Row 24, Col 80
ESC [ 1 D
Move cursor back 1 position
ESC W
End protected area
ESC W
End protected area
ESC [ 26 $ |
Set the number of Cols to 26
ESC [ 1 C
Move cursor forward 1 position
ESC [ 1; 8 r
Set top at 1, bottom at 8 Rows
ESC F
Start selected area
ESC [ 3 g
Clear tab stops
ESC [ 3; 16 H
Move cursor to Row 3, Col 16
ESC [ 2; 5 H
Move cursor to Row 2, Col 5
ESC G
End selected area
256
TE 2000 VT/ANSI Terminal Emulation Programmer’s Guide
Page 282
Chapter 6, Programming
If this information is entered on the form: 111111111 2222222222 3333 44444444 for “LIP:” for “Item:” for “Lot:” for “Qty:”
The data stream will be sent to the host as indicated in the following chart. (If guarded area transfer mode (GATM) is reset, then the record separator is processed as a protected field entry.) Sequence
Definition
Sequence
Definition
RS
Protected field Line 1
3333
Selected field Line 4
RS
First protected field Line 2
RS
Second protected field Line 4
111111111
Selected field Line 2
RS
First protected field Line 5
RS
First protected field Line 3
44444444
Selected field Line 5
RS
First protected field Line 3
RS
Second protected field Line 5
2222222222
Selected field Line 3
RS
Protected field Line 6
RS
Second protected field Line 3
RS
Protected field Line 7
RS
First protected field Line 4
RS
Protected field Line 8
ANSI Mode Sequences Cursor Positioning The terminal supports cursor positioning sequences in the following table. Name (Mnemonics)
Sequence
Action
Cursor backward tab (CVT)
CSI Ps Z
Moves the cursor to previous Ps tab stop(s). If there is no previous tab stop, then the cursor moves to the left margin.
Cursor horizontal absolute (CHA)
CSI Ps G
Moves the cursor to the Ps column on the current line.
Cursor horizontal tab (CHT)
CSI Ps I
Moves the cursor to the next Ps tab stop(s). If there is not next tab stop, then the cursor moves to the right margin.
Cursor next line (CNL)
CSI Ps E
Moves the cursor down Ps lines. If at the bottom margin of the screen, then the cursor is not moved.
Cursor previous line (CPL)
CSI Ps F
Moves the cursor up Ps lines. If at the top margin of the screen, then the cursor is not moved.
Horizontal position absolute (HPA)
CSI Ps
Moves the cursor to Ps column on the current line.
Horizontal position relative (HPR)
CSI Ps a
Moves the cursor Ps columns from the current location. If past the right margin, then the cursor is stopped at the right margin.
Vertical position absolute (VPA)
CSI Ps d
Moves the cursor to Ps row using the current column.
Vertical position relative (VPR)
CSI Ps e
Moves the cursor Ps rows from the current location. If at the bottom margin, the cursor is stopped at the bottom margin.
Cursor vertical tab (CVT)
CSI Ps Y
Moves the cursor down Ps vertical tab stops. If at the bottom margin, then the cursor is stopped.
TE 2000 VT/ANSI Terminal Emulation Programmer’s Guide
257
Page 283
Chapter 6, Programming
Cursor Tabulation Control The following table lists cursor tabulation control (CBT) sequences in ANSI mode. Sequence
Action
CSI 0 W
Sets horizontal tab stop at current location.
CSI 1 W
Sets vertical tab stop at current location.
CSI 2 W
Clears horizontal tab stop.
CSI 3 W
Clears vertical tab stop.
CSI 4 W
Clears all horizontal tab stops this line.
CSI 5 W
Clears all horizontal tabs stops in the machine.
CSI 6 W
Clears all vertical tab stops
Scrolling The following table lists scrolling sequences in ANSI mode. Name (Mnemonics)
Sequence
Action
Scroll up (SU)
CSI Ps S
Scrolls display up Ps lines.
Scroll down (SD)
CSI Ps T
Scrolls display down Ps lines.
Transmitted Keyboard Codes Transmitted codes are generated by the terminal’s keys and sent to the host computer or software application in use. The following pages describe the capability of the terminals to emulate codes generated by the VT/ANSI terminal keyboard’s main keypad, editing keypad, auxiliary keypad, and top-row function keys. Codes are sent via Line Edit (block) mode or optimized Character mode selected through the keyboard function labeled MODE on the overlay.
Line Edit (Block) Mode Line Edit (block) mode is a synchronous condition where the terminal temporarily stores or “buffers” keys you press. It sends the cumulative data to the host computer when you press one of these terminating keys: S [Enter] S [F6] through [F20], [PF1] through [PF4] S [CTRL]+[A] through [CTRL]+[Z] S Forward Tab S DEL (7F hexadecimal) S Backspace
258
TE 2000 VT/ANSI Terminal Emulation Programmer’s Guide