Ann Arbor Ambassador User Guide

Programmable Strings

Programmable Features

The Ambassador provides the following programmable string capabilities:

Device Control Strings

The terminal control DCS (ESC P) is used to load the programmable strings. The Ambassador recognizes characters following this control as programming instructions to the terminal.

These programming instructions consist of a series of one or more string table entries. Each entry indexes to one of the programmable strings and loads it with the character codes that follow. These characters then become the string that is transmitted when a programmable key is depressed, or an operational string is activated.

Since DCS controls are normally sent from a host program to the Ambassador for execution, the commands are designed to facilitate programmatic control of the programmable strings. However, a terminal operator may also make use of the DCS control by placing the Ambassador into Local Test Mode (Setup T) and manually keying in the control sequence.

Operational Strings

The Ambassador provides the following operational strings. The strings can be loaded, changed, and disabled with the DCS (ESC P) control.

Header. The Header string precedes all transmissions from the terminal's Display Memory to the host. It is initialized to null (i.e. no codes) at power-on.

Trailer. The Trailer string follows all transmissions from the terminal's Display Memory to the host. If a transmission is aborted, the trailer is still sent. It is initialized to null at power-on.

ENQ. The ENQ string is sent in response to a received ENQ (0/5) code. It is initialized to null at power-on.

DA. The DA string is sent in response to a received DA (ESC [ c) control. It is initialized at power-on with the release-revision-options number of the terminal's firmware.

Power-On String

The Ambassador provides a Power-on string that permits a string of controls to be loaded into non-volatile (i.e. permanent) memory, to be automatically executed each time the terminal is powered-on. This string may be used to initialize the terminal to a desired state, e.g. to initialize key codes, tab stop positions, or screen format, or just to display initial instructions; see Power-On Examples, below.

There may be occasions when the operator wishes to initialize the terminal without executing the Power-on string. This may be done by holding down the RESET key as the terminal is powered-on.

Key Strings

The remainder of the programmable strings are Key strings. These are loaded at power-on with default strings (see Keyboard section), but may be re-programmed by the user with the DCS control.

When a programmed key is typed, the loaded string is generated exactly as with any other key. In Simultaneous SRM, it is sent to the host (which may or may not echo it back). In Monitor SRM, it is executed locally.

The programmable keys are listed in Table III. Note that some of the keys control two strings – one when unshifted, another when shifted. Any of these keys may be re-programmed, or disabled, or programmed to a different key position. They may be returned to their initial state, after having been changed or disabled, by using the DCS control, to re-load them with their default strings.

Programming the Strings

The DCS control to program the Operational and Key strings begins with the codes 1/11 5/0 (ESC P) followed by the code 6/0 (`) to identify the start of a string table entry. (The DCS control to program the Power-on string uses the code 7/0 (p), instead of the code 6/0 (`), to identify the start of its string entry; see Power-On Examples, below.)

The first character in a string table entry is the index (address) of the string to be programmed. The indices are codes in the range 2/0 (Sp) to 5/15 (_) and are listed in Tables II and III. (No index is required in programming the Power-on string.)

Immediately following the index is the data portion of the string table entry. This is the actual character string that is assigned as a result of the DCS command. Characters in the data portion are limited (basically) to ASCII codes in the range 2/0 (Sp) to 5/15 (_) inclusive. To allow the user to include characters from the full range of ASCII codes (0/0 to 7/15), the Ambassador also recognizes certain control codes and delimiters; see Table I.

To allow for the inclusion of ASCII codes in the range 0/0 to 1/15, the code 7/14 (~), appearing in the data portion of a string table entry, is interpreted by the Ambassador as a non-latching control shift, and causes the next code, which should be in the range 4/0 (@) to 5/15 (_), to be interpreted as a code in the range 0/0 (NUL) to 1/15 (US). (Referring to the ASCII code table in the Appendix – The control-shift forces b6 and b7 to zero. Thus codes beginning with a '4' are interpreted as beginning with a '0', and those beginning with a '5' are interpreted as beginning with a '1').

