No part of this publication or the
software described in it may be
reproduced, stored in a retrieval system,
or transmitted, in any form or by any
means, mechanical, electronic,
photocopying, recording, or otherwise,
without prior written permission of
Apple Computer, Inc., except in the
normal use of the software or to make a
backup copy of the software. The same
proprietary and copyright notices must
be affixed to any permitted copies as
were affixed to the original. This
exception does not allow copies to be
made for others, whether or not sold,
but all of the material purchased (with
all backup copies) may be sold, given, or
loaned to another person. Under the
law, copying includes translating into
another language or format. You may
use the software on any computer
owned by you, but extra copies cannot
be made for this purpose.
Printed in the United States of America.
The Apple logo is a registered
trademark of Apple Computer, Inc.
Use of the “keyboard” Apple logo
(Option-Shift-K) for commercial
purposes without the prior written
consent of Apple may constitute
trademark infringement and unfair
competition in violation of federal and
state laws.
No licenses, express or implied, are
granted with respect to any of the
technology described in this book.
Apple retains all intellectual property
rights associated with the technology
described in this book. This book is
intended to assist application
developers to develop applications only
for Apple Macintosh computers.
Apple Computer, Inc.
20525 Mariani Avenue
Cupertino, CA 95014
408-996-1010
Apple, the Apple logo, APDA,
LaserWriter, Macintosh, and
MacTerminal are trademarks of Apple
Computer, Inc., registered in the United
States and other countries.
TrueType is a trademark of Apple
Computer, Inc.
Adobe Illustrator and PostScript are
trademarks of Adobe Systems
Incorporated, which may be registered
in certain jurisdictions.
Centronics is a registered trademark of
Centronics Data Computer Corporation.
FrameMaker is a registered trademark
of Frame Technology Corporation.
Helvetica and Palatino are registered
trademarks of Linotype Company.
IBM is a registered trademark of
International Business Machines
Corporation.
ITC Zapf Dingbats is a registered
trademark of International Typeface
Corporation.
MS-DOS is a registered trademark of
Microsoft Corporation.
Simultaneously published in the United
States and Canada.
LIMITED WARRANTY ON MEDIA AND
REPLACEMENT
If you discover physical defects in the
manual or in the media on which a software
product is distributed, APDA will replace
the media or manual at no charge to you
provided you return the item to be replaced
with proof of purchase to APDA.
ALL IMPLIED WARRANTIES ON THIS
MANUAL, INCLUDING IMPLIED
WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR
PURPOSE, ARE LIMITED IN DURATION
TO NINETY (90) DAYS FROM THE DATE
OF THE ORIGINAL RETAIL PURCHASE
OF THIS PRODUCT.
Even though Apple has reviewed this
manual, APPLE MAKES NO WARRANTY
OR REPRESENTATION, EITHER EXPRESS
OR IMPLIED, WITH RESPECT TO THIS
MANUAL, ITS QUALITY, ACCURACY,
MERCHANTABILITY, OR FITNESS FOR A
PARTICULAR PURPOSE. AS A RESULT,
THIS MANUAL IS SOLD “AS IS,” AND
YOU, THE PURCHASER, ARE ASSUMING
THE ENTIRE RISK AS TO ITS QUALITY
AND ACCURACY.
IN NO EVENT WILL APPLE BE LIABLE
FOR DIRECT, INDIRECT, SPECIAL,
INCIDENTAL, OR CONSEQUENTIAL
DAMAGES RESULTING FROM ANY
DEFECT OR INACCURACY IN THIS
MANUAL, even if advised of the possibility
of such damages.
THE WARRANTY AND REMEDIES SET
FORTH ABOVE ARE EXCLUSIVE AND IN
LIEU OF ALL OTHERS, ORAL OR
WRITTEN, EXPRESS OR IMPLIED. No
Apple dealer, agent, or employee is
authorized to make any modification,
extension, or addition to this warranty.
Some states do not allow the exclusion or
limitation of implied warranties or liability
for incidental or consequential damages, so
the above limitation or exclusion may not
apply to you. This warranty gives you
specific legal rights, and you may also have
other rights which vary from state to state.
Contents
Figures and Tablesvii
Preface
Chapter 1
About This Note
What This Note Containsix
Conventions Used in This Notex
Other Reference Materialx
For More Informationxi
ix
LaserWriter Select 310 Hardware
Communication Ports4
Serial Port for RS-232C Devices4
Centronics Parallel Connector5
Status Lights8
Memory Capabilities9
LaserWriter Select 310 printer side panel connectors4
An 8-pin serial port connector 5
A Centronics parallel connector 6
Timing for a Centronics interface7
Status lights 8
The ROM and DRAM locations on a printed circuit board9
Paper handling options13
LaserWriter Select 310 printer features3
Signal descriptions for an 8-pin serial port5
Signal descriptions for a Centronics parallel port6
Status light messages8
Available page types11
Default settings for the serial communication channel
parameters46
Data and parity choices for the LaserWriter Select 310
printer47
SCC compatibility operators options byte values48
Reserved characters in simple communication protocol49
Control characters in binary serial protocol51
Settings for the serial output channel during parallel
communication53
vii
PREFACE
About This Note
The LaserWriter Select 310 printer is a new member of Apple’s LaserWriter
printer family. It is an economical printer that supports the Adobe
PostScript
features and capabilities of the printer, and it is intended for use by software
and hardware developers.
To use this note, you need to understand the PostScript Level 1 programming
language. You should also be familiar with the computer for which you intend
to develop software.
You do not need to use this note if you are simply running packaged programs
for your computer. However, it is useful if you are writing or modifying a
program that is used with the LaserWriter Select 310 printer.
Your owner’s guide provides instructions for connecting the printer to your
computer, inserting paper, and performing other routine operating tasks. This
note does not provide that type of information.
This preface describes the contents of the note, explains visual cues and
conventions used in the note, and lists other books to which you can refer.
™
Level 1 programming language. This developer note describes the
™
What This Note Contains0
This note is made up of three chapters.
■
Chapter 1, “LaserWriter Select 310 Hardware,” describes the hardware
features of the LaserWriter Select 310 printer, including the built-in
communications ports and interfaces.
■
Chapter 2, “LaserWriter Select 310 Software,” provides an overview of
software features, including the PostScript Programming Language, the
PostScript interpreter, LaserWriter Select 310 driver, and page types. It also
describes the software parameters and the PostScript Level 1 operators that
enable you to set up and configure the LaserWriter Select 310 printer.
Finally, it discusses changes made to the PostScript language that impact
the LaserWriter Select 310 printer.
■
Chapter 3, “Communication Channels,” describes the software support for
serial and parallel communication channels.
ix
▲
PREFACE
Conventions Used in This Note0
The following visual cues are used throughout this note to identify different
types of information:
Note
A note like this contains information that is interesting but not essential
for an understanding of the main text.
IMPORTANT
This type of note contains information that is essential for an
understanding of the main text.
WARNING
A warning like this directs your attention to something that could
damage hardware or software, or that could result in loss of data.
A special font,
program code.
Courier
, is used for characters that you type or for lines of
It looks like this
◆
▲
▲
.
Other Reference Material0
This developer note assumes that you are familiar with printer technology and
know how to operate and program Apple LaserWriter printers. The following
supplementary documents also provide useful information:
■
The owner’s guide shipped with every LaserWriter printer explains how to
set up the printer in the standard configuration. The guide gives basic
operating information on how to load toner cartridges, load the paper tray,
and so forth. It also provides basic troubleshooting information.
The LaserWriter Reference, published by Addison-Wesley, provides
■
information that is not in this note about fonts and about communicating
with LaserWriter printers over serial channels.
■
The PostScript Language Reference Manual, published by Addison-Wesley,
provides supplementary information on the PostScript language, including
information about semantics and syntax. The edition referenced throughout
this note is the first edition, unless otherwise indicated.
■
The PostScript Language Tutorial and Cookbook, published by AddisonWesley, provides a basic introduction to the PostScript programming
language. It also includes sample PostScript programs that help you quickly
understand how the PostScript programming language works.
The PostScript Language Program Design, published by Addison-Wesley, is
■
written for programmers who want to take advantage of the PostScript
program language to design efficient PostScript programs and
printer devices.
x
PREFACE
For More Information0
APDA is Apple’s worldwide source for over three hundred development
tools, technical resources, training products, and information for anyone
interested in developing applications on Apple platforms. Customers receive
the quarterly APDA Tools Catalog featuring all current versions of Apple
development tools and the most popular third-party development tools.
Ordering is easy; there are no membership fees, and application forms are not
required for most of our products. APDA offers convenient payment and
shipping options, including site licensing.
To order products or to request a complimentary copy of the APDA Tools
Catalog, contact
APDA
Apple Computer, Inc.
P.O. Box 319
Buffalo, NY 14207-0319
Telephone800-282-2732 (United States)
800-637-0029 (Canada)
716-871-6555 (International)
Fax716-871-6511
AppleLinkAPDA
America OnlineAPDA
CompuServe76666,2405
InternetAPDA@applelink.apple.com
xi
Figure 1-0
Listing 1-0
Table 1-0
CHAPTER 1
LaserWriter Select 310
Hardwar e1
CHAPTER 1
2
LaserWriter Select 310 Hardware
The LaserWriter Select 310 printer is an economical laser printer that supports
PostScript
™
Level 1 functions. It executes page descriptions written in the PostScript
language, and it produces printed pages at a rate of up to five pages per minute. The
raster printing technology is xerographic, black and white, and write black at 300 dots
(pixels) per inch. The printer is dedicated, and it operates with Macintosh computers
using the RS-232 serial port or with DOS-based IBM personal computers using the
Centronics parallel port. It is available in 110-volt and 220-volt versions.
This chapter describes:
hardware features of the printer
■
■
communication ports
■
status lights
■
memory capabilities
■
basic operation
page types
■
■
paper handling capabilities of the printer
The LaserW riter Select 310 printer supports the entir e PostScript language specified in the
first edition of the PostScript Language Reference Manual. In addition, it has features,
capabilities, and operating modes not present in other PostScript language printers. You
may access these additional facilities by executing special PostScript operators that exist
only in the LaserWriter Select 310 printer’s PostScript interpreter.
Unlike other Apple LaserWriter printers, the LaserWriter Select 310 printer does not have
a rotary selection switch to allow you to select different communication protocols.
In addition, the printer does not have EEROM (electronically erasable ROM). This means
that any of the interpreter’s default parameters that are changed using
statusdict
operators are not placed in nonvolatile storage and will not persist across power cycles.
However, for parameters that are expected to change infrequently, a portion of RAM may
be used to simulate EEROM.
Table 1-1 lists functional features of the LaserWriter Select 310 printer.
CHAPTER 1
LaserWriter Select 310 Hardware
Table 1-1
FeaturesSpecifications
LaserWriter Select 310 printer features
Printing speed5 pages per minute
Warm-up time90 seconds (worst case)
Imaging300 dpi
ProcessorAdvanced Micro Devices Am29205, 16 MHz
Paper handlingStandard
For more information see sections “Page Types” and “Paper Handling”
at the end of this chapter
ROM1 MB
<1 MB used for PostScript firmware and fonts
DRAM1.5 MB
Expandable to 2.5 MB or 5.5 MB
The printer requires a minimum of 2.5 MB to print legal-size image areas
Interface portsRS-232 8-pin serial
Centronics 36-pin parallel
Communication rates57,600 baud (RS-232)
Fonts13 PostScript Type I fonts on board
TrueType fonts supported by downloading TrueType fonts in
unhinted Type I
PDL (Page Description
PostScript Level 1, or compatible
Language)
3
CHAPTER 1
LaserWriter Select 310 Hardware
Communication Ports1
The LaserWriter Select 310 printer supports two communication ports:
RS-232 8-pin serial port
■
■
Centronics 36-pin parallel port
Figure 1-1 shows the relative positions of these ports on the rear panel of the printer.
Figure 1-1
LaserWriter Select 310 printer side panel connectors
Centronics 36-pin portSIMM card slot
RS-232 8-pin
serial port
When the LaserWriter Select 310 printer is first powered on, the serial port with binary
protocol enabled is the default communication port. If any character is received over the
Centronics parallel port, the parallel port with binary protocol and a serial back channel
automatically becomes the default port. If you want to change the communication port
back to serial mode after a job has been sent over the parallel port, you should power
down and then restart the printer. Similarly, if you wish to change printer drivers, you
should power down and then restart.
IMPORTANT
It is better to operate the LaserWriter Select 310 printer in either a serial
or a parallel communication environment than to transmit both
serial and parallel data. Attempting to operate in both environments may
cause unpredictable results.
▲
Serial Port for RS-232C Devices1
The LaserWriter Select 310 printer supports the RS-232 protocol by means of an 8-pin
mini-DIN connector . This connector pr ovides the interface between the printer and Apple
Macintosh computers. Figure 1-2 shows the connector pin designations and
Table 1-2 lists the pin functions for this 8-pin connector. You can also connect the printer
directly to a Macintosh computer using a Peripheral-8 (M0197) cable and communicate
with the printer using the LaserWriter Select 310 printer driver, or a terminal emulation
program such as MacTerminal.
4
Communication Ports
CHAPTER 1
LaserWriter Select 310 Hardware
Figure 1-2
876
54
2
Table 1-2
Pin
number
An 8-pin serial port connector
3
1
Signal descriptions for an 8-pin serial port
Signal
nameI/ODescription
Connected to
chassis ground
1DTRIData terminal ready. Send data when this signal
is asserted.
2DSROData set ready.
3/TXDOTransmit data (inverted)
5/RXDOReceive data (inverted)
4, 6GND–Ground
7, 8 Not used–These pins are not connected
Centronics Parallel Connector 1
The LaserWriter Select 310 printer provides a 36-pin connector for communication with
a standard Centronics parallel interface. It is fully compatible with the IBM PC
Centronics port.
The parallel channel is basically unidirectional and is used to input information from the
host computer to the printer. The printer returns minimal status information to the host,
such as /POUT and /F AULT, which flag paper errors. It also returns handshaking signals
such as PBUSY and /PACK. If you require additional status information from the printer
while you are printing to the parallel port, you can use a host computer running a
terminal emulation at 9600 bauds to connect to the serial port of the printer.
Communication Ports
5
CHAPTER 1
LaserWriter Select 310 Hardware
Figure 1-3 shows the pin designations for the Centronics parallel connector and Table 1-3
lists the signal descriptions. Figure 1-4 shows the timing requirements for the Centronics
interface.
Figure 1-3
Pin 18
Pin 36
Table 1-3
Pin
numberSignal nameI/ODescription
A Centronics parallel connector
Pin 1
Pin 19
Signal descriptions for a Centronics parallel port
1/PSTROBEIStrobe for parallel input data
2DATA 0IData input bit 0
3DATA 1IData input bit 1
4DATA 2IData input bit 2
5DATA 3IData input bit 3
6DATA 4IData input bit 4
7DATA 5IData input bit 5
8DATA 6IData input bit 6
9DATA 7IData input bit 7
10/PACKOHandshaking output signal; printer uses it to
acknowledge receipt of parallel data
11PBUSYOBusy output signal; indicates that a /PSTROBE
signal has been received, but /PACK has not
yet been given
12POUTOPaper out; an output error signal; indicates the
printer has run out of paper
13Tied high–This select line is tied high so the LaserWriter
Select 310 printer is always selected
14, 15, 16Not connected–These lines are not connected
17CHASSIS
–Chassis ground
GROUND
18Not used–Not used
6
Communication Ports
CHAPTER 1
LaserWriter Select 310 Hardware
Table 1-3
Signal descriptions for a Centronics parallel port (continued)
Pin
numberSignal nameI/ODescription
19-30SIGNAL
–Signal ground
GROUND
31Not connected–This line is not connected
32/FAULTOFault signal; asserted if there is a printer
problem
33-36Not connected–These lines are not connected
NOTE
Inputs and outputs are referenced to the printer. An input (I) signal is
sent from the host computer to the printer, and an output (O) signal is sent from
the printer to the host.
Figure 1-4
Data
/PSTROBE
Timing for a Centronics interface
a
cb
d
PBUSY
e
f
/PACK
g
Timing specificationMin. valueTypical valueMax. value
a. Data setup time before PSTROBE on
b. PSTROBE on pulse width
c. Data hold time after PSTROBE off
d. PSTROBE on to PBUSY on
e. Duration of PBUSY on (printer on line)
f. PBUSY off to /PACK on
g. /PACK on pulse width
0.5µsec
1.0µsec
0.5µsec
0.0µsec
10.0µsec
0.0µsec
1.5µsec
500µsec
1.0µsec
2.5µsec
10.0µsec
Communication Ports
7
CHAPTER 1
LaserWriter Select 310 Hardware
Status Lights1
The LaserWriter Select 310 printer has three colored lights on the left side of the printer.
These lights indicate what the printer is doing. Figure 1-5 shows a view of the status light
symbols, and Table 1-4 describes the functions of the lights.
Figure 1-5
GreenAmberAmber
Ready/
In use
Table 1-4
Light Light’s statePrinter’s state
Ready/in use
Green
Status lights
Paper
out
Status light messages
On
Off
Paper
jam
The printer is ready to use.
The printer cannot print because there is an error
condition, or the printer cover is open.
Flashing
The printer is warming up or is processing data for
the next print job.
Paper out
Amber
On
Paper tray is empty or has been removed from
the printer.
Off
There is an adequate supply of paper in the
paper tray.
Flashing
The printer is in manual-feed mode and is ready for
the next sheet of paper.
Paper jam
Amber
8
Status Lights
On
Off
Flashing
NOTE
If both the Paper out and Paper jam lights flash or stay on, the printer
requires service.
There is a paper jam.
Paper is feeding correctly through the printer.
The printer requires service.
CHAPTER 1
LaserWriter Select 310 Hardware
Memory Capabilities1
The standard configuration of the LaserWriter Select 310 printer comes with 1MB of ROM
and 1.5 MB of DRAM. Figure 1-6 shows the positioning of the DRAM and ROM on the
printer’s main circuit board.
Figure 1-6
SIMM card slot
DRAM
Detail of SIMM card
The ROM and DRAM locations on a printed circuit board
512K x 8
512K x 8
256K x 16
Centronics connector
Presents
32-bit interface
to microprocessor
72-pin SIMM card accomodates
up to 8 DRAM devices. Layout of
devices on board depends upon
manufacturer.
8-megabit ROM
Serial port
Pin 1Pin 36Pin 37Pin 72
8 256K x 4 DRAMs provide 1 MB of storage.
8 1 megabit x 4 DRAMs provide 4 MBs of storage.
Note: You must use 32-bit wide SIMMs.
ROM Capability1
The LaserWriter Select 310 printer has a single ROM installed on the board. It
is an 8-megabit, 42-pin masked ROM, and it stores the diagnostic software, fonts,
and PostScript interpreter required by the printer. Currently you cannot expand
ROM capacity.
Memory Capabilities
9
CHAPTER 1
LaserWriter Select 310 Hardware
DRAM Expansion1
The LaserWriter Select 310 printer comes with 1.5 MB of DRAM installed on the printer’s
main circuit board. As shown in Figure 1-6, there are three DRAM devices: two 512K x 8
bit devices, and one 256K x 16 bit device. These three DRAMs present a 16-bit interface to
the microprocessor installed on the printed circuit board.
You can expand DRAM capability by adding a 72-pin SIMM (single in-line memory
module), which plugs into the SIMM connector on the circuit board. The LaserWriter
Select 310 printer supports SIMM cards with capacities of 1 MB and 4 MB. You must use a
32-bit wide SIMM card in this configuration.
Basic Operation1
This section provides an overview of the LaserWriter Select 310 printer’s operating
modes. Since much of the printer’s behavior may be changed by changing the parameter
settings, as described in Chapter 2, this section assumes that all options that may be
adjusted are set to their standard values.
The main function of the LaserWriter Select 310 printer is to execute the PostScript
language programs sent to it from a computer. During normal operation, the printer
cycles endlessly through the following sequence of steps:
1. It sets up a clean initial execution environment (virtual memory) for the PostScript
language program. In effect, it is setting up a job.
2. It executes the job by interpreting the standard input files, which are r eceived on either
the serial port or on the Centronics parallel port.
3. When the printer encounters an end-of-file character or when an error occurs, it cleans
up after the job and restores the virtual memory to its initial state in preparation for
the next job.
The main object of this process is to produce printed pages. However, a program may
change some permanent parameters in the printer itself, or it may perform some
computation that causes results to be sent back to the host computer, rather than causing
hard copy to be printed.
There are two basic modes of operation: batch and interactive.
Batch Mode1
Batch mode is the normal way of operating the LaserWriter Select 310 printer . In this
mode it operates as a printing device for a computer.
A batch-mode job consists of executing a single file containing a PostScript language
program. When an end-of-file character is reached, or the PostScript language terminates,
the job is finished. In this mode, the only data transmitted from the LaserWriter Select 310
printer to the host is generated by the PostScript language printer operator or by errors.
The printer provides no echoing, editing, or other user amenities.
10
Basic Operation
CHAPTER 1
LaserWriter Select 310 Hardware
Interactive Mode1
You can use the LaserWriter Select 310 printer as a personal computer, and control it
directly by means of a terminal or other input device. This way of using the printer is
known in this context as interactive mode. It allows you to experiment with the
PostScript language.
In interactive mode, a job consists of a long dialogue, in which you issue a PostScript
language statement, and the server executes the statement and prompts for the next one.
The state of the PostScript interpreter’s virtual memory persists until you explicitly end
the job. While you are entering a statement, the printer echoes characters and provides
you with limited means for making corrections.
Page Types1
The imageable area of a page (the area in which printed matter may appear) is referred to
as the page size. Page size constrained by
■
the physical size of the paper
■
the margins required by the printing engine
the amount of memory available for the full-page frame buffer
■
Table 1-5 lists the range of paper sizes supported by the LaserWriter Select 310 printer.
Name
Table 1-5
Paper size in
inches
Available page types
Page size in
inchesDescription
a48.27 x 11.697.84 x 11.42Standard page type for European A4-size paper
a4small8.27 x 11.697.47 x 10.85Smaller version of a4
a55.87 x 8.275.44 x 7.84Standard page type for European A5-size paper
b57.17 x 10.126.97 x 9.72Standard page type for Japanese B5-size paper
c56.38 x 9.025.98 x 8.62Standard page type for the C5-size envelope
com104.13 x 9.53.73 x 9.1Standard page type for the COM10-size envelope
dl4.33 x 8.663.93 x 8.26Standard page type for the DL-size envelope
executivepage7.25 x 10.56.85 x 10.1Standard page type for Executive-size paper
legal8.5 x l48.1 x 13.67Standard page type for legal-size paper
letter8.5 x 118.1 x 10.67Standard page type for letter-size paper
lettersmall8.5 x 117.68 x 10.16Smaller version of letter size
monarch3.87 x 7.53.47 x 7.1Standard page type for the Monarch-size
envelope
NOTE The margins required in all cases are 0.2 inches on each side, and atthe top and bottom.
Page Types
11
CHAPTER 1
LaserWriter Select 310 Hardware
Paper Handling1
The LaserW riter Select 310 printer of fers a variety of paper handling featur es, as shown in
Figure 1-7. It has three paper feeders and six types of cassettes:
■ The manual feeder is an integral part of the printer. To use it, you pull down a small
flap on the front of the printer. You may use this feeder to feed single sheets manually,
or you may attach an optional multi-purpose tray that accommodates up to 50 sheets
of varying sizes, or five envelopes.
■ The 250-page feeder pulls out like a drawer from the front of the printer. It
accommodates a cassette which holds three paper sizes: letter, legal, and envelope.
■ The 500-page optional feeder is a separate unit. It is installed under the LaserWriter
Select 310 printer. It accommodates a cassette which holds three paper sizes: A4, B5,
and letter.
The basic printer comes with:
■ the 50-sheet feeder
■ the 250-sheet feeder
■ a universal cassette 250-sheet cassette that holds U.S. letter-size paper, A4-size paper,
A5-size paper, B5-size paper, and executive-size paper.
As shown in Figure 1-7, if you use the basic printer with additional optional feeders, you
can extend the printer’s paper-feeding capabilities to 500 or 750 sheets. You can also use
the manual feed tray in any of these configurations.
12Paper Handling
CHAPTER 1
LaserWriter Select 310 Hardware
Figure 1-7Paper handling options
Base product
250
Extended configurations
250
250
Manual feed
tray
Universal
Options
250
500
50 Sheet
5 Env
Multi-purpose tray
250 Legal
30 Env
500
250
CassettesFeeders
Universal
250 Legal
30 Env
500 B5
500 Letter
500 A4
Key
The printer with
50-sheet manual feed
750-sheet capacity500-sheet capacity
FeederCassettes
(paper trays)
Paper Handling13
Figure 2-0
Listing 2-0
Table 2-0
CHAPTER 2
LaserWriter Select 310
Software2
CHAPTER 2
LaserWriter Select 310 Software
This chapter describes the LaserWriter Select 310 software.
■ It provides an overview of software features, including the Adobe PostScript
Programming Language, the PostScript interpreter, the LaserWriter Select 310 driver,
and page types.
■ It defines the software parameters that enable you to set up and configure the
LaserWriter Select 310 printer. They include, system parameters, page device
parameters, user parameters, device parameters, communication parameters, engine
device, extensions to PostScript Level 1, and the printer error parameter.
■ It also explains how to set these parameters.
■ It describes changes made to the PostScript language that impact the LaserWriter
Select 310 printer including the use of packed arrays, use of immediately evaluated
names, changes in the operation of the font cache, new general sampling and halftone
techniques, and a different method of handling end-of-line recognition.
Software Overview2
This section gives you an overview of the LaserWriter Select 310 software features,
including:
■ the Adobe PostScript Programming Language
■ the PostScript interpreter
■ the LaserWriter Select 310 driver
■ page types
■ product strings
Adobe PostScript Programming Language2
The LaserWriter Select 310 printer executes descriptions written in the PostScript
language. The version of the PostScript language used has features and capabilities that
might not be present in other PostScript output devices. This developer note describes
the supplementary PostScript language features of the LaserWriter Select 310 printer. You
should use the note in conjunction with the PostScript Language Reference Manual, first
edition, published by Addison-Wesley.
PostScript Interpreter2
You may access the special features of the LaserWriter Select 310 printer by executing
special PostScript operators that exist only in the printer’s interpreter, PostScript
interpreter version 52.5.
16Software Overview
CHAPTER 2
LaserWriter Select 310 Software
The special operators are intended for use by interactive users, by programmers of host
software that carries out user requests, or by users who may want to configure the
LaserWriter Select 310 printer in non-standard ways. Normally page descriptions should
not refer to the special operators, since doing so impairs portability.
LaserWriter Select 310 Driver2
The LaserWriter Select 310 driver and Print Manager provide a general printer interface
to the printer. The interface should meet the needs of most Macintosh applications.
The driver:
■ provides full support for PostScript Language Level 1
■ supports standard and optional cassettes, multiple bins, a multipurpose paper tray,
and an envelope feeder
■ enables the printer to report paper size in the standard and optional cassettes to
the user
■ presents printer jam status if reported back by the printer
■ supports print density adjustment
■ supports Type 1 and TrueType fonts
Page Types2
The page types for the LaserWriter Select 310 printer are the same as those described in
Chapter 4 of the LaserWriter Reference.
At the beginning of each job, the server selects the default paper tray, as assigned by
the defaultpapertray operator. If the default is the main cassette, the server can
detect its size and install the appropriate image region. If the default is the multipurpose tray, the server uses the image region most recently installed by means of
the setdefaultmultipurposepapertraysize operator.
When the multipurpose tray is selected in this way, or by using the setpapertray
operator, it is treated like the main cassette. Several sheets of paper may be stacked in it,
and it feeds continuously until it is empty, at which time a light comes on to indicate that
the paper has run out. If a job requires a particular paper size, it should invoke one of the
paper tray selection operators listed in Table 2-1 on page 18 before it generates an image.
The paper tray selection stays in effect for the duration of the job. The server restores the
default paper tray selection when that job is finished. Table 1-5, in Chapter 1, defines the
different paper sizes.
Software Overview17
CHAPTER 2
LaserWriter Select 310 Software
Table 2-1Paper tray selection operators
OperatorDescription
a4traySelects the paper tray containing A4-size paper and sets the page
type to either a4 or a4small, depending on the value of
pagetype. This operator raises the PostScript language error
rangecheck if there is no paper tray containing A4-size paper.
a5traySelects the paper tray containing A5-size paper and sets the page
type to a5. This operator raises the PostScript language error
rangecheck if there is no paper tray containing A5-size paper.
b5traySelects the paper tray containing B5-size paper and sets the page
type to b5. This operator raises the PostScript language error
rangecheck if there is no paper tray containing B5-size paper.
c5traySelects the paper tray containing C5-size paper and set the page
type to c5. This operator raises the PostScript language error
rangecheck if there is no paper tray containing C5-size paper.
com10traySelects the paper tray containing COM10-size envelopes and sets
the page type to com10. This operator raises the PostScript
language error rangecheck if there is no paper tray containing
COM10-size envelopes.
dltraySelects the paper tray containing DL-size envelopes and sets
the page type to dl. This operator raises the PostScript language
error rangecheck if there is no paper tray containing DL-size
envelopes.
executivetra
y
Selects the paper tray containing Executive-size paper and sets the
page type to executivesize. This operator raises the PostScript
language error rangecheck if no paper tray contains Executivesize paper.
legaltraySelects the paper tray containing legal-size paper and sets the page
type to legal. This operator raises the PostScript language error
rangecheck if there is no paper tray containing legal-size paper.
lettertraySelects the paper tray containing letter-size paper and sets the page
type to either letter or lettersmall, depending on the value
of pagetype. This operator raises the PostScript language error
rangecheck if there is no paper tray containing lettersize paper.
monarchtraySelects the paper tray containing Monarch-size paper and sets
the page type to monarch. This operator raises the PostScript
language error rangecheck if no paper tray contains Monarchsize envelopes.
18Software Overview
CHAPTER 2
LaserWriter Select 310 Software
Product Strings2
Table 2-2 lists values assigned to the product strings associated with the LaserWriter
Select 310 printer.
This section defines the software parameters that enable you to set up and configure the
LaserWriter Select 310 printer. These parameters fall into two broad categories:
■ communication device parameters
■ compatibility operators
Communication Device Parameters2
The LaserWriter Select 310 printer has two communication ports: an RS-232 serial port
and a Centronics 36-pin parallel port. The section “Setting Communication Parameters,”
later in this chapter, defines communication channel parameters. Chapter 3,
“Communication Channels,” provides detailed information on this subject.
The LaserWriter Select 310 printer does not need to change parameters for the parallel
communication channel, nor is it equipped to do this.
Compatibility Operators2
The PostScript language has undergone a number of significant extensions. The language
is designed to be a universal standard for device-independent page descriptions, but each
PostScript language implementation supports features and capabilities particular to that
implementation. Appendix D, “Compatibility Strategies,” in the PostScript Language Reference Manual, second edition, presents guidelines for taking advantage of language
extensions, while maintaining compatibility with PostScript interpreters.
Level 1 implementations provide a collection of device control and system parameter
configuration operators and procedures, most of which are defined in the dictionary
statusdict. The contents of statusdict are product dependent, although an attempt
has been made to maintain a consistent specification for common features. It is the
dictionary for product-specific operators and other definitions.
Software Parameters19
CHAPTER 2
LaserWriter Select 310 Software
The compatibility operators present in the LaserWriter Select 310 printer appear in
three dictionaries: statusdict, and userdict. Table 2-3 lists these operators by
dictionary group.
dl
executive page
legal
letter
lettersmall
monarch
CHAPTER 2
LaserWriter Select 310 Software
Setting Compatibility Operators2
The LaserWriter Select 310 printer has an extensive collection of parameters that control
its behavior. This section describes how to set the following types of parameters:
■ system parameters
■ page device parameters
■ user parameters
■ device parameters
■ communication parameters
■ engine device parameters
■ parameters that are extensions to PostScript Level 1
■ the printer error parameter
T able 2-4 lists the parameters by type, in the or der described. Although certain parameters
are described as persistent, the LaserWriter Select 310 printer does not have nonvolatile
memory (EEROM), so the values of these parameters do not persist when the printer is
turned off and then on again. However, they do persist between jobs if they are executed
outside the server loop.
This section describes the compatibility operators that set Level 1 system parameters.
checkpassword2
Syntaxint checkpassword bool
DefinitionThis operator checks the validity of the current password. It returns true
if int is equal to the current system administrator password. Otherwise,
after delaying for one second, it returns false.
Standard value: 0
ErrorNone
defaulttimeouts2
Syntax– defaulttimeoutsjob manualfeed wait
DefinitionThis operator returns the following values:
■default job
■manual feed
■wait timeout values
Standard value: 0 60 40
Errorstackoverflow
idlefonts2
Syntax– idlefonts mark font sxsy rot chars
DefinitionThis operator pushes a mark followed by the integers that control idle
time scan conversion (see setidlefonts). An empty list of integers, that
is one with just a mark on the top of the operand stack, specifies that the
standard set of characters is to be scan converted.
Standard value: mark
Errorstackoverflow
pagecount2
Syntax– pagecountint
DefinitionThis operator returns the value of the system parameter PageCount.
That is, it returns the number of pages that have been printed by the
LaserWriter Select 310 printer.
There is no way to reset this value.
Errorstackoverflow
Setting Compatibility Operators23
CHAPTER 2
LaserWriter Select 310 Software
printername2
Syntaxstring printername substring
DefinitionThis operator stores the value of the system parameter PrinterName in
string and returns a string object designating the substring actually used.
Standard value: (LaserWriter Select 310)
Syntax– product string
DefinitionThis operator is a string object which is the name of the laser printer
product (LaserWriter-Select 310). If a program needs to know what type
of printer it is running on, it should check this string.
Standard value: (LaserWriter-Select 310)
Errorstackoverflow
productA2
Syntax– productA string
DefinitionThis operator is a string object which is used when the printer needs a
default name to install in printer name. This happens when the
printer is turned on for the first time after installation. It will happen each
time the printer is turned on until a new name is stored using
setprintername.
Standard value: (LaserWriter-Select 310)
Errorstackoverflow
ramsize2
Syntax– ramsizeint
DefinitionThis operator returns the number of bytes of RAM in the printer.
Errorstackoverflow
revision2
Syntax– revisionint
DefinitionThis operator is an integer which designates the current revision level of
the machine-dependent portion of the PostScript interpreter.
Standard value: 0
Errorstackoverflow
24Setting Compatibility Operators
CHAPTER 2
LaserWriter Select 310 Software
setdefaulttimeouts2
Syntaxjob manualfeed wait setdefaultimeouts –
DefinitionThis operator establishes the default values for the three timeouts. It
Syntaxmark font sxsy rot nchars ... setidlefonts –
DefinitionThis operator expects the operand stack to contain up to 150 integers in
the range 0 through 255. The integers are delimited by a mark
immediately below them. Operator setidlefonts removes the mark
and the integers and remembers them permanently. The integers are
interpreted in groups of five that specify characters that are to be scan
converted while the LaserWriter Select 310 printer is idle. If the last set of
integers in the list is not a multiple of five at idle time, that group is
ignored. An empty list of integers, that is one with just a mark on top of
the operand stack, specifies that the standard set of characters is to be
scan converted.
Syntaxold new setpassword bool
DefinitionThis operator sets the system administrator password, controlling the
ability to escape from the server save/restore context and to make
persistent changes to system parameters or to the VM (virtual memory).
The operator requires two integer operands: the old password and the
new password. If old is the correct old password, setpassword changes
the password to new and returns true. Otherwise, after a delay of one
second, it returns false.
Standard value: 0
Errortypecheck
Setting Compatibility Operators25
CHAPTER 2
LaserWriter Select 310 Software
setprintername2
Syntaxstring setprintername –
DefinitionThis operator establishes the string to be the printer’s name.
To maintain compatibility with the Personal LaserWriter NT which
includes AppleTalk, the string should be no longer than 31 characters. It
should consist entirely of printing characters, and should not contain the
characters : or @.
This section describes compatibility operators that set Level 1 page device parameters.
defaultmultipurposetraysize2
Syntax– defaultmultipurposetraysize name bool
DefinitionThis operator returns the name and bool parameters used with
setdefaultmultipurposetraysize to set the default multipurpose
tray size.
Standard value: /letter true
Errorstackoverflow
defaultpapertray2
Syntaxtray defaultpapertray –
DefinitionThis operator returns the default paper tray number set by
setdefaultpapertray.
Standard value: 0
Errorstackoverflow
dostartpage2
Syntax– dostartpagebool
DefinitionThis operator returns the Boolean set during the most recent execution
of dostartpage.
Standard value: false
Errorstackoverflow
26Setting Compatibility Operators
CHAPTER 2
LaserWriter Select 310 Software
manualfeed 2
Syntax– manualfeed bool
DefinitionIf manualfeed is true at the time of a showpage or copypage, then
that page will be fed manually. Otherwise, the page will not be fed
manually.
Standard value: false
Errorstackoverflow
manualfeedtimeout 2
Syntax– manualfeedtimeout int
DefinitionThis operator is the manual feed timeout currently in effect, that is, the
number of seconds the LaserWriter Select 310 printer will wait for a page
to be inserted into the manual feed slot. This timeout applies only when
the printer is in manual feed mode and manualfeed is true.
At the beginning of a job, the server initializes manualfeedtimeout to
the default manual feed timeout returned by defaulttimeouts.
However, a PostScript language program may change it to any
non-negative integer value by using def,put, or store.
Standard value: 60
Errorstackoverflow
margins2
Syntax– margins top left
DefinitionThis operator returns the x and y components of the page
deviceMargins parameter as left and top, respectively.
Standard value: 0
Errorstackoverflow
pagestackorder 2
Syntax– pagestackorderbool
DefinitionThis operator returns the last value set by setpagestackorder.
It should be true if the pages are to be stacked face down in the
output tray and false if the pages are to be stacked face up.
Standard value: true
Errorstackoverflow
Setting Compatibility Operators27
CHAPTER 2
LaserWriter Select 310 Software
papersize2
Syntax– papersize name bool
DefinitionThis operator returns the name of the operator that selects a tray
containing paper of the current size. For example, if the current paper
size is letter, this operator returns the value /lettertray. The value of
bool is true if the page feeds short edge first, false if the page feeds
long edge first.
Standard value: The operator appropriate for the tray specified by
papertray.
Errorstackoverflow
papertray2
Syntax– papertray integer
DefinitionThis operator returns the paper tray number most recently set by the
setpapertray operator.
Standard value: The value of the defaultpapertray operator.
Errorstackoverflow
setdefaultmultipurposepapertraysize2
Syntaxname bool setdefaultmultipurposetraysize –
DefinitionThis operator tells the interpreter what paper size is installed in the
multipurpose tray. Because the printer engine cannot sense this
information, operators that need to know paper size refer to the value
stored by this operator.
This operator must be executed outside the server loop.
The name operand is the name of one of the standard device setup
The procedures /lettersmall and /a4small are not allowed.
The value of the pagetype operator controls whether or not the page
is small.
The bool parameter is included for compatibility with other PostScript
printers. It specifies whether the paper is to be fed long edge first or short
edge first. For all paper sizes on the LaserWriter Select 310 printer, the
value of bool must be true, which means the short edge is fed first.
Syntaxtray setdefaultpapertray –
DefinitionWhen the server begins a job, it establishes the default paper tray as the
tray from which it will feed paper, and it sets up an imageable area
corresponding to the size of paper in that tray. The tray operand is an
integer that must be set to one of the following values:
0 for the main cassette (cassette 250)
1 for the multipurpose tray
2 for the optional cassette (cassette250/500)
Syntaxbool setdostartpage –
DefinitionSince the LaserWriter Select 310 printer has no start page, executing this
operator with a value of true has no effect, and is ignored. The operator is
present to maintain compatibility with the Personal LaserWriter NT.
Errorsinvalidaccess, stackunderflow, typecheck
setmargins2
Syntaxtop left setmargins –
DefinitionThis operator adjusts the printer’s margins, thus changing the alignment
of the imageable area on the physical page. The top and left operands are
integers that specify distances in device space. (The unit size is one
device pixel or 1/300 inch.) A positive top widens the top margin, and a
negative top narrows it, relative to the standar d mar gin width. Similarly a
positive left widens the left margin, and a negative left narrows it.
You should use setmargins only at installation time to correct any
existing physical alignment errors. There are limits to the range of
adjustment possible. The printer hardware imposes margins that cause
the image to be clipped it is moved too close to the edge of the paper.
Note 1. The margins imposed by the hardware are not symmetrical
with respect to the center of the paper.
Note 2. This operator in no way affects the dimensions of the
imageable area.
Syntaxbool setpagestackorder –
DefinitionThis operator sets value returned by pagestackorder. A value of true
indicates that the output is going to the face-down tray. A value of false
indicates that the output is directed to the face-up tray. Since the
LaserWriter Select 310 printer has only a face-down tray, true is the only
correct value for this parameter.
Syntaxint setpagetype –
DefinitionThis operator specifies the default page type to be used subsequently
when any paper tray is installed. The following values may be used:
0 selects the standard page image area (letter, a4, etc.)
n a non-zero value selects note sizes
Errorsinvalidaccess, stackunderflow, typecheck
setpapertray2
Syntaxinteger setpapertray –
DefinitionThis operator sets the paper tray from which paper will be fed, and it sets
the image area according to the size of paper in the tray and the value of
the pagetype operator. The integer argument must be:
0 for the main cassette (cassette 250)
1 for the multipurpose tray
2 for the optional cassette (cassette250/500)
Because this operator installs a new image area, it should be invoked
before any marks are placed on the current page. If this operator is
executed while an outstanding printer error exists, the interpreter waits
until the error has been cleared before completing the execution of this
operator.
Errorsrangecheck, stackunderflow, typecheck
30Setting Compatibility Operators
CHAPTER 2
LaserWriter Select 310 Software
Setting User Parameters2
This section describes the compatibility operators that set Level 1 user parameters.
jobname 2
Syntax– jobnamestring
DefinitionThis operator is a string with the same value as the user parameter
JobName. It specifies the name of the current job. If a PostScript
language program defines jobname, status responses generated during
the remainder of the job in progress will include a job field that reports
the text of this string. The string should not contain the characters ; or ],
since they would disrupt the syntax of the status messages.
Standard value: null
Errorstackoverflow
jobtimeout 2
Syntax– jobtimeoutint
DefinitionThis operator returns the number of seconds remaining before the job
timeout will occur. It does this by returning the value of the user
parameter JobTimeout. If the returned value is 0, the job will never
time out.
Standard value: 0
Errorstackoverflow
setjobtimeout 2
Syntaxint setjobtimeout –
DefinitionThis operator sets the timeout for the current job to the value int, a
non-negative integer specifying a time interval in seconds. If the current
job continues for int seconds without either completing or executing
setjobtimeout again, the PostScript interpreter executes a timeout
error. The value 0 disables the job timeout altogether.
At the beginning of a job, the server initially sets the job timeout to the
default job timeout returned by defaulttimeouts. However, in
interactive mode, the initial job timeout is always 0.
Errorrangecheck, stackunderflow, typecheck
Setting Compatibility Operators31
CHAPTER 2
LaserWriter Select 310 Software
waittimeout 2
Syntax– waittimeout int
DefinitionThis operator is the wait timeout currently in effect, that is, it is the
number of seconds the LaserWriter Select 310 printer will wait to receive
additional characters from the host before it aborts the current job by
executing a timeout. At the beginning of a job, the server initializes
waittimeout to the default wait time returned by defaulttimeout.
However, a PostScript language program may change it to any
non-negative integer value. In interactive mode, the wait timeout is
always 0.
Standard value: 40
Errorstackoverflow
Setting Device Parameters2
This section describes the compatibility operators that set Level 1 device parameters.
setsoftwareiomode 2
Syntaxint setsoftwareiomode –
DefinitionThis operator sets the binary protocol mode of the communications
channel according to the value of int:
0binary protocol off
100binary protocol on
Binary protocol is standard in the LaserWriter Select 310 printer, and it
should be used by any driver that sends binary data to the printer.
A driver that does not use the binary pr otocol and does not filter the back
channel data when softwareiomode is 100 will see receive control
characters as quoted characters. In particular, Control-Ds will be seen as
Control-A/ASCII-D.
The softwareiomode operator does not need to be set outside the
server loop in order to be compatible with other printer implementations
of sofwareiomode. However changes to it do not take effect until the
job that makes the changes is completed.
Standard value: 100
Errorsrangecheck, stackunderflow, typecheck
32Setting Compatibility Operators
CHAPTER 2
LaserWriter Select 310 Software
softwareiomode2
Syntaxint setsoftwareiomode –
DefinitionThis operator sets the binary protocol mode of the communications
channel according to the value of int:
0binary protocol off
100binary protocol on
Binary protocol is standard in the LaserWriter Select 310 printer, and it
should be used by any driver that sends binary data to the printer.
A driver that does not use the binary protocol and does not filter the back
channel data when softwareiomode is 100 will see receive control
characters as quoted characters. In particular, Control-Ds will be seen as
Control-A/ASCII-D.
The softwareiomode operator does not need to be set outside the
server loop in order to be compatible with other printer implementations
of sofwareiomode. However changes to it do not take effect until the
job that makes the changes is completed.
Standard value: 100
Errorsrangecheck, stackunderflow, typecheck
Setting Communication Parameters2
The following compatibility operators set Level 1 serial communication parameters.
Serial communication channel (SCC) operator encoding is described in Chapter 3,
“Communication Channels,” in the section “SCC Operator Encoding.”
packetbackchannel2
Syntaxpacketbackchannelbool
DefinitionThis operator returns the current back channel packet protocol setting.
Standard value: false
Errorstackoverflow
Setting Compatibility Operators33
CHAPTER 2
LaserWriter Select 310 Software
sccbatch2
Syntaxchannel sccbatch baud options
DefinitionThis operator returns the baud rate and options for the specified serial
channel. Channel 9 only is available with this printer.
baud and options affect the following device parameters:
■ Baud, StopBits, and FlowControl
■ DataBits and Parity
■ CheckParity
See “setsccbatch” for further information.
The values for data bits and parity are determined by the bit positions.
See the section “SCC Operator Encoding” in Chapter 3.
Baud, stop bits, and flow control are determined respectively by the
corresponding settings for Baud, StopBits, and FlowControl
device parameters.
Standard value: 57600 68
This value represents an 8-pin serial channel with a baud rate
of 57600, space parity, DTR flow control, 8 data bits, and one stop bit.
(See Table 3-6.)
Syntaxbool setpacketbackchannel –
DefinitionThis operator sets the serial communications back channel packet DTR
protocol to be on if bool is true, or off if bool is false. The packet
protocol is used exclusively by the Apple LaserWriter driver and should
be set by it only.
Errorsinvalidaccess, stackunderflow, typecheck
34Setting Compatibility Operators
CHAPTER 2
LaserWriter Select 310 Software
setsccbatch2
Syntaxchannel baud options setsccbatch –
DefinitionThis operator sets the communication parameters as specified by
three integers:
■ channel, which designates the serial channel. Channel 9 only
is available
■ baud rate, which determines the rate of data transfer
■ options, which encodes parity, flow control, the number of
data bits, and the number of stop bits to be used in serial
communication mode
The new baud rate and options do not take effect until the end of the
current job. You may not set the serial channel’s baud rate to 0. A 0
setting will cause a rangecheck error to occur.
Example: 9 19200 2 setsccbatch sets the 8-pin serial channel to
19200 baud with even parity.
Refer to the section “SCC Operator Encoding,” in Chapter 3, for detailed
information on this subject.
This section describes the compatibility operators that set Level 1 engine device
parameters.
darkness2
Syntax– darknessreal
DefinitionThis operator returns the darkness value set by setdarkness.
Standard value: .75
Errorstackoverflow
Setting Compatibility Operators35
CHAPTER 2
LaserWriter Select 310 Software
setdarkness2
Syntaxreal setdarkness –
DefinitionThis operator sets the printer’s laser density according to the value
specified by real, where a value of 0 is the least dense and a value of 1 is
the most dense. This causes the printer’s output to be either lighter or
darker , depending on whether the darkness value is lowered or increased
from the current value.
The printer itself has only five darkness settings: 0,.25,.5,.75,
and 1. If the value of real is set between 0 and 1 but is not one of these
values, darkness will be set to the setting closest to real. If the value of real
is outside the range of 0 through 1, a rangecheck error will occur.
The LaserWriter Select 310 printer uses a variety of parameters that are not generally
used with PostScript Level 1 language. These operators extend the capabilities of the
PostScript Level 1 language supported by the printer.
currentcacheparams2
Syntax– currentcacheparams mark lower upper
DefinitionThis operator pushes a mark object followed by the current cache
parameters onto the operand stack. The number of cache parameters
returned is variable. See setcacheparams.
Standard value: mark 1250 12500
Errorstackoverflow
currentpacking 2
Syntax– currentpacking bool
DefinitionThis operator returns the array packing mode currently in effect.
Standard value: false
Errorstackoverflow
36Setting Compatibility Operators
CHAPTER 2
LaserWriter Select 310 Software
packedarray2
Syntaxany0...any
packedarray packedarray
n-1
DefinitionThis operator creates a packed array object of length n. The array object
contains the objects any0 through any
as elements. The packed array
n-1
operator first removes the non-negative integer n from the operand stack,
creates a packed array containing those objects as elements, and finally
pushes the resulting packed array object onto the operand stack.
The resulting object has a type of packedarraytype, a literal attribute,
and read-only access. In all other respects, its behavior is identical to that
of an ordinary array object.
Syntaxmark lower upper setcacheparams -
DefinitionThis operator sets cache parameters as specified by the integer objects
above the topmost mark on the stack, and then removes all operands and
the mark object as if by cleartomark.
The number of cache parameters is variable. If more operands are
supplied to setcacheparams than are needed, the topmost ones are used
and the remainder ignored. If fewer are supplied than are needed,
setcacheparams implicitly inserts default values between the mark
and the first operand supplied.
The upper operand specifies the maximum number of bytes that may be
occupied by the pixel array of a single cached character. The lower
operand specifies the threshold at which characters are stored in
compressed form rather than as full pixel arrays. If a character’s pixel
array requires more bytes than specified by lower bytes to r epresent it, it is
compressed in the cache and reconstituted from the compressed
representation each time it is needed.
Setting lower to zero forces all characters to be compressed, permitting
more characters to be stored in the cache, but increasing the amount of
work required to print them. Setting lower to a greater value than upper
disables compression.
Errorsrangecheck, unmatchedmark
Setting Compatibility Operators37
CHAPTER 2
LaserWriter Select 310 Software
setpacking 2
Syntaxbool setpacking –
DefinitionThis operator determines the type of executable arrays subsequently
created by the PostScript interpreter’s scanner. It sets the array packing
mode to the specified boolean value. The value true selects packed
arrays. The value false selects ordinary arrays.
The packing mode affects only the creation of procedures by the scanner
when it encounters program text bracketed by { }, during interpretation
of an executable file or string object; or during execution of the token
operator.
It does not affect the creation of literal arrays by the [ ] operators, or by
the array operator.
The array packing mode persists until it is overridden by another
execution of setpacking or is undone by restore.
Example:
systemdict/setpacking known
{/savepacking currentpacking def
true setpacking
} if
... arbitrary procedure definitions ...
systemdict/setpacking known [savepacking setpacking]
if
Errorsstackunderflow, typecheck
Printer Error Parameter2
The LaserWriter Select 310 printer has one parameter that allows you find out what has
caused an error condition, and how many times the printer has attempted to complete a
specific job.
38Setting Compatibility Operators
CHAPTER 2
LaserWriter Select 310 Software
printererror2
Syntaxstatus tries printererror –
DefinitionThis procedure is called during execution of showpage or copypage if
the printer mechanism reports an error such as out of paper, no paper
tray, paper jam, cover open, and so on.
status is an integer that encodes details of the error condition. It is device
dependent and is not documented in this developer note.
tries is the number of times printererror has previously been called
during the same showpage or copypage. If printererror returns,
the printed operation is retried. If it aborts, by executing stop, the
printing operation is abandoned.
Standard procedure: printererror interprets status and generates a
PrinterError status message. It then returns, allowing printer errors to be
retried indefinitely.
Errorstackoverflow
PostScript Language Changes2
Several additions have been made to the PostScript language, which is used by the
LaserWriter Select 310 printer , and by certain other PostScript printers. The additions are
upwardly compatible and do not affect the function of any existing PostScript language
programs.
Note
PostScript language programs that are intended to be compatible with all
PostScript printers should not use the new features. The program can
determine whether or not the new features are present, and it can invoke
them conditionally. ◆
The new features described in the following sections include:
■ packed arrays, which provide a means of cutting down on the amount of virtual
memory allocated for the storage of executable arrays
■ immediately evaluated name, a new kind of name token, that causes names in
procedures to become tightly bound to their values
■ a different kind of operation for the font cache
■ a new general sampling and halftoning technique that allows a larger class of sampled
images to be transferred from a binary source image to the raster output device
■ a different method of handling end-of-line recognition
This section also lists the new operators used in the LaserWriter Select 310 printer.
PostScript Language Changes39
CHAPTER 2
LaserWriter Select 310 Software
Packed Arrays2
PostScript language procedures are represented as executable arrays, which were
previously stored in the same fashion as literal data arrays. This type of representation
offers maximum flexibility but is very costly in terms of space, requiring 8 bytes per
element. Large PostScript Language programs, such as the built-in server program, and
downloaded preambles, consume considerable amounts of virtual memory.
Programs do not require the ability to be treated as data, but only the ability to be
executed. The packed array fulfils this requirement. Programs represented as packed
arrays are typically 50% to 70% smaller than programs represented as ordinary arrays.
Packed Arrays Versus Ordinary Arrays2
The packed array object has a type different from an ordinary array, using
packedarraytype instead of arraytype. However, in most respects it behaves
in the same way. You can
■ extract elements using get
■ extract subarrays using getinterval
■ enumerate the array using forall
Individual elements extracted from a packed array are ordinary PostScript language
objects. A sub-array of a packed array is also a packed array.
Packed arrays are different from ordinary arrays in the following ways:
■ packed arrays are always read only; you cannot use put or putinterval to store
into one
■ packed arrays are cr eated dif fer ently; (see the section below, “Cr eating Packed Arrays”)
■ accessing arbitrary elements of a packed array can be quite a slow process; however,
accessing elements sequentially, as the PostScript interpreter and the forall operator
do, is almost as efficient as accessing an ordinary array
■ the copy operator cannot copy into a packed array, since the array is read only.
However, it can copy the value of a packed array to an ordinary array that is at least as
long as the packed array
Creating Packed Arrays2
Packed arrays may be created in two ways. The first and more common way is for the
PostScript interpreter’s input scanner to create packed arrays automatically for all
executable arrays that it reads. This means that whenever the scanner encounters a {
while reading a file or string, it accumulates all tokens up to the matching } and turns
them into a packed array instead of an ordinary array.
The choice of array type is controlled by a mode setting, manipulated by the new
operators, setpacking and currentpacking. (See “Setting Extensions to PostScript
Level 1,” earlier in this chapter.) If the array packing mode is true, PostScript language
procedures encountered subsequently by the scanner are created as packed arrays. If the
mode is false, procedures are created as ordinary arrays. The default value is false
to preserve compatibility with existing programs.
40PostScript Language Changes
CHAPTER 2
▲
LaserWriter Select 310 Software
The second way to create a packed array is to build it explicitly by invoking the
packedarray operator with a list of operands to be incorporated into a new
packed array.
Immediately Evaluated Names2
The PostScript language syntax has been extended to include a new kind of name token,
the immediately evaluated name. When the scanner encounters the token //name,
(a name preceded by two slashes with no intervening spaces), it immediately looks up
the name in the context of the current dictionary stack and substitutes the corresponding
value for the name. If the name is not found, an undefined error occurs.
The substitution occurs immediately, regardless of whether or not the token appears
inside an executable array delimited by {...}.
Note
This process is a substitution and not an execution. This means the
name’s value is not executed but is substituted for the name itself, just
as if the load operator had been applied to the name. ◆
This substitution is related to the action performed by the bind operator. See the
PostScript Language Reference Manual for further information. However, while bind
substitutes only for those names with values that are operators, each occurrence of
the //name syntax is replaced by the value associated with name, regardless of the
value’s type. The following examples illustrate this.
Using immediately evaluated names serves a similar purpose to using the bind
operator. That is, it causes names in procedures to be tightly bound to their values.
WARNING
Indiscriminate use of immediately evaluated
names may change the semantics of a program. ▲
Specifically, when the interpreter encounters a procedure object directly, it simply pushes
it onto the operand stack. When it encounters an object indirectly, by looking up an
executable name, it executes the procedure. Therefore, execution of the program
fragments {...b...} and {...//b...} may have different effects if the name of b is a
procedure. See Section 3.6 of the PostScript Language Reference Manual, second edition, for
further information.
The immediately evaluated name facility is present in all versions of the PostScript
interpreter since version 25.0. Earlier versions of the interpreter will scan //name as two
distinct tokens: / as a literal name with no text at all, and /name as a literal name with
the text name.
PostScript Language Changes41
CHAPTER 2
LaserWriter Select 310 Software
Changes in Font Cache Operation2
Operation of the font cache has changed in the LaserWriter Select 310 printer. Formerly,
there was a single limit on the number of bytes occupied by a character in the cache. Any
character larger than the space allocated would not be cached. Now there are two cache
thresholds, a lower and an upper threshold. The following cache conditions apply:
■ if the character is larger than the space allocated by the upper thr eshold, as determined
by the bounding box specified to setcachedevice, the character will not be cached
■ if the character is larger than the lower threshold, it will be compressed and cached
■ if the character is not larger than the lower threshold, it will be stored as a full
pixel array
The two thresholds are manipulated by the new operators setcacheparams and
currentcacheparams. These operators are described in detail earlier in this chapter, in
the section “Setting Extensions to PostScript Level 1.” The old operators, cachestatus
and setcachelimit, remain valid, although they will rarely be used.
Compressed characters consume much less space in the font cache than the full pixel
arrays, by factors of up to 40. However, more computation is required to reconstitute
them when they are needed. Reconstituting a compressed character is still considerably
faster than re-executing the original character description.
In systems such as the LaserWriter Select 310 printer which prints at 300 pixels per inch
(dpi) or less, the default lower threshold is set so that characters up to about 20 points
are stored as full pixel arrays, while larger ones are stored in compressed form. This
means that ordinary body text may be cached using the time-efficient full pixel
array representation, but large characters will be cached using space-ef ficient compressed
representation.
Device Resolution Images2
A lar ge class of sampled images is now transferred directly from a binary source image to
the raster output device rather than using the more general sampling and halftoning
technique. The conditions for the image operator’s fast case are now as follows:
■ The image is one bit per sample.
■ Image and device resolutions are the same. This means that the combination of
the image matrix and the current transformation matrix is such that one unit in image
space corresponds to one unit in device space.
■ The image coordinate systems x and y axes are either parallel to or perpendicular
to the corresponding axes of the device space. This expands the fast case to include
rotations of 0, 90, 180 and 270 degrees, as well as their x and y reflections, to provide a
total of eight different image orientations, instead of the two previously allowed.
If an image that meets the above conditions on the LaserWriter Select 310 printer is
printed on an earlier PostScript printer, it may be treated as a general image. In this case,
the earlier printer may process the image more slowly than the LaserWriter Select 310
printer, but the results will still be correct, preserving the device independence of the
PostScript language page descriptions.
42PostScript Language Changes
CHAPTER 2
LaserWriter Select 310 Software
End-of-Line Recognition2
In PostScript interpreter versions 40.0 and later, the scanner and the readline operator
recognize all three external forms of end of line (LF alone, CR alone, and CR LF pair) and
treat them uniformly. The PostScript interpreter does not translate data read or written by
any other means.
In the LaserWriter Select 310 printer, end-of-line (EOL) translation occurs at two levels: in
the PostScript interpreter and in the serial communication channel. This section deals
only with the EOL conventions at the level of the PostScript interpreter. The translation
performed by the communication handler is described in Chapter 3, “Communication
Channels.”
The LaserWriter 310 Select printer supports translation by the communication channel to
maintain compatibility with diverse host operating systems and communications
environments. For instance, always sending CR LF for EOL permits use with operating
systems that treat CR alone or LF alone as EOL characters, provided they strip out the
redundant character. In addition, the CR LF convention is essential for use with directly
connected terminals.
The new rules for end-of-line recognition at the level of the PostScript interpreter have
the following consequences.
1. Any of the three forms of EOL appearing in a string are treated as a single newline
(LF) character. For example:
(any text<CR>some more text)
(any text<LF>some more text)
(any text<CR><LF>some more text)
The above examples produce identical string objects, each of which has a single
newline (LF) character separating text and some.
2. Any three forms of EOL appearing immediate after \ in a string are treated as a
continuation. This means that both the \ and the EOL are discarded:
(any text\<CR>some more text)
(any text\<LF>some more text)
(any text\<CR><LF>some more text)
The above examples produce identical string objects.
3. Any of the three forms of EOL appearing outside a string are treated as a single whitespace character. Since the language treats multiple white-space characters in the same
way as a single white-space character, the treatment of EOL is interesting only when a
PostScript language token is followed by data to be read explicitly by one of the file
operators:
The above examples produce identical results. The read operator reads the character x
from the current input files and leaves its character code (an integer) on the stack.
4. The readline operator treats any of the three forms of EOL as the termination
condition.
PostScript Language Changes43
CHAPTER 2
LaserWriter Select 310 Software
5. Data read by read and readstring undergoes no EOL translation. Whatever
characters were received from the channel are read by the PostScript interpreter.
However, the channel itself may be performing some EOL translation. For example,
the serial and parallel channels on the LaserWriter Select 310 printer may affect the
input data, as described in Table 3-3, in Chapter 3, “Communication Channels.”
6. Data written by write and writestring undergoes no EOL translation. Whatever
characters were provided by the PostScript interpreter are sent to the channel. The
newline character, represented by \n in a PostScript language string object, is sent
as LF.
New Operators2
The following operators have been added to support LaserWriter Select 310 printer
functions. These operators are described in an earlier section of this chapter, “Setting
Extensions to PostScript Level 1.”
■ currentcacheparams
■ currentpacking
■ packed array
■ setcacheparams
■ setpacking
Tr ueType Fonts2
The LaserWriter Select 310 printer is a Class C device, and does not support the TrueType
format. However, the printer does follow the Adobe Systems, Incorporated, Type 1 font
format specification, which is described in “Adobe Type 1 Font Format,” published by
Addison-Wesley.
44TrueType Fonts
Figure 3-0
Listing 3-0
Table 3-0
CHAPTER 3
Communication Channels3
CHAPTER 3
Communication Channels
The LaserWriter Select 310 printer has two communication ports that support
two communication channels. One port is the RS-232 serial port used for serial
communication. The other is the Centronics parallel port used to connect the LaserWriter
Select 310 printer to an IBM-PC compatible computer. The section “Communication
Ports,” in Chapter 1, describes the physical characteristics of the connectors. This chapter
deals with the software support for the serial and parallel communication channels.
Serial Communication3
When the LaserWriter Select 310 printer is in serial mode, it uses the RS-232 port to send
data and receive data encoded in ASCII. Certain characters serve special purposes. For
example, Control-D marks the end of the file, and Return indicates end of line. The server
performs a job by reading and executing a PostScript program from the serial port. When
it reads the end-of-file character and the program terminates, the server sends an
end-of-file character, ends the job, and starts a new one.
Three parameters control the details of serial communication. They are channel, baud
rate, and options. These parameters may be changed by invoking the statusdict
operator setsccbatch. Serial communication is asynchronous, start-stop, and uses
7 or 8 bits per character. The 8-pin serial connector is designated as a channel in the
PostScript interpreter by the integer 9. Table 3-1 summarizes the default settings for the
LaserWriter Select 310 printer serial communication channel.
Table 3-1Default settings for the serial communication channel parameters
ParameterDefault settingsOther settings
Data bits87
Parity NoneNone
Stop bitsOne–
Flow controlDTRXON/XOFF
Baud rate57600Any baud rate that divides into 115200 with a
quotient of two or more
ProtocolBinarySimple
Baud Rates3
The baud rate is given as an integer, such as 1200 or 9600. The baud-rate parameter
may be any positive integer less than 100000. However, the hardware can only achieve
certain baud rates, and other values are rounded to the nearest achievable rate. Below
57600 baud, the achievable rates are 9600, 10473, 11520, 12800, 14400, 16457, 19200, 23040,
28800, and 38400. Any baud rate that divides into 115200 with a quotient of two or more
is legal. The Macintosh host computer supports a 57600 baud rate. Host systems other
than the Macintosh are most likely to support a 19200 baud rate.
46Serial Communication
CHAPTER 3
Communication Channels
Parity Settings3
The parity settings for the serial channel may be odd, even, space, or mark. Table 3-2
indicates how the parity setting and number of data bits work together.
Table 3-2Data and parity choices for the LaserWriter Select 310 printer
Data bitsParityDescription
StandardSpace8 bits are sent. The 8th bit transmitted is zero, and
the 8th bit received is ignored.
Standard Odd or even8 bits are sent. The 8th bit is used for parity.
Standard Mark8 bits are sent and received. The parity bit is not stripped.
Since the PostScript interpreter expects ASCII data (high
bit zero), a host sending mark parity data will not be
understood, and you should select 7-bit mode in which
the parity bit is stripped.
7 bitsSpace7 data bits are sent. A zero is added.
7 bitsOdd or even7 data bits are sent. A parity bit is added to the 7 data
bits in either odd or even parity, depending on the parity
setting.
7 bits Mark7 data bits are sent. A one is added.
8 bits Space8 bits are sent.
8 bitsOdd or even8 bits are sent. A parity bit is added to the 8 bits in either
odd or even parity, depending on the parity setting.
8 bitsMark8 bits are sent.
NOTE Parity is checked on received characters only when the parity setting is even or odd. If a
parity error is detected the PostScript interpreter generates an ioerror.
Flow Control3
The LaserWriter Select 310 printer uses one of two conventions for controlling the flow of
characters to and from the host computer. These conventions are DTR and XON/XOFF. If
the host fails to conform to the selected flow control protocol, unexpected occurrences of
ioerror may result.
DTR Flow Control3
DTR flow control uses the Data Terminal Ready control signal. Normally, the printer
leaves this signal turned on. However, when it needs to stop the flow of characters from
the host, it turns DTR off. The host must then immediately stop sending characters
until the printer turns DTR back on again. Similarly, another signal, Data Set Read (DSR)
may be used by the host to control the flow of data sent to it from the printer. Packet DTR
is an implementation of DTR flow control specifically set and used by the Apple
LaserWriter driver. It uses the DSR signal to control the flow of data sent to the host in
packets of three characters at a time.
Serial Communication47
CHAPTER 3
Communication Channels
XON/XOFF Flow Control3
XON/XOFF flow control uses two special characters, XON and XOFF, that may be sent
either to the printer or to the host to control the flow of characters. When the LaserWriter
Select 310 printer sends an XOFF character to the host, the host must immediately stop
sending characters to the printer. When the printer sends XON to the host, the host may
start sending characters again.
SCC Operator Encoding3
The serial communications parameters are set by setsccbatch, a 1-byte options
argument that holds four SCC encoded parameters: stop bits, data bits, flow control, and
parity. The argument is an integer parameter with values in the range 0–255. The bits are
assigned to different fields, as shown in Table 3-3, with the most significant bit
representing the field stop bits, and so on. Table 3-3 lists the proper field value for each
setting. You may determine the value of the options integer by simply selecting one
decimal value for each field and adding those decimal integers together.
Figure 3-1 shows an example of SCC operator encoding for an 8-pin serial port, using
standard data bits with even parity, one stop bit, and XON/XOFF flow control.
In PostScript Level 1, the data bits and parity bit interact in a nonorthogonal way, to
produce a table of possible choices for data and parity, as shown in Table 3-2. The choices
include many commonly required methods of sending data. The Standard data bits
setting provides compatibility with earlier versions of the PostScript Level 1.
Number of
data bits
ParitySpace
Standard
7 bits
8 bits
Undefined
DTR
Undefined
Odd
Even
Mark
0
128
0
32
64
96
0
4
8, 12, 16, 29,
24, 28
0
1
2
3
0
1
0
1
2
3
0
1
2, 3, 4, 5, 6, 7
0
1
2
3
48SCC Operator Encoding
CHAPTER 3
Communication Channels
Figure 3-1SCC operator encoding
Example
9 19200 2 setsccbatch
sum of decimal values :
Feature Description Decimal value
ParityEven 2
Flow controlXON/XOFF 0
Data bitsStandard 0
Stop bits10
baud rate: 19200
channel type: 8-pin serial
Communication Protocols 3
The LaserWriter Select 310 printer supports both simple and binary communication
protocols for serial and parallel channels. Several character codes in both protocols are
reserved for communication functions and are not passed through the PostScript
interpreter. The default protocol is binary. The section “Setting Device Parameters,”
“setsoftwareiomode,” in Chapter 2, describes how to change the default protocol
from binary to simple.
Simple Communication Protocol3
Table 3-4 lists the character codes reserved for communication functions in the simple
communication protocol. The ASCII character codes are given in decimal.
Table 3-4Reserved characters in simple communication protocol
Character
Control-C3Interrupt. Causes execution of the PostScript language
Control-D4End of file.
ASCII
codeFunction
interrupt error. See the PostScript Language Reference
Manual, Chapter 6, for further information on interrupt.
Control-S19Stop output (XOFF). Functional only if XON/XOFF flow
control is in use.
continued
Communication Protocols49
CHAPTER 3
Communication Channels
Table 3-4Reserved characters in simple communication protocol (continued)
Character
ASCII
codeFunction
Control-Q17Start output (XON). Function only if XON/XOFF flow control
is in use.
Control-T20Status query. Causes the server to produce a one-line message
that describes what the server is doing.
Return13End of line. Translated to the PostScript language newline
character.
Line-feed10End of line. This is the PostScript language newline character.
If a return and a line-feed are received in sequence, only one
newline character is passed to the PostScript interpreter.
When a newline character is written to the standard output
file, it is translated to the two-character sequence: return and
line-feed.
The serial and parallel communication handlers perform the special processing of the
return and line-feed characters, as described in Table 3-4. This processing is independent
of the return and line-feed handling performed by the PostScript interpreter itself. Unlike
the processing done at the level of the PostScript interpreter, this processing is done
regardless of how the data is to be treated by the interpreter.
With the simple pr otocol, there is no way to ‘quote’ the reserved characters, that is to pass
them through to the PostScript interpreter. Nor is there any way to transmit characters in
the 'high ASCII' range (128–255) when using parity settings 0, 1, and 2, which cause the
high-order bit of each character to be ignored or used for parity. Therefore, with this
protocol, the communication link is not fully transparent. This causes no difficult in
normal use, however, since the standard PostScript language character set consists
entirely of printable characters. The language itself provides means for encoding
arbitrary characters in strings (the ‘\nnn’ escape sequence).
When the server encounters an end-of-file character and the job terminates, the server
sends an end-of-file character back to the host. This character marks the end of the data
(if any) written to the standard output file while the job was being executed. This enables
the application program running on the host computer to synchronize with the server, if
this is desired, and to correlate a given output batch with the job that generated it.
Binary Communication Protocol3
As an alternate to the simple protocol, the LaserWriter Select 310 printer supports binary
protocol for both the serial and parallel channels. Binary protocol allows all character
codes to be transmitted as data, but also allows certain characters to be used for
specifying control functions, which may be handled asynchronously by the
communications driver. These functions include status requests, aborting of jobs,
end-of-job markers, and flow control for the serial channel.
50Communication Protocols
CHAPTER 3
Communication Channels
Since any character code can be transmitted as data with this protocol, it can be used for
sending PostScript language jobs that contain binary images. Binary protocol is set by
default when the LaserWriter Select 310 printer is powered on. It may also be selected by
setting softwareiomode to 100.
This protocol requires that a quoting character be inserted at certain places in the data
stream and that the character codes for certain characters be altered. Therefore, the host
computer must filter binary data before sending it to the printer. When the protocol is
enabled, it is used for transmission in both directions. The host should therefore filter any
data it receives from the printer. Filtering may be done by an application program or
within the operating system of the host. In the case of the LaserWriter Select 310 printer,
the Apple LaserWriter driver does this filtering. Table 3-5 lists the control characters for
the binary serial protocol.
Table 3-5Control characters in binary serial protocol
Hex valueASCII nameASCII keyboardControl function
01SOHCTL-AQuote data byte
03ETXCTL-CAbort job and flush to end of file
04EOTCTL-DEnd-of-job marker
05ENQCTL-ENone
11DC1CTL-QXON in XON/XOFF flow control
13DC3CTL-SXOFF in XON/XOFF flow control
14DC4CTL-TRequest printer status
1CFSCTL-\None
To transmit the control characters as data, the characters must be quoted. This means that
the character being sent is replaced by a two-character sequence consisting of control
character CTL-A, which indicates a quoted data byte, followed by the character itself
XORed with 40 hex. For example, if the host wants to send a request for printer status
(hex value 14), it sends 01 hex-54.
This method of quoting means that whenever one of the eight special characters is
received, the control function is intended, regardless of whether or not the preceding
character is CTL-A. Asynchronous control characters may therefore be generated and
processed at a lower level than the data stream may be generated and consumed. On a
host machine, the user program may implement the CTL-A quoting convention, while
the operating system is independently performing XON/XOFF processing.
Note
All byte values other than those of the eight special
characters are transmitted by simply sending the value. ◆
Communication Protocols51
CHAPTER 3
Communication Channels
After CTL-A is received, the next character received that is not one of the special
characters must be the result of XORing one of the special characters with 40 hex. If any
other character is received, it is considered to be an input error. Any number of special
characters may appear between CTL-A and the XORed character, with the exception of
special characters CTRL-D and CTRL-A, which are handled asynchronously. If either of
these characters is received between CTL-A and the XORed character, it is considered to
be an error condition.
If a special character arrives unquoted and it specifies no control function for the channel,
the character is simply discarded. For example, if XON or XOFF is received
and XON/XOFF flow control is not in use, it is discarded.
IMPORTANT
CTL-E and CTL-\ currently specify no control functions and should
not be sent to the LaserWriter Select 310 printer. They are included in the
list of quoted characters in case new control functions are added in
the future.
In contrast to simple protocol, with binary protocol there is no mapping between
end-of-line conventions. The end-of-line characters (<CR>, <LF>, or <CR><LF>) sent by
the host are exactly what is received by the interpreter in the printer. The PostScript
scanner handles the different end-of-line conventions in a uniform way, but a program
that reads data from the channel directly (via read or readstring) receives whatever
characters are sent by the host. Similarly, output is generated by a PostScript program
(via print or =) is sent unchanged.
▲
Note
In this connection, the standard end-of-line in the PostScript
language (\n in a PostScript language string) is <LF>. ◆
Communicating with an IBM PC3
You may connect the LaserWriter Select 310 printer to an IBM PC through either the
Centronics 36-pin parallel connector or the RS-232 serial port. The physical characteristics
of the connectors are described in Chapter 1, in the sections “Centronics Parallel
Connector” and “Serial Port for RS-232C Devices.” This section describes the software
support for the interface.
Parallel Interface3
To set up the parallel port for communication between the LaserWriter Select 310 and the
IBM PC, issue the following command:
MODE LPT1:,,P
This command allows the Centronics busy signal to be active for extended periods
of time.
52Communicating with an IBM PC
CHAPTER 3
Communication Channels
Unlike the serial port, the Centronics parallel input allows no parameters. It always
accepts 8-bit data with no parity, and it reserves the same set of characters for communication functions that the serial port reserves, with the exception of XON/XOFF
characters, which are passed through the PostScript interpreter, since flow control is
maintained by means of the /BUSY signal.
The Centronics parallel interface is essentially an input-only channel. This means it
basically transfers information from the host to the printer. However, the PostScript
interpreter always deals with both the input and output sides of an I/O channel.
When operating in Centronics parallel input mode, the printer sets up the 8-pin serial
port for the PostScript language print operator. The output from this port may be ignored
for simple one-way communication. However, important information may be output via
this port. Printer errors are always reported, since the Paper Error signal on the
Centronics interface cannot be relied upon to report all printer errors. Table 3-6
summarizes the settings for the serial communications port when it is used as the output
port during parallel communication.
Table 3-6Settings for the serial output channel during parallel communication
You may also use the serial port as an alternative means of communicating with the
IBM PC, using either DTR or XON/XOFF flow control. DTR flow control is preferred,
since this is the default serial flow control for the LaserWriter Select 310 printer.
DTR Flow Control for PC Communication3
To set up the LaserWriter Select 310 printer for serial interface with the IBM PC over
the serial port using DTR flow control, issue the following MS-DOS commands to
your computer:
MODE COM1:19200,N,8,1,P
MODE LPT1:=COM1:
Communicating with an IBM PC53
CHAPTER 3
Communication Channels
XON/XOFF Flow Control for PC Communication3
To set up the LaserWriter Select 310 printer for serial interface with the IBM PC over the
serial port using XON/XOFF flow control at 19200 baud, issue the following MS-DOS
commands to your computer:
MODE COM1:19200,N,8,1
MODE LPT1:=COM1:
These commands alone are not sufficient to handle XON/XOFF flow control. Some
applications may handle this protocol themselves. Otherwise, you should install a
different MS-DOS printer driver to avoid communication problems when printing large
documents.
Note
You must issue these commands to your IBM PC whenever the computer
is turned on. Alternatively, you may place them in
the AUTOEXEC.BAT file on your MS-DOS disk.
The LaserWriter Select 310 printer comes from the factory with its serial port configured
for option 68: 8-bit data, no parity, DTR flow control, with 57600 baud. If you need to set
up the printer for XON/XOFF communication at 19200 baud, send the following routine
to the printer from the host, using either the parallel port, or the serial port at 57600 baud.
◆
serverdict begin 0 exitserver
statusdict begin
9sccbatch 0 eq exch 19200 eq and not
{9 19200 0 setsccbatch} if
end stop
This routine tests the current values of the sccbatch parameters (see Chapter 2), and if
they are not set for 19200 baud and option 0, it sets these values using setsccbatch.
Note
These changes are not permanently stored, since the LaserWriter Select
310 printer has no EEROM. They will not persist across power cycles.
You should send this sequence each time the printer is turned on or
whenever the serial communication parameters have been changed. ◆
Communication Dynamics3
Data transmitted by the LaserWriter Select 310 printer, whether it is generated by
executing the PostScript language program or by some other spontaneous event such
as an error, is logically asynchronous with respect to the data received. This means that
the host computer must be prepared to consume data received from the LaserWriter
Select 310 printer while waiting to send more data to the printer. If the host computer is
not set up to do this, the printer and the host may each wait for the other to consume
data, and a deadlock will occur.
54Communication Dynamics
CHAPTER 3
Communication Channels
Typically, characters written to the standard output file by PostScript operators, such as
print, are not sent immediately. They are buffered until a flush is executed. A flush
occurs automatically
■ at the end of a job
■ in interactive mode, whenever the user is prompted to make an entry
If a PostScript language program writes data that is needed immediately by the host, for
example a reply to an environmental query, it is important to flush after writing the data.
Otherwise, a deadlock may occur.
Status Queries and Spontaneous Messages3
The LaserWriter Select 310 printer provides a status query facility that enables the host or
user to determine what the printer is doing. The printer responds to a status query
asynchronously with respect to normal job execution. That is, it sends a response
immediately, regardless of what has gone on before, or how much input data has been
buffered. This facility primarily enables spoolers (printer control programs) to track the
activities of the LaserWriter Select 310 printers under their control.
If the printer receives a CTL-T character from the active input channel, it replies with a
one-line status message over the active port’s output channel. The message is bracketed
by the text sequences %%[ and ]%%, to enable the host software to extract the message
from the ordinary data generated by the job being executed.
The status message has standardized syntax that is intended to be machine readable. It
consists of one or more key, value pairs separated by semicolons. For example:
%%[job: Jane's report; status: busy; source: serial 9]%%
The possible keys, values, and meanings are as follows:
jobThe name of the job is stored as jobname entry in statusdict. (See
Chapter 2.) This field is omitted if the current job has not defined jobname.
statusIndicates what the printer is currently doing:
■ idle indicates there is no job in progress
■ busy means the printer is executing the user’s PostScript
language program
■ waiting means that the I/O is waiting in the middle of a job
■ printing indicates that the printer is printing, and that paper is
in motion
■ PrinterError: reason means that there is a printer error such as a
paper jam or printer out of paper.
■ initializing indicates the printer is starting up
sourceserial 9 or Centronics indicates the source of the job that the server is
currently executing. This field is omitted if the server is idle.
Status Queries and Spontaneous Messages55
CHAPTER 3
Communication Channels
All messages generated spontaneously by the server (as opposed to those messages
produced when the PostScript language program executes print) conform to the same
syntax as status messages. They are sent as ordinary data through the communication
channel, in sequence with any other characters written to the standard output file.
Consequently, they are always bracketed with %%[ and ]%% for either serial or parallel
channels:
%%[Error:error; OffendingCommand: operator ]%%
An error has been detected by the PostScript interpreter and the standard
error handle (handleerror) has been invoked.
error is the name of the error operator originally invoked operator is the
operator or other PostScript object being executed at the time of the error
Refer to the PostScript Language Reference Manual for further information on
error handling.
%%[PrinterError:reason]%%
A pr oblem has been r eported by the printer mechanism. The type of pr oblem
is indicated by reason: no paper, no paper tray, paper jam,
cover open, etc.
A printer error can only occur during execution of showpage or copypage,
that is when the printer is actually trying to print a page. After generating
this message, the server usually waits for the condition to be corrected and
then continues printing automatically.
The server’s behavior when it encounters a printer error is controlled by the
printererror procedure described in Chapter 3.
%%[Flushing: rest of job (to end-of-file) will be ignored ]%%
Because of a previous error or abort condition, for example stop or CTL-C
interrupt, the remainder of the current job is being discarded. The server
reads and discards characters from the standard input file until it receives an
end-of-file indication.
%%[exit server: permanent state may be changed ]%%
The PostScript language program has successfully exited from the server’s
normal save/restore context, and may now make permanent changes to
the system parameters or to the virtual memory. See Chapter 3.
56Status Queries and Spontaneous Messages
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.