3287 Host Printer Emulation

 Debbie Schiffel
 Engineer
 Communications Product Division

Abstract: The printer support provided with Novell's multisession 3270
products allows a PC-attached printer to serve as a host-addressable 3287
printer. This AppNote provides information regarding the printer data
stream and how it may be sent to a printer directly attached to a
workstation customized for a printer session, or redirected to another
printer on the LAN.

Disclaimer

Novell, Inc. makes no representations or warranties with respect to the
contents or use of these Application Notes (AppNotes) or of any of the
third-party products discussed in the AppNotes. Novell reserves the right
to revise these AppNotes and to make changes in their content at any
time, without obligation to notify any person or entity of such revisions
or changes. These AppNotes do not constitute an endorsement of the third-
party product or products that were tested. Configuration(s) tested or
described may or may not be the only available solution. Any test is not
a determination of product quality or correctness, nor does it ensure
compliance with any federal, state or local requirements. Novell does not
warranty products except as stated in applicable Novell product
warranties or license agreements.

Copyright { 1990 by Novell, Inc., Provo, Utah. All rights reserved.

As a means of promoting NetWare AppNotes, Novell grants you without
charge the right to reproduce, distribute and use copies of the AppNotes,
provided you do not receive any payment, commercial benefit or other
consideration for the reproduction or distribution, or change any
copyright notices appearing on or in the document.

Introduction

The following information is a consolidation of notes regarding printer
support. It is not intended to be a substitute for the instructions in
the Gateway and Workstation manuals.

Host Customization

Bind Considerations

Configure the host in the same way as for a real 3287 printer. The device
must be LU Type 1 or LU Type 3. Certain bytes in the bind must be set as
noted below or the Gateway will reject the bind. The bind is a SNA
message from the host to a terminal or PC that establishes the protocols
that will be used to run the session. (The IBM Information Display System
3174 Control Unit Description has further information about the bind.)

o    Byte 6; Bit 1 must be set to 0 (counting from 0 as the left most
     bit). This byte refers to common protocols. The Novell Gateway does
     not support "function management header exchange", which is a part
     of the data stream in SNA architecture or extended data stream
     capabilities with LU Type 1.

o    Byte 9; must be non zero for LU Type 1. This byte refers to primary
     to secondary pacing count, which defines the number of RUs (request
     units) that may be received by the 3174 before a pacing response
     must be returned to indicate readiness for another block of RUs.

o    Because the printer is slower than the displays, pacing is necessary
     and care must be exercised in this setting so that waiting RUs
     and/or chains are not stacked in the 3274 link buffers. During the
     transmission of multiple chains, the 3174 uses printer buffers as an
     extension of the link buffer pool. Pacing is based on total buffer
     capacity. If the printer buffer becomes full and outbound data is
     received faster than the data can be printed, a sense code of
     X'0801' will be received. (Refer to LU Type 1 pacing in the above
     mentioned IBM manual.)

o    The setting of pacing count is closely associated with the setting
     of MRU (Maximum RU size).  Pacing Count (PC) is commonly set to 1,
     but the formula on page 5-31 of the above mentioned manual can be
     used to calculate it more exactly for better performance (see Fig.
     1).

: Pacing Formula

MRU is the smallest multiple of 256, greater than or equal to the maximum
RU size specified in byte 11 of the bind.

PC is the pacing count specified in byte 9 in the bind.

BUFF is the device buffer size. The gateway supports a buffer size of
4096. For a channel attached 3274 the RU size is further constrained to a
maximum of 1536 bytes. A sense code of X'1002' will occur if the bind RU
size is exceeded.

Changing the Default Page Length for the Printer

Because the host normally overrides operator settings on the 3287 for the
page length, the best way to change the default page length for the
printer is to add an FCB image to the system image library. The FCB image
is then pointed to by the FCB parameter of the SYSOUT DD JCL statement
for the system program that is handling the printing, such as VPS or TSO.
Building a FCB image and adding it to the image library is explained in
detail in the OS/VS2 system Programming Library Data Management Manual.
This task is usually managed by the systems programmer.

Escape Codes

For each printer to be used, enter the escape sequence for both 6 and 8
Lines Per Inch. It is important to enter these escape sequences in the
correct place; LPT 1-5 for parallel printers or COM 1-4 for serial
printers.

The LPT and COM selections available will depend upon whether the
Workstation Control Program was customized for local or LAN printing.
While holding down the ALT key, enter the appropriate escape sequences
from your printer's manual. To avoid interjecting unwanted spaces into
print output do not use the space bar to move through the field, . Use
the delete key to clear the field if necessary.

The escape sequence fields are nine characters in length, allowing the
ability to add multiple escape sequences in addition to those for 6 and 8
LPI. For example, the escape codes for compressed print could be
included. As the control program checks the escape sequences every time
it is about to print; it would then always print the 3287 datastream in
compressed mode.

Novell Software Printer Control Panel

After the workstation control program is loaded, the Novell software
Printer Control Panel can be accessed by the appropriate key combination
(see the Workstation User's Guide). This screen is an image of the left
half of the front panel of a 3287 printer (the one IBM refers to as Stage
2), plus the selector switches from the right side of the panel. All
printer interactions should be done via this panel. Thus, to make any
adjustments, change paper, etc., press the "hold print" button on the
Novell Software Panel - not the "offline" switch on the printer itself.

When the software Printer Panel appears, it will show "LPT 1" in the
upper left hand corner. Use the page down key to scroll through the
possible Lpt or Com selections until the correct printer assignment
appears. With a 101 keyboard, use alt/page down (on numeric key pad) to
change to the proper printer.

Changing Line Length

The default line (maximum presentation position) on both a real 3287 and
Novell's printer emulation is 132 characters. This can be increased to up
to 255 characters for LU Type 1 (for Workstations prior to Version 2.0
PTF 216 is required). The line length can be specified in the LU Type 1
data stream using the Set Horizontal Format sequence. This process is
described in detail in the IBM "3287 Printer Models 1 and 2 Component
Description" document (GA27-3153-5).

The line length can also be set via the software Printer Control Panel;
however, the maximum length which can be set there is 199. To change the
line length follow this procedure:

1.   Press "Hold Print" (2).

2.   Press "Set Alter" (4).

3.   Use the letters "C", "D", and "E" to enter in the desired line
     length. "C", corresponds to hundreds, "D" to tens, and "E" to units.
     If "C" is pressed the Status Indicator box will blink. This means
     the hundreds column is set. If the box is not blinking, then the
     length is less than 100.

4.   Press "Set Param" (B) to save the new number.

5.   Press "Enable Print" (3).

6.   Press Host "On" (1).

Changing Lines Per Page

The selector switches on the software Printer Control Panel can also be
used for setting the number of lines per page. Page length can be set
between 01 through 99 lines; 6 lines per inch is standard for an 8 1/2 x
11 inch page. Because the host can override operator settings, setting
the line width or the selector switches is basically just a means of
setting the defaults (e.g., 66 lines per page, 132 characters per line).
Refer to the IBM 3287 Printer Manual mentioned above for a further
description of controls, SCS format, etc.

Printer Status Codes

Error conditions from the physical printer are indicated in the "Status
Indicator" box on the software Printer Control Panel. The Workstation
software is made aware of these conditions by examining the "status byte"
that can be read from an I/O port. Parallel Printers can indicate two
distinct error conditions to the PC: temporary error condition (out of
paper or printer offline) or permanent error condition (printer powered
off).

Serial printers can indicate the same two conditions; however, this is
dependant upon the make of the printer and the exact wiring of the serial
cable. In order for the workstation to receive and distinguish both
conditions, the printer must support the indication of these through the
use of two distinct RS232C pins and the cable must be wired so that these
signals are delivered to the standard pins on the PC end. See Serial
Printer Cabling Considerations below for details.

When the physical printer runs out of paper or is switched offline, the
Workstation Control Program starts a one minute timer. At that time, the
status indicator in the software Printer Control Panel changes to "01."
If the physical printer returns to a ready condition before the timer
expires, no sense code is sent to the host and further host data is held
off (by not acknowledging the data already received). If the printer is
still not ready when the timer expires, then an x'0802' sense code is
sent to the host, and at the same time , the indicator in software
Printer Control Panel changes to "31".

When the "hold print" button is pressed on the software Printer Control
Panel, a ten minute timer is started. If the one minute timer mentioned
above is already going, it is cancelled and replaced with the new ten
minute timer, but the indicator on the Printer Control Panel continues to
read "01". Here again, further host data is held off. If the ten minute
timer expires without the "enable print" button having been pressed on
the Printer Control Panel, then an x'0802' sense code is sent to the
host, and at the same time, the indicator in the software Printer Control
Panel changes to "08". if the "enable print" button is successfully
pressed before the timer expires, then no sense code is sent to the host.
However, if the physical printer is still not ready, then an attempt to
press the "enable print" button will be ignored and, when the ten minute
timer expires, the x"0802" sense code will be sent. Thus, the "hold
print" button effectively extends the time available to load paper or
otherwise make the physical printer ready (online), from one minute to
ten minutes.

It is possible to change the duration of these timers by using the
following debug routine:

For LU Type 3:

     C> pczap iprtlu3.exe

     Command => s 0 '26C747350100'
     Match at offset X' 285E'.

     Command => s 0 '26C747350a00'
     Match at offset X' 286A'.

     Command => v 285E '26C747350100'
     Data verifies.

     Command => r '26C74735xx00'.
     (nn is the replacement for the one minute timer. May be a number
     between 01-FF minutes.)
     Replace completed.

     Command => v '286A '26C747350A00'
     Data verifies.

     Command => r '26C74735xx00'
     (nn is the replacement for the ten minute timer. May be a number
     between 01-FF minutes.)
     Replace completed.

     Command => exit

For LU Type 1:

     C> pczap Iprtlu1.exe

     Command => s 0 '26c747350100'
     Match at offset X' 2A4A'.

     Command => s 0 '26C747350A00'
     Match at offset X' 2A56'.

     Command => v 2A4A '26C747350100'
     Data verifies.

     Command => r '26C74735xx00'

     (nn is the replacement for the one minute timer. May be a number
     between 00-FF minute.)

     Data replaced.

     Command => v 2A56 '26C747350A00'
     Data verifies.

     Command => r '26C74735xx00'

     (nn is the replacement for the ten minute timer. May be a number
     between 00-FF minutes.)

     Replace completed.

     Command => exit

If either the physical printer is powered off or the "On/Off" switch on
the software Printer Control Panel is changed from "ON" (1) to "0ff" (0),
then an x'0831' sense code is sent to the host immediately. If it was the
physical printer that was powered off, the indicator in the software
Printer Panel changes to "45".

If the "cancel print" button is pressed on the software Printer Control
Panel, then an x '0811' sense code is sent to the host.

Serial Printer Cabling Considerations

The following information should be taken into consideration when
installing a serial printer.

o    Whenever the printer is placed in "HOST" mode the following signals
     are turned "ON" (+3 Vdc at the interface) and remain "ON"
     continuously until the printer is returned to "LOCAL" mode:  RTS
     (pin 4)  DTR (pin 20) These pins may be cabled to any pins on the
     printer as required/desired (or to nothing).

o    The serial printer driver interrogates two signals as follows (the
     pin numbers are the PC's):  CTS (pin 5)  DSR (pin 6)

o    CTS is used for the handshaking protocol (i.e., online/offline,
     paper out, etc.). This pin should be cabled to whichever pin on the
     printer provides this signal. Novell's SNA products also support the
     Xon/Xoff handshaking protocol. In this case CTS is assumed to be
     always "ON" (provided either by the printer or by strapping the PC's
     RTS or DTR (see 1. above) to CTS). No customization changes are
     required to support Xon/Xoff. Novell's SNA products do NOT support
     the "break" handshaking protocol (available on some printers)! Any
     breaks received are ignored. Some printers (e.g., GE/Genicom) can be
     configured to use different handshaking protocols for different
     conditions. For example, a connector pin for online/offline,
     X-on/X-off for paper faults, and breaks for other error conditions.
     Novell SNA products do NOT support this! All error conditions must
     be reported via one protocol (either a pin voltage or X-ON/X-off).

o    DSR is used to detect printer power on/off. If the printer provides
     a power on signal via a connector pin, that pin should be cabled to
     the PC's DSR.

Not all printers have this feature. If you are using one that does not,
one of the output signals (see 1. above) should be strapped to DSR. Not
doing this will cause device Power Off (sense code x'0831'), as opposed
to Intervention Required (sense code x'0802'), to be reported to the host
whenever the printer goes offline or runs out of paper. This is not
catastrophic, but may be undesirable.