To allow for the inclusion of ASCII codes in the range 6/0 to 7/15, the code 7/11 ({), appearing in the data portion of a string table entry, is interpreted by the Ambassador as a latching lower-case shift, and causes the following codes, which should be in the range 4/0 (@) to 5/15 (_), to be interpreted as codes in the range 6/0 (`) to 7/15 (DEL). The code 7/13 (}) terminates the lower-case shift. (Referring to the ASCII code table in the Appendix – The lower-case shift forces b6 to one. Thus, codes beginning with a '4' are interpreted as beginning with a '6', and codes beginning with a '5' are interpreted as beginning with a '7').

The end of a string table entry is determined by the start of another entry, or by the ST (ESC \) control.

Another entry may be started by the code 6/0 (`) followed by an index to the next string to be programmed. Alternatively, if the next string to be programmed is the next (sequential) string, the code 7/12 (|) may be used alone. (The code 7/12 increments the index).

For Key strings, there are three other (control) codes, that may be used at the beginning of the data portion of a string table entry, that affect what happens when a key is typed.

The code 7/8 (x) may be used to set a 'repeat' flag for the key. This will cause its programmed string to be generated repeatedly while the key is held down. If used, this code should be the first character of the data portion of the entry (i.e. immediately following the index for the string). Note: Keys programmed to 'repeat' will repeat regardless of the setting of zKRM. The repeat rate is controlled by zFRM.

The code 7/9 (y) may be used (following the 'x' if used) to tag the key as 'Local only'. This will cause its programmed string to be executed locally in both Simultaneous and Monitor SRM when the key is typed.

The code 7/10 (z) may be used (followng the 'x' if used) to tag the key as 'Transmit only'. This will cause the programmed string to be sent to the host in both Simultaneous and Monitor SRM when the key is typed.

Disabling a String

If a string is addressed (i.e. its index given) and no characters are given in the data portion of the entry, the string is disabled.

DCS Examples

The following examples may be entered locally by going into Local Test (by typing the 2-key sequence SETUP T), and then typing in the example strings. The entry may be observed on the Monitor line as it is typed. ESC denotes the ESC-key, and is shown on the Monitor line as a reverse left-bracket ([).

The spaces shown between characters are for clarity (and should not be included in the string). Likewise, some strings are broken into multiple lines for purpose of annotation (and the new-lines should not be included in the string).

ESC P ` H H E L L O ESC \
This DCS sequence loads PF1 with the string, HELLO, i.e. the word, HELLO, is generated each time the PF1 key is typed. The grave-accent (`) following the P is the character under the tilde (~) on the keyboard. The components of this string are as follows:

ESC P Start of a DCS string
` Start of a string table entry
H Index to the PF1 key
HELLO Data portion of the string table entry
ESC \ String terminator to end the DCS string

ESC P ` H x H E L L O ESC \
This DCS sequence also loads PF1 with the string, HELLO. Now, since we have included the x-parameter, the key will repeat while it is held down.

ESC P ` I x H { E L L O } ESC \
This DCS causes PF2 to generate the word, Hello, in upper/lower-case. The x causes the key to repeat while held down. The braces ({..}) cause the enclosed characters to be translated to lower-case.

ESC P ` > | | | | | | ESC \
This DCS disables the ERASE, EDIT, DELETE, and INSERT keys. The greater-than (>) indexes to the ERASE key in the unshifted mode. Each vertical bar (|) indexes to the next sequential string (i.e. the ERASE key shifted, the EDIT key, etc.; see Table III.) Since the data portion of all the entries is empty, the keys are disabled.

ESC P ` J x * ~ [ D | x # ~ [ M ESC \
This DCS causes the PF3 key to generate a descending diagonal of asterisks, and the PF4 to generate an ascending diagonal of pound signs. The tilde (~) causes the left-bracket ([) to be interpreted as CTRL [, or ESC. PF3 is loaded with the string, * ESC D. ESC D is the IND (Index) control. PF4 is loaded with the string, # ESC M. ESC M is the RI (Reverse Index) control. The components of this string are as follows:

ESC P Start of DCS
` Start of string table entry
J Index to PF3 key
x Repeat code for PF3
*~[D Data for PF3 table entry
| Index to next string (i.e. PF4)
x Repeat code for PF4
#~[M Data for PF4 table entry
ESC \ ST control to end DCS

Power-On Examples

The Power-on string is loaded using a DCS control similar to that used load the Operational and Key strings, except that the code 7/0 (p) is used to identify the start of the string (instead of 6/0), and no indices are required. All DCS coding restrictions apply.

Like the DCS examples above, these examples may be entered locally by going into Local Test (by typing the 2-key sequence SETUP T), and then typing in the example strings. The entry may be observed on the Monitor line as it is typed. ESC denotes the ESC-key, and is shown on the Monitor line as a reverse left-bracket ([).

The spaces shown between characters are for clarity (and should not be included in the string). Likewise, some strings are broken into multiple lines for purpose of annotation (and the new-lines should not be included in the string).

The string may be executed (to demonstrate its results) without having to power down, by depressing CTRL-SHIFT-RESET (or just RESET, if the terminal is in Local Test). The string is executed if the RESET key is just momentarily typed; it is not if the RESET key is held down; see Diagnostics section.

ESC P p H E L L O ESC \
This DCS loads the Power-on string with the message 'HELLO'. Each time the terminal is powered on, this message will be displayed on the screen. The components of the string are as follows:

ESC P Start of DCS
p Specifies the Power-on string
HELLO Characters to be executed
ESC \ ST control to end the DCS

ESC P p ~ [ P { @ } H H E L L O ~ [ \ ESC \
This DCS loads the Power-on string with the DCS string, ESC P ` H H E L L O ESC \, which when executed, will program the PF1 key to generate the word, HELLO; see the first DCS example, above. Note that, because of the DCS coding restrictions, the ESCs in this string must be loaded a tilde left-bracket (~[), and the lower-case grave-accent (`) must be loaded as {@}. The components of the string are as follows:

ESC P p DCS to load Power-on string
~[P{@}HHELLO~[\ String to be executed
ESC \ ST control to end

ESC P p ~ [ [ 2 4 ; ; ; 2 4 { P } ESC \
This DCS loads the Power-on string with the zSDP (Set Display Parameters) control, ESC [ 2 4 ; ; ; 2 4 p, which when executed, sets the Display Memory and Screen size of the terminal to 24 lines. Note that, because of the DCS coding restrictions, the ESC must be loaded as a tilde left-bracket (~[), and the lower-case p must be loaded as {P}.

ESC P p
H E L L O
~ [ P { @ } H H E L L O ~ [ \
~ [ [ 2 4 ; ; ; 2 4 { P }
ESC \

The Power-on string may be programmed to perform more than one function. In this example, the DCS programs the Power-on string to perform all of the functions of the three previous examples. The only limitation to the number of functions that may be programmed into the string is the size of the non-volatile memory; see Size Limitations, below.

Size Limitations

There is a size limitation on the total length of the programmable strings that may be stored by the Ambassador. For the 4 Operational strings and the 60 Key strings, the total memory allotment is 320 bytes.

Before the contents of a DCS string are stored in memory, its control and delimiter characters are executed and stripped from the data portion of the string to be stored. Controls and delimiters in the range 6/0 (`) to 7/14 (~) do not take up space in memory, nor does the index which follows the 6/0 code. Characters affected by the control shift (~) and lower-case shift ({}) specifications are stored as their actual ASCII representation. The repeat, local, and transmit (x, y, z) specifications are flagged in the control byte for the string.

The length of a string in memory is the number of ASCII characters represented by the data portion of its string table entry. For example, consider the DCS string used to program the PF1 key to repeat the characters, Hello – ESC P ` H x H { E L L O } ESC \. After executing this DCS, the Ambassador will have assigned 5 bytes of memory to the PF1 key – one for each of the characters, Hello.

The Operational and Key strings are stored in memory sequentially, the Operational strings first, in the order specified in Tables II and III.

The default strings shown in the tables do not initially require string table space (rather they are encoded as pointers in the control byte). If they are re-programmed, even if re-programmed to their default values, they do take up table space, until the terminal is re-initialized (by power-on or Setup Z); see Diagnostics section.

The Power-on string has its own 255-byte non-volatile memory. This count applies only to the characters actually executed at power-on. As with the Operational and Key strings, the codes 6/0 (`) to 7/14 (~) (in the DCS which loads the memory) do not take up space in the memory.

CAUTION: At each power-on, the Power-on string is copied into the terminal's input buffer for execution. If the Power-on string is near its maximum length of 255 characters, extra input from the host (such as a power-on log-in message), may cause the buffer to overflow, and the string will not execute. If this occurs, the Power-on string may always be executed by typing the two-key sequence, SETUP Z; see Diagnostics section.

DCS Special Notes

  1. The key positions labeled RESET, BREAK, and SETUP are not affected by the mode KAM (Keyboard Action Mode) or the controls DMI/EMI (Disable/Enable Manual Input). These keys may be disabled only be loading them with a null string with the DCS control.

  2. The key position labeled SETUP may be disabled and re-enabled with the DCS control, but its function may not be moved to a different key position. (It is the position of the Setup key, and not its code, that is significant in exiting from Setup. This is likewise true of all other Setup exits.

  3. The key positions labeled RETURN and ENTER, if re-programmed, are no longer affected by zRLM (Return Key CRLF Mode), even if returned to their default value, until the terminal is re-initialized (by power-on or SETUP Z).

  4. A key may be programmed to include a DCS to re-program a string of higher index (i.e. one occurring later in the string table; see Table III), but not one of lower index. For example, PF1 may be programmed to re-program PF2, but no key may be programmed to re-program an Operational string.

  5. NUL-codes (0/0) cannot be loaded into the Power-on string.

Table I: Controls and Delimiters
Char Code Usage
` 6/0 Denotes the start of a string table entry in a DCS string
p 7/0 Denotes the start of a Power-on string in a DCS
x 7/8 Repeat-key flag
y 7/9 Local-only flag
z 7/10 Transmit-only flag
{ 7/11 Shift into lower case
| 7/12 Index to the next (sequential) string
} 7/13 Shift back to upper-case
~ 7/14 Control-shift (non-latching)
Table II: Operational Strings
Index String Default Description
Char Code
sp 2/0 HEADER Null Precedes all transmissions to host
! 2/1 TRAILER Null Follows all transmissions to host
# 2/3 ENQ Null Terminal's response to ENQ control
$ 2/4 DA Revision/ release # Terminal's response to DA control
Table III: Programmable Key Strings
Index Programmable Key Default Description
Char Code
" 2/2 SEND (Sim SRM) Null Send key in Simultaneous SRM
% 2/5 SEND (Mon SRM) ESC S STS (Set Transmit State)
& 2/6 RESET ESC c RIS (Reset to Initial State)
' 2/7 SETUP y ESC d Enter Setup mode
( 2/8 BREAK y ESC e Send short break
) 2/9 SHIFT-BREAK y ESC f Send long break
* 2/10 PAUSE y ESC g See zAPM (Auto Pause Mode)
+ 2/11 RETURN CR or CRLF See zRLM (Return Key CRLF Mode)
, 2/12 MOVE UP xy ESC [ T See SD (Scroll Down)
- 2/13 SHIFT-MOVE UP xy ESC i Move up window
. 2/14 MOVE DN xy ESC [ S See SU (Scroll Up)
/ 2/15 SHIFT-MOVE DN xy ESC j Move down window
0 3/0 SHIFT-0 null Control keypad 0-key
1 3/1 SHIFT-1 ESC F SSA (Start of Selected Area)
2 3/2 SHIFT-2 x ESC [ B See CUD (Cursor Down)
3 3/3 SHIFT-3 ESC G ESA (End of Selected Area)
4 3/4 SHIFT-4 x ESC [ D See CUB (Cursor Backward)
5 3/5 SHIFT-5 ESC [ H See CUP (Cursor Position)
6 3/6 SHIFT-6 x ESC [ C See CUF (Cursor Forward)
7 3/7 SHIFT-7 ESC [ g See TBC (Tabulation Clear)
8 3/8 SHIFT-8 x ESC [ A See CUU (Cursor Up)
9 3/9 SHIFT-9 ESC H HTS (Horizontal Tab Set)
: 3/10 PERIOD . Code 2/14
; 3/11 TAB x HT HT (Horizontal Tab)
< 3/12 ENTER CR or CRLF Same as RETURN
= 3/13 SHIFT-TAB x ESC [ Z See CBT (Cursor Back Tab)
> 3/14 ERASE ESC [ K See EL (Erase in Line)
? 3/15 SHIFT-ERASE ESC [ J See ED (Erase in Display)
@ 4/0 EDIT ESC 6 zTI (Toggle IRM)
A 4/1 DELETE x ESC [ P See DCH (Delete Character)
B 4/2 SHIFT-DELETE x ESC [ M See DL (Delete Line)
C 4/3 INSERT x ESC [ @ See ICH (Insert Character)
D 4/4 SHIFT-INSERT x ESC [ L See IL (Insert Line)
E 4/5 PRINT ESC [ i See MC (Media Copy)
F 4/6 SHIFT-PRINT y ESC k Toggle local copy
G 4/7 CTRL-SHIFT-7 ESC [ 3 g See TBC (Tabulation Clear)
H 4/8 PF1 ESC O A See zFIM (Function Key Initialize) applies to all PF keys
I 4/9 PF2 ESC O B
J 4/10 PF3 ESC O C
K 4/11 PF4 ESC O D
L 4/12 PF5 ESC O E
M 4/13 PF6 ESC O F
N 4/14 PF7 ESC O G
O 4/15 PF8 ESC O H
P 5/0 PF9 ESC O I
Q 5/1 PF10 ESC O J
R 5/2 PF11 ESC O K
S 5/3 PF12 ESC O L
T 5/4 SHIFT-PF1 ESC O M
U 5/5 SHIFT-PF2 ESC O N
V 5/6 SHIFT-PF3 ESC O O
W 5/7 SHIFT-PF4 ESC O P
X 5/8 SHIFT-PF5 ESC O Q
Y 5/9 SHIFT-PF6 ESC O R
Z 5/10 SHIFT-PF7 ESC O S
[ 5/11 SHIFT-PF8 ESC O T
\ 5/12 SHIFT-PF9 ESC O U
] 5/13 SHIFT-PF10 ESC O V
^ 5/14 SHIFT-PF11 ESC O W
_ 5/15 SHIFT-PF12 ESC O X
SHIFT-PAUSE y ESC h Advance window (zAPM set)
CTRL-PAUSE y ESC l Set zAPM
CTRL-SHIFT-PAUSE y ESC m Reset zAPM
CTRL-MOVE UP xy ESC n Zoom up
CTRL-MOVE DN xy ESC o Zoom down

NOTE: x and y are used in this table to indicate keys which repeat (x) or which operate locally (y). Local-only strings may include ESC sequences, in the range ESC d through ESC o, which perform operations that have no external code representation. (They may be executed only by depressing a key programmed to operate locally).