The Ambassador provides three different methods of printing:
Remote Copy. Permits the terminal and printer to be used as two separate devices, merely sharing a common communications line.
Local Copy. Permits printing all or part of the data that the host sends or echoes to the terminal.
Page Print. Permits printing all or part of the displayed data.
The operation and use of these printing methods is described in this section. It assumes that the printer has already been attached to the terminal and properly set up (baud rate, parity, new-line character, new-line pads, etc.); see Checkout & Installation, Printer Installation.
The Ambassador permits a wide variety of printers to be used. There are few requirements of the printer (other than that it accept a new-line control, either CR, LF, or CRLF). If the printer accepts an FF (0/12) control (to advance the paper to top-of-page), it may be used (with all forms of print). If the printer is capable of an Xon/Xoff protocol (either codes or signal), it also may be used. Any other printer features are usable only with Remote Copy (as the Ambassador does not support embedded control codes in either Local Copy or Page Print).
The settings associated with the printer are consolidated on Setup line C; see Setup section. Besides adapting the Ambassador to various printers, they provide some local control of the printout.
The following settings are applicable to all forms of print. They control the basic signal form of data to the printer.
Baud Rate. Sets the baud rate (110-19200) required by the printer. This will generally be set to the maximum that the printer will accommodate.
Parity. Sets the parity (00 = Odd, 01 = Even, 10 = Space, 11 = Mark) required by the printer. If none, set for Mark.
Stop Bits. Sets the number of stop bits required by the printer. This will generally be set to the minimum that the printer can accommodate.
The following settings are applicable to Local Copy and Page Print only. In Remote Copy, the host determines what codes are used for new-line and new-page actions, and whether pad characters are required.
New-Line Pads. Sets the number of NUL-codes (0/0) to be sent to the printer following each new-line character (to allow time for carriage return, if needed).
New-Line CR/LF. Selects the codes (01 = LF, 10 = CR, 11 = CRLF) required by the printer to perform a new-line action.
Form Feed. Selects the code (0 = NLs, 1 = FF) required by the printer to perform a new-page action. If the printer recognizes an FF-code (0/12) as a top-of-page control, set to 1; otherwise set to 0, and the terminal will generate the necessary number of new-line codes to advance the paper to the top of the next page.
The following settings are also applicable to Local Copy and Page Print only. In Remote Copy, the page and margins are controlled by the host. These settings may also be set by the host with the zSPF control; see Top-of-Page Control, below.
Printed Lines. Sets the number of lines to be printed per page (e.g. 60 leaves a 3-line top and bottom margin on a 66-line printer).
Total Lines. Sets the number of lines possible per page (e.g. 66, for a 6 line/inch printer with 11-inch paper).
Left Margin. Sets the number of Spaces (2/0) to be sent to the printer at the beginning of each line for a left margin (e.g. 12 gives a 1-inch left margin for a 12 character/inch printer, provided that the paper is positioned so that, with no margin, the first character prints at the left edge of the paper).
The Ambassador accommodates printers that use either DC1/DC3 codes, or an RS232 control signal, for ready/busy control.
The Ambassador will suspend further transfer of data to the printer on receipt of a 'busy' signal from the printer (either a DC3 control received through pin 2 of the printer connector, or an RS232 'off' level at pin 20). It will resume transferring the data on receipt of a 'ready' signal from the printer (either a DC1 control received through pin 2 of the connector, or an RS232 'on' level at pin 20).
This is applicable to all three methods of printing; see the Flow Control paragraph in the descriptions of each method, below.
If the printer uses paper other than roll stock, it is necessary that the printer and printing source agree on the location of top-of-(printed)page.
When using Remote Copy, this is a matter between the host and printer; the terminal is not involved in the paging operation. The operator typically positions the paper to top-of-page at (printer) power-on, and thereafter the host takes care of the paging. (If the printer has a printed line counter, it is typically initialized to top-of-page at power-on.) If the operator aborts a print, he/she will typically use the Form Feed button on the printer (if it has one, and is convenient), or a pre-arranged code sequence with the host, to advance the paper to the top of the next page.
When using Local Copy or Page Print, the terminal is the printing source, and controls the paging operation. The terminal knows what constitutes a printer page by virtue of the Total Lines setting. It knows how many lines you want to print per page by virtue of the Printed Lines setting. Once the printer is initialized, the terminal takes care of the paging, with a printed-lines counter. The counter is initialized to top-of-page at power-on. Thereafter, it counts the lines it prints, and advances the paper to the top of the next page (by issuing an FF-code, or the necessary number of new-line codes) in accordance with your settings.
If a print is aborted, the terminal's line counter, the printer's paper position, and the printer's line counter (if applicable) are all left at other than top-of-page. The Ambassador's zSPF control permits all three to be advanced to the top of the next page, or only the terminal's line counter (the printer being advanced by other means).
This control may be used by the operator typing it in, or loading it into a programmable key.
zSPF Set Print Format (ESC [ Pn1 ; Pn2 ; Pn3 w
). Sets the number of
Printed Lines (Pn1), Total Lines (Pn2), and Left Margin (Pn3) (see Printer
Setups, above) and advances the terminal's printed-line counter to top-of-page
(with or without advancing the printer; see examples below).
ESC [ 60 ; 66 ; 10 w
Sets Printed Lines = 60, Total Lines = 66, and Left Margin = 10, and
advances the terminal's line counter to top-of-page (without advancing
the printer). The paper should be positioned to top of page (and the
printer's line counter reset, if applicable) before issuing this command.
ESC [ 62 ; ; 12 w
Changes the Printed Line and Left Margin settings without changing the
Total Line setting, and advances the terminal's line counter to top-of-page,
without advancing the printer.
ESC [ w
Changes no settings, but advances the terminal's line counter to top-of-page
by issuing new-line codes (or an FF-code, if the Form Feed
setting on Line C is selected) to advance the paper position (and line
counter setting) in the printer to top-of-page. This may be used
after aborting a Local Copy or Page Print to advance both terminal and
printer to the top of the next (printed) page.
ESC P ` H y ~ [ [ { W } ESC \
This string loads the preceding control into PF1 (making PF1 a New
Page key).
Remote Copy permits data to be printed without being displayed. It may be used by either the operator or the host (although intended primarily for the host).
NOTE: Remote Copy is the only way of printing a file that contains embedded printer control codes. As such, it is the preferred method of printing (if the host is cooperative; see Unix example below).
Printer Setups. Remote Copy uses only the Baud Rate, Parity, and Stop Bit settings on Setup line C. All other settings are ignored. (The other settings affect the content of the transfer which, in Remote Copy, is controlled entirely by the host).
Flow Control. The data transferred from the host to the printer is buffered through the terminal's FIFO. The FIFO receives characters from the host at the host's baud rate. It passes those characters on to the printer at the printer's baud rate. In addition, it responds to any 'busy' signal from the printer (either a DC3 control received through pin 2 of the printer connector, or a low level at pin 20), and suspends passing on the characters until it receives a 'ready' signal from the printer (either a DC1 control received through pin 2 of the connector, or a high level at pin 20).
If the printer's baud rate is less than the host's, or if the printer goes 'busy', the FIFO will gradually fill. When the FIFO becomes 'almost full', it sends an XOFF control to the host, suspending further transmission from the host (if the host supports an Xon/Xoff protcol; see zAXM). When enough data has been printed that the terminal's FIFO becomes 'almost empty', the terminal sends an XON control to the host to resume transmission.
Operator Control. The operator may use the zSRC control to write directly from the keyboard to the printer (either in Local Test mode, see Diagnostics section, or echoed through the host). The control may be typed in, or loaded into a Programmable key. Depressing CTRL-C (i.e. ETX) terminates writing to the printer. Example:
ESC [ v
Starts Remote Copy. All characters subsequently typed are sent to the
printer (instead of the display). Depressing CTRL-C returns the terminal
to normal operation.
ESC P ` H ~ [ [ { V } ESC \
This string loads the Start Remote Copy control into PF1.
Host Control. The host may use the zSRC control to write to the printer. (If it is desired to write also to the display, Local Copy should be used.) The data to be printed may be interspersed (in small packets) with the normal communications to the display (by using the numeric parameter), or printed in a batch by using an ETX to terminate the print.
zSRC Start Remote Copy (ESC [ Pn v
). Causes the next Pn characters (up
to 255) to be directed to the printer (instead of the display). If no
parameter is given, all subsequent characters are directed to the printer
until the first occurrence of an ETX-code (0/3) in the data stream. All
formatting of the data is the responsibility of the host. The terminal
merely passes the buffered data to the printer interface. (Note: This is
a 7-bit data path; no provision has been made for passing 8-bit data.)
Examples:
ESC [ 128 v
Causes the next 128 characters sent to the terminal to be directed to
the printer only. The 129th, and subsequent characters, are directed
back to the display.
ESC [ v
Causes all subsequent characters sent to the terminal to be directed
to the printer only, until an ETX character is sent to direct the
characters back to the display.
Unix Example. The following illustrates the use of Remote Copy, using the Unix nroff command.
nroff [option] ... [file] ... | print
where 'print' is a command file containing:
echo ^[[v
cat $*
echo ^C
Local Copy permits data to be displayed and printed simultaneously. It may be used by either the operator or the host. Local Copy lacks the versatility of Remote Copy (for formatted printing), but requires no cooperation from the host. The host needs no information about the printer (or even whether there is one).
Local Copy can be faster than Remote Copy when the comm rate is slower than the printer (e.g. using a 40 char/sec. printer with a 300 baud modem), because the terminal expands the controls used by the host into the characters required by the printer. (For example, tab codes from the host are expanded into the appropriate number of spaces for the printer. The new-line character used by the host is translated into the new-line character(s) required by the printer, including new-line pads, etc.)
Local Copy may also be used for logging the transactions between operator and host, for debug or historical reference.
Printer Setups. All settings are applicable. Since the printing is done from the Page, the host needs no information about the printer being used (unlike Remote Copy). Each line is printed as it finally appears on the screen, regardless of what formatting and editing controls were used in creating it. The only control needed by the printer is a new-line control (selected on Setup line C). If the printer recognizes an FF-code (0/12) as a top-of-page control, the Form Feed setting should be selected. The Left Margin setting may be used to position the printout laterally on the paper. The Printed Lines setting may be used to control the number of lines per page to be printed.
Flow Control. Whenever a new-line control is received by the Display Processor (i.e. after the FIFO, but before moving the cursor), the Display Processor checks to see if Local Copy is 'on'. If so, it tags the active line (i.e. the line containing the cursor) as a line to be printed. New-line controls are LF, IND, NEL, or CR (if zCNM is set).
During printing, the terminal's FIFO and its entire Page (see Display section, Definitions) serve as a buffer. The Page is being filled at the host's baud rate. The contents of the Page (i.e. the lines tagged to be printed) are being copied to the printer at the printer's baud rate. In addition, the terminal responds to any 'busy' signal from the printer (either a DC3 control received through pin 2 of the printer connector, or a low level at pin 20), and suspends copying further characters until it receives a 'ready' signal from the printer (either a DC1 control received through pin 2 of the connector, or a high level at pin 20).
If the printer's baud rate is less than the host's, or if the printer goes 'busy', the Page will gradually fill. When a new-line control is received by the Display Processor that, if processed, would cause a line that has not yet been printed to scroll off the top of the Page, the scroll is inhibited, and further processing from the FIFO is suspended.
As the host continues to send characters, the FIFO will gradually fill. When the FIFO becomes 'almost full', it sends an XOFF control to the host, suspending further transmission from the host (if the host supports an Xon/Xoff protocol; see zAXM).
When the line at the top of the Page has been printed, the Page is allowed to scroll, FIFO processing is resumed, and another line of data is admitted to the Page.
When enough lines of data have been admitted to the Page that the FIFO becomes 'almost empty', the terminal sends an XON control to the host to resume transmission.
Operator Control. The operator uses SHIFT-PRINT to toggle the terminal into and out of Local Copy. This is a Local-only control, i.e. no code is transmitted to the host; see Programmable Strings section.
To log transactions, depress SHIFT-PRINT (to toggle Local Copy on). All subsequent transactions (i.e. everything that's written to the display) is also printed. Depress SHIFT-PRINT again (to toggle Local Copy off) to terminate logging.
To print a file, depress SHIFT-PRINT, and initiate display of the file. When the file has been printed, depress SHIFT-PRINT again (or initiate display of another file to be printed).
Toggling Local Copy on before initiating the display of a file results in the host command (used to initiate the display) to also be printed. To avoid this, SHIFT-PRINT must be depressed AFTER the host command has been echoed and BEFORE the first line of the file has been (completely) written to the display. This requires a fast finger, or a slow host, or a host with a delay (or sleep) command.
Alternatively, zAPM (Auto Pause Mode) may be used; see Display section, Flow Control of Received Data. Depress CTRL-PAUSE (to go into Auto Pause Mode). Initiate display of the file. Depress PAUSE (to permit the echoed command line to display). Depress SHIFT-PRINT (to toggle Local Copy on). Now, each time you depress PAUSE, another line is admitted to the screen – and printed. You may step through the file, a line at a time, printing what you want and leaving out what you don't want (by toggling Local Copy on and off), or you may depress CTRL-SHIFT-PAUSE (to leave Auto Pause Mode) and the file will complete printing by itself (and without the command line).
To stop the printing of a file (when you only wanted part of it), simply depress SHIFT-PRINT. The line being written to the display at the time the key is depressed will not be printed; all previous lines will.
To abort the printing of a file (because something's gone wrong), depress CTRL-SHIFT-RESET (which clears the display and resets Local Copy), re-position the printer to top-of-page (see Top-of-Page Control), and re-initiate display of the file.
If Local Copy is used frequently, you may wish to program separate Copy On and Copy Off keys. Example:
ESC P ` H y ~ [ [ 4 { I } ` T y ~ [ [ 5 { I } ESC \
This string programs SHIFT-PF1 to turn Local Copy on and PF1 to turn Local
Copy off.
Host Control. The host uses the MC control to turn Local Copy on and off.
MC Media Copy (ESC [ Ps i
). Controls the transfer of data from the
terminal's Display Memory to the printer according to the selective parameter. Ps = 5 turns on Local Copy; Ps = 4 turns off Local Copy.
Lines longer than 80 characters may be printed by allowing the (display) line to wrap at end of line. (Display wrap does not cause the line to be printed; only a new-line control does.) Top-of-page control is available to the host by issuing an FF (0/12) control in the transmission; see FF. (The terminal buffers the FF-code, with the data to be printed, and passes it on to the printer either as an FF-code or the necessary number of new-line codes, depending on the Form Feed setting of Line C.)
Page print permits all or selected portions of the displayed data to be printed. Because of the Ambassador's 60-line display, a full (printed) page of data (less a 3-line top and bottom margin) may be assembled, edited, formatted, reviewed, and then printed. The data is printed exactly as it is displayed.
Printer Setups. The Left Margin setting shifts the printout to the right. The Printed Lines setting should be greater (e.g. 66) than the number of lines set for the (display) Page size; see Display section, Definitions. The displayed data may be divided into two separate printed pages by setting the Printed Lines to be smaller than the Page size.
Flow Control. During a Page Print, characters are transferred from the terminal's Display Memory to the printer at the baud rate selected in Setup line C. The terminal responds to any 'busy' signal from the printer (either a DC3 control received through pin 2 of the printer connector, or a low level at pin 20), and suspends transferring further characters until it receives a 'ready' signal from the printer (either a DC1 control received through pin 2 of the connector, or a high level at pin 20).
The keyboard is disabled during the print operation (except for the BREAK, SETUP, and RESET keys; see KAM), and characters are not processed from the FIFO into Display Memory. If the host continues to send characters to the terminal, the FIFO will gradually fill. When the FIFO becomes 'almost full', it sends an XOFF control to the host, suspending further transmission (if the host supports an Xon/Xoff protocol; see zAXM). When the print operation has been completed (or aborted), the keyboard and FIFO processing are re-enabled, and any characters waiting in the FIFO are processed normally. When enough characters have been processed that the terminal's FIFO becomes 'almost empty', the terminal sends an XON control to the host to resume transmission.
Operator Control. The operator initiates Page Print with the PRINT key.
Before initiating print, make sure the printer is set to top-of-form (if applicable). Upon completion of Page Print, the Ambassador does not automatically advance the printer to the top of the next page (to allow you to compile segments of text on a single page, if desired). The form feed must be done manually between Page Prints. You may use the Form Feed button on your printer (if it has one and is convenient) or you may program a Form Feed key on the terminal; see Top-of-Page Control, above.
A Page Print may be aborted with either the BREAK or SETUP key (without clearing the data), or with CTRL-SHIFT-RESET.
Host Control. The host initiates Page Print with the MC control.
MC Media Copy (ESC [ i
). Initiates transfer of data from the
terminal's Display Memory to the printer. The transfer starts at the top
of the (display) Page and terminates with the cursor (TTM reset) or end of
Page (TTM set). The region transmitted may be narrowed (to as small as a
single character) with the zSTP and zSTE controls; see Using the Transfer
Pointer. Sub-regions may be excluded from the transfer; see Using Guarded
Areas and Using Selected Areas.
The host may advance the printer to the top of the next page with the zSPF
control (ESC [ w
). The host may abort a Page Print in progress with the INT
control (ESC a
). The host may request that it be notified when a Page Print
(it initiates) has been completed with the DSR control (ESC [ > 5 n
); the terminal
returns the string, ESC [ n
, upon completion of the Page Print.
The following modes affect Page Print. Their settings may be reviewed, and changed as desired, on the Setup lines; see Setup section. The Setup line letter, and mode number, are shown in parentheses following the name. Detailed descriptions of these modes can be found in the Appendix.
zTPDM Transfer Pointer Display Mode (A,41). During a Page Print, the cursor symbol is not displayed (since the keyboard is disabled). This mode permits a transfer pointer symbol to be displayed.
TTM Transfer Termination Mode (B,16). A Page Print will normally terminate after transferring the character at the cursor position. This mode permits the transfer to continue to end of Page.
GAPM Guarded Area Print Mode (C,49). Areas of the Page may be designated as guarded (i.e. their contents are not normally to be transferred); see Forms section. This mode permits the content of Guarded Areas to be printed.
The following modes permit Selected Areas to be printed; see Using Selected Areas below.
SATM Selected Area Transfer Mode (B,17). Permits printing of the Active Selected Area (if SATM is reset).
MATM Multiple Area Transfer Mode (B,15). Permits printing of all Selected Areas in the Page (if SATM is reset).
Page Print normally starts at the beginning of Page, and ends with the cursor (TTM reset) or end of Page (TTM set). The Ambassador provides two controls that permit the starting and ending points to be specified anywhere within the Page.
zSTP Set Transfer Pointer (ESC [ Pn1 ; Pn2 u
). Sets the starting address
of the transfer pointer to line Pn1, column Pn2. The transfer includes
the character at this position. The default value is the present cursor
position.
zSTE Set Transfer End (ESC [ Pn1 ; Pn2 z
). Sets the ending address of
the transfer pointer to line Pn1, column Pn2. The transfer includes
the character at this position. The default value is the present cursor
position. Note: If TTM is reset (i.e. transfer to cursor), if the cursor
is encountered before reaching the specified endpoint, the transfer will
terminate after transferring the character at the cursor. This may be
avoided by setting TTM.
The pointers are restored to beginning and end of Page after each transfer. These controls may be used by the host to print a specified region of the Page. They may be used by the operator, by typing in the controls or loading them into a programmable key. Examples:
ESC [ u
Sets the starting address to include the character at the cursor.
ESC [ z
Sets the ending address to include the character at the cursor.
ESC P ` H y ~ [ [ { U } | y ~ [ [ { Z } ESC \
Programs the above controls into PF1 and PF2, respectively. To print a
portion of the Page, depress PF1 when the cursor is at the first character
to be printed, and PF2 when the cursor is at the last character to be
printed.
ESC [ u ESC [ z ESC [ i
This string prints the character at the cursor.
ESC [ ; 1 u ESC [ ; 80 z ESC [ i
This string prints the entire contents of the active line (i.e. the line
containing the cursor).
ESC [ 6 ; 1 u ESC [ 12 ; 80 z ESC [ i
This string prints the contents of lines 6 through 12 in the Page.
Note: The preceding example could also have been done using the zSDP control.
The zSDP control defines the 'Page'. It partitions memory, but
does not change its contents; see Display section, Definitions. The MC
control transfers only the contents of the Page (TTM set). The string,
ESC [ 12 ; 5 p ESC [ i
, would have accomplished the same function with
fewer codes (ignoring the fact that the Page still has to be restored).
The transfer pointer controls are more versatile, because they permit
column parameters.
The Ambassador provides a Selected Area capability that permits the region(s) of the Page (to be printed) to be selected by visible symbols in the display. A Selected Area is defined as starting with an SSA symbol (forward-pointing triangle) and ending with an ESA-symbol (backward-pointing triangle).
The operator may enter (or insert) these symbols with the SSA and ESA keys on the Control keypad. The host enters them with the SSA and ESA controls.
SSA Start of Selected Area (ESC F
). Writes an SSA-symbol to the Page.
ESA End of Selected Area (ESC G
). Writes an ESA-symbol to the Page.
These symbols are characters, just like any of the other graphic characters.
They may be erased with erase controls, moved with edit controls, and are included
in transfers exactly as any other character. When transferred to the
printer, they are sent as a Space code (2/0) (not as ESC F
or ESC G
).
The symbols assume a control attribute only when SATM is in the reset state. In that case, they affect the transfer according to the setting of MATM.
If MATM is reset, only the active Selected Area (i.e. the one containing the cursor) is transferred. If TTM is reset (i.e. transfer to cursor), the transfer includes the SSA-symbol and all following text through the character at the cursor.
If MATM is set, all Selected Areas in the Page (or up to the cursor, if TTM is reset) are transmitted. The contents of each area are bracketed by SSA and ESA spaces in the transfer.
The Ambassador provides a Guarded Area capability that permits designated regions in the Page to be 'guarded' from transfer. The regions are designated by the host with the DAQ control; see Forms section. They are normally intended for use with Forms, but may also be used by the host simply to exclude designated regions of the Page from a printout. Example:
ESC [ 6 H ESC [ 1 o ESC [ 9 H ESC [ o ESC [ i
This string prints the contents of the Page, excluding lines 6-8.
NOTE: Selected and Guarded Areas provide alternative means of accomplishing the same result, namely selective transfer of designated regions of the Page. It is envisioned that the operator will tend to use Selected Areas (because of the visible symbols) and the host Guarded Areas. Using the two together is not recommended. Doing so will yield predictable, but not necessarily sensible, results.