Printing Speed: Letter Quality Printing takes 100 characters per second Draft Quality Printing takes 0 up to 300 characters per second
Resolution: HP is for high-resolution graphics machines
Buffer: This is the built-in expandable buffer
Character Sets: the printer supports an entire range for printing including eleven languages
Typestyles: there are multiple choices available
Operation: Easy operation from the front panel
Paper Handling: there is Automatic paper Feed
Compatibility: it is compatible with popular personal computers and software packages.
Frequently Asked Questions
What is the printing technology used in the NB-15 printer? The NB-15 printer dot matrix prints.
How many pins does the print head have: The print head contains 24 pins.
What are the printing speeds of the NB-15 printer? The speeds are 100 characters per second Letter Quality and 300 c per second Draft Quality or faster.
Does the printer support multiple languages? yes, an entire range of character set is supported by the printer for eleven languages
Is the NB-15 printer easy to use? yes, so when it comes to users convenience, it features easy front panel operation.
Q: Is paper fed into the machine automatically?
A: The automatic paper feed option is indeed included in the printer.
Q: Is the NB-15 printer computer system independent?
A: Most widely used computer systems and software applications are fully supported with this device.
User Manual
USER’S MANUAli
h
NOT INTENDED FOR SALE
-___ --.-. -
PN 80821206
.-_.
Federal Communications Commission
Radio Fre 3 uency Interference
This equipment generates and uses radio frequency energy and if not installed and used
properly, that is, in strict accordance with the manufacturer’s instructions, may cause interference to radio and television reception. It has been type tested and found to comply
with the limits for a Class B computing device in accordance with the specifications in
Subpart J of Part 15 of FCC Rules! which are designed to provide reasonable protection
against such interference in a residential installation. However, there is no guarantee
that interference will not occur in a particular installation. If this equipment does cause
interference to radio or television reception, which can be determined by turning the
equipment off and on, the user is encouraged to try to correct the interference by one or
more of the following measures:
0 Reorient the receiving antenna
0 Relocate the computer with respect to the receiver
0 Move the computer away from the receiver
0 Plug the computer into a different outlet so that computer and receiver are on dif-
ferent branch circuits.
If necessary, the user should consult the dealer or an experienced radio/television technician for additional suggestions. The user may find the following booklet, prepared by
the Federal Communications Commission helpful: “How to Identify and Resolve RadioTV Interference Problems.” This booklet is available from the U.S. Government
Printing Office, Washington, D..C., 20402, Stock No. 004-000-00345-4.
For compliance with Federal Noise Interference Standard, this equipment requires a
shielded cable.
This statement will be applied only for the printers marketed in U.S.A.
Radio interferences regarding this equipment has been eliminated according to Vfg
lOr6/1984 announced by the DBP.
DBP has been informed about the introduction of this special equipment and has been
conceded the right to examine the whole series.
It is upon the responsibility of the user to assume that his own assembled system is in accordance with the technical regulations under Vfg 1046/1984.
To observe FTZ-regulations it is necessary, to establish all connections to the printer
with shielded cable.
The equipment may only be opened by qualified service representatives.
This statement will be applied only for the printers marketed in West Germany.
tatement
Self Declaration
--
Trademark Acknowledgement
NB-15
Apple,
Commodore C-64: Commodore usmess Machmes, Inc.
Corn aq: Compaq Computer Corporation
CP/& Digital Research
EasyWriter: Information Unlimited Software, Inc.
IBM Personal Computer, IBM PC: International Business Machines Corp.
Kaypro: Kay
Microsoft B
Osborne 1: Osborne Computer Corporation
WordStar: MicroPro International Corporation
TRS-80: Radio Shack, a division of Tandy Corporation
SuperCalc: Sorcim Corporation
NOTICE
rafstar: Star Micronics Co., Ltd.
*‘f
pple ll , Apple II+, A ple ll e, Applesoft: Apple computer Inc.
ro Corporation
R SIC: Microsoft Corporation
l Al1 rights reserved. Reproduction of any part of this manual in any form what-
soever, without STAR’S express permission is forbidden.
@The contents of this manual are subject to change without notice.
l Al1 efforts have been made to ensure the accuracy of the contents of this manual at
the time of going to press. However, should any errors be detected, STAR would
be greatly appreciate being informed of them.
l The above notwithstanding, STAR can assume no responsibility for any errors in
this manual.
8.
@Copyright 1986 Star Micronics Co., Ltd.
-
-
-
A Special Message
to the New Owner
Congratulations for choosing this printer, one of the finest
available at any price. Your new printer will reward you with
many years of high-quality document printing, and is backed by
Star Micronics’ more than 30 years in manufacturing precision
parts. You already know that it represents the state of the art in
tack-sharp dot matrix printing with its rugged 24-pin print head.
Its bidirectional, logic-seeking operation gives you Letter-Quality hardcopy at 100 characters per second, and draft-quality
print at speeds of up to 300 characters per second.
Its many features include:
l High-resolution graphics
l Built-in expandable buffer
l An entire range of character sets for printing in eleven
languages
l Choice of various typestyles
l Easy, front panel operation
l Automatic paper feed
And, best of all, your new printer is compatible with the most
popular personal computers and software packages-so no matter how sophisticated your applications become, it will continue
to meet your needs.
These are just a few of the reasons you chose a product by
Star Micronics, one of the most respected names in dot matrix
printers. We want you to get the most from your printer with
the least effort on your part, so please take a few minutes to
read this easy-to-understand guide. You’ll find that it will help
you produce crisp, clean documents in the shortest time possible.
You will also find that this printer is remarkably simple to set
up and operate, and that it’s virtually maintenance-free. Enjoy
your new Star Micronics printer!
Table of Contents
Chapter 1
Chapter 2
Chapter 3
Setting Up Your Printer
Where shall we put it?
What have we here?
Removing the printer cover
Removing the packing tube
Removing shipping screws
Installing the platen knob
Installing the ribbon cartridge
Installing the mute cover
Installing the interface board
Installing the font cartridge
Getting to Know Your Printer
Controls and parts of the printer
Parts of the printer
Controls and indicators
Extra functions
Other controls
Selecting and loading paper
Loading single sheets
Loading sprocket-feed paper
Adjusting the print head
Extra functions with the control panel
Self-tests
Hex dump
Panel modes
Setting print start position
Setting the top of form
Setting the left and right margins
Connecting the printer
Using Commercial Software
First, some terminology
Using your printer with SuperCalc
Using your printer with word processors
1
9
27
Chapter 4
Chapter 5
Chapter 6
Controlling with BASIC
Some basics about BASIC
First steps
Establishing communications
The CHR$ function
Control codes
The escape codes
A note on command syntax
Some problem codes
Printing Text
Some special kinds of text
Letter Quality characters
Characters in the Font Cartridge
Underlines and overlines
Boldface printing
Superscripts and subscripts
Changing the print pitch
Expanded print
Condensed print
Proportional printing
Mixing print modes
Formatting Text
Lines and line spacing
Starting a new line
Changing the line spacing
Moving down the page without a carriage
return
Page control
Form feed
Changing the page length
Bottom margin
Setting left and right margins
Horizontal and vertical tabs
Horizontal tabs
One-time horizontal tabs
Vertical tabs
Vertical tab channels
33
39
53
Chapter 7
Chapter 8
Special Features of the Printer
Now hear this
Resetting the printer
Putting your printer to sleep
Printing the bottom of the sheet
Backspace, delete, and cancel text
Immediate-print
Adjusting the width of space between
characters
Repeat characters
Uni-directional printing
The seven bit dilemma
Block graphics characters and special
symbols
International character sets
Printing BIG characters
The optional sheet feeder
Reading a hex dump
Creating Your Own Characters
Dot matrix printing
The print matrix
Defining your own characters
Rule 1: Dots cannot overlap
Rule 2: Each row is divided into three bytes
Assigning a value of character space
Assigning a value to your character
Download character definition command
Printing download characters
How to print the characters in control code
area
The print mode and the download characters
Draft download characters
Letter quality download characters
73
89
Chapter 9
Dot Graphics
Comparing dot graphics with download
characters
Using the dot graphics command
Specifying the number of columns of dots
Specifying the graphics data
Combining text and graphics
Printing a design or logo
Plotting with your printer
How the program works
Using the 24-pin graphics
mode
Compatibility with existing software
Redefining alternate graphics codes
107
Chapter 10
Caring for Your Printer
Cleaning the printer
Replacing the ribbon
--
Replacing the print head
Appendix A DIP Switch Settings
Switch functions
Appendix B
ASCII Codes and Conversion
Chart
Appendix C Function Codes
Commands to control print style
Font style controls
Font pitch controls
Special print modes
Controlling the vertical print position
Line feed controls
Form feed and related commands
Bottom margins and vertical tabs
Controlling the horizontal print position
Download character commands
Dot graphics commands
Other commands
Appendix D Command Summary in Numeric
Order
Appendix E Technical Specifications
Appendix F
The Parallel Interface
Functions of the Connector Signals
-
127
~~ ~, -- .-
133
139
147
191
195
199
Appendix G Serial Interface Specifications
Configuring the serial interface
The serial protocols
Serial busy protocols
XON/XOFF protocol
ACK protocol
203
Appendix H Connecting with Computer
Connecting with IBM-PC and Compaq
BASIC programming
Listing programs
Connecting with Apple II computers
Applesoft BASIC
Listing programs
Connecting with TRS-80 computers
TRS-80 BASIC
Listing programs
Connecting with Kaypro, Osborne, and other
CP/M computers
Using MBASIC
Listing programs
209
I
CHAPTER 1
SETTING UP YOUR
PRINTER
Subjects we’ll cover in Chapter 1 include-
. Choosing a suitable place for your printer;
l Unpacking your new printer;
l Setting it up.
WHERE SHALL WE PUT IT?
Before you do anything else, give some thought to where
you’ll be using your printer. Obviously, it will be somewhere
near your computer. And both printer and computer will lead
longer, healthier lives if they like their surroundings. For instance, we recommend. . .
l Using the printer on a flat surface.
l Keeping it out of direct sunlight and away from heat-
producing appliance.
l Using it only in temperatures where you are comfortable.
l Avoiding locations with a lot of dust, grease, or humidity.
l Giving it “clean” electricity. Don’t connect it to the same
circuit used by large, noise-producing appliances (such as
refrigerators).
l Making sure the line voltage is within 10% of the voltage
specified on the identification plate.
WHAT HAVE WE HERE?
Let’s open the carton and take a look at what’s inside. Check
each item in the box against Figure l-l to make sure that you
have everything (there should be six items).
igure
2) Mute cover, 3) Paper guide, 4) Platen knob, 5) Ribbon cartridge,
and 6) User’s manual.
l-l. Check to make sure you have all six items: 1) Printer,
You should also have a parallel interface board to connect
your computer to the printer. Also available are a parallel interface board with extra buffer memory and a serial interface
board, both optional. (More on the interfaces later.)
l Removing the printer cover
The printer’s cover is important for two reasons - it keeps
dust and dirt away from the printer’s delicate mechanism, and it
absorbs nearly all of the printer’s operating sounds. Don’t take
off the cover unless you have to change the ribbon or make an
adjustment.
Removing the printer cover is easy. Lift up the back of the
cover to disengage the three tabs at the front then lift it off the
rest of the way. To replace the cover, just slide the tabs in at the
front and lower it into place. Figure 1-2 shows the proper posi-
-
-J
tion and movement for both removing and replacing the cover.
I
Figure l-2.
Remove the printer cover by lifting carefully.
n Removing the packing tube
The printer is shipped with a protective spiral tube to keep
the print head from being damaged during shipping. We have to
remove this tube. First, take off the printer cover. See the tube
on the carriage rail (Figure l-3). Pull it off carefully.
I
3
Figure 1-3. Remove the protective tube from the carriage rail.
n Removing shipping screws
There are two shipping screws inside the printer, used to hold
the internal chassis securely to the lower case during shipping.
4
To get at these, remove the printer cover from the printer. Then
remove the screws with a Phillips screwdriver as shown in
Figure l-4.
You’ll be smart to save these screws, along with the rest of
the packing material and the shipping carton, in case you ever
have to ship the printer. Tape the screws somewhere on the carton or packing.
Figure 1-4. There are two shipping screws inside the printer, dur-
ing shipping. They should be removed before use.
n Installing the platen knob
This is the knob that turns the rubber platen cylinder. It fits
into the hole in the right side of the printer case. Look at the
hole in the knob. See the flat side of the hole? Match the flat surface in the knob with the flat side of the shaft, and press the
knob onto the shaft firmly. Turn the knob a few times to make
sure that the platen rotates smoothly and easily.
n Installing the ribbon cartridge
This printer uses a neat, easy-to-change ribbon cartridge so
you don’t have to spend a lot of time threading a ribbon. And getting your hands all dirty to boot.
Telling you how to put in a ribbon is like explaining how to tie
your shoelaces -
it takes a lot longer to tell than to do. You can
just follow the illustrations if you wish; they’ll tell you all you
really need to know.
Or, if you feel better following written instructions, read on.
L
Figure 1-5.
snap into place.
1. Turn off the power and remove the printer cover.
2. Now slide the print head gently to the center of the
printer.
Warning: The print head gets hot during operation, so
let it cool off before you touch it.
Print head
Press the cartridge into place until the holding springs
Figure 1-6.
manually to your right or left, then the ribbon slips down by itself into
its proper position.
All you have to do is to slide the print head carriage
6
3. Using the guide holders as a fulcrum with the ribbon facing away from you, as shown in Figure 1-5, lightly press
the cartridge down until the two holder springs snap shut
to hold the cartridge firmly in place.
4. Check that the cartridge fits so that the drive pins engage
the cartridge teeth.
5. Gently slide the print head carriage manually all the way
to your right or left until the ribbon automatically slips
down into its proper place between the print head and the
silver ribbon guide.
6. Put the printer cover back on and you’re finished. (A
special switch on the printer prevents the printer from
working when the cover is off.)
n Installing the mute cover
The mute cover reduces the printer’s operating sounds.
Mounting the mute cover onto the printer cover is easy.
Note the position of the guide pins on the mute cover as
shown in Figure l-7. Then hold the mute cover at each end, and
insert the guide pins into the cutout hooks of the printer cover.
Finally, lay down the free-end of the mute cover backwards.
To remove it, just reverse the procedure.
Printer
Figure 1-7.
down on the printer cover.
Install the mute cover by holding vertically, then lay
-
-
.-
-
7
Up to this point, we’ve been clearing the decks for action, so
to speak. There are only a couple more things left to do before
we can start printing - install the interface board and the font
cartridge.
W Installing the interface board
I I
Interface cover
Interface
Figure 1-8. Slide the I/F board into the slot.
board
The parallel interface board that comes with your printer con-
tains all the electronics that your printer needs to talk to a com-
puter. In addition, there are two optional interface (I/F) boards
that you can order: the serial interface board lets you connect to
a serial (RS-232C) computer port; the other board contains extra
buffer memory for parallel output. All three boards are installed
the same way.
To install or change an I/F board, start by turning the printer
around. Notice the snap-on cover at the left end. Take it off and
you’ll see where the board goes.
Fit the I/F board into the side slots and slide it all the way
down (don’t force it) by turning off the power switch. If the
board connector is seated snugly in its socket, you should be
able to put the cover back on and connect the cable from your
computer- you’re ready to go.
8
n Installing the font cartridge
This printer is mounted the Prestige characters as standard.
You can add two different character styles by installing the op-
tional font cartridges to the printer.
To install or change a font cartridge, start by turing off the
power switch.
Fit the font cartridge into the slots and slide it all the way.
Figure 1-9. Slide the font cartridge into front slot while the power
switch off.
CHAPTER 2
GETTING TO KNOW
YOUR PRINTER
Subjects we’ll cover in Chapter 2 include -
l Parts of the printer -
to use them;
l Paper selection and loading;
l Adjustment;
l Testing printer operation.
CONTROLS AND PARTS OF THE PRINTER
W Parts of the printer
First, we’ll go over the parts of the printer. You saw most of
these when you unpacked your printer. Now we’ll give you a
brief explanation of what they do.
what they’re for and how
PRINTER COVER - This protects the ribbon and the print
head from dust and dirt, and cuts down the sound of the printer.
MUTE COVER - This reduces the sound of the printer by installing on the printer cover.
PAPER GUIDE - As you’ve guessed, this flat plastic
molding guides the paper during printing (it is raised for single
sheets and lies flat for sprocket-feed paper).
POWER CORD - This cord connects the printer to its power
source, usually a wall outlet. It’s located at the left rear of the
printer.
PRINT HEAD - This is the device that does the actual printing. Like the strike lever in a typewriter, tiny stiff wires in the
print head hit the paper through a ribbon.
TRACTOR FEED UNIT - The drive gear and sprockets of
the tractor feed unit move sprocket-feed paper through the
printer.
PLATEN - This is the rubber cylinder that carries paper to
the print head.
Mute cover
Printer cover
Interface cover
L
Figure 2-1.
Font cartridge slot
’
Front and rear views of the printer.
INTERFACE COVER - On the back of the printer, this conceals and protects the interface board. The cover is cut away to
expose the external connector to which you attach your computer cable.
11
SLOTS FOR FONT CARTRIDGES - These are the two
openings at the bottom right of the front of the printer. Inserting an optional font cartridge pushes the small door up out of
the way and exposes a connector which accepts the cartridge.
H Controls and indicators
Now let’s go over the controls and indicators of the printer,
starting with the control panel on the right. There are seven indicators and five keys on the control panel.
Figure 2-2. The control panel.
POWER INDICATOR - Glows green when the power is on.
PE INDICATOR - Stands for “Paper Empty”, and glows red
when the printer runs out of paper and when certain printer
malfunctions occur.
FORM LENGTH SWITCH -Tells the printer how long the
pages are so that it can generate an automatic TOF code at the
appropriate time.
TYPE STYLE INDICATORS - Shows the character set in
use: standard (STD), font 1 (Fl), or font 2 (F2).
TYPE STYLE KEY - Selects one of the three character sets
available to the printer.
MODE INDICATORS - Either DRAFT or LQ glows green
to indicate the mode (set by the Mode key or the DIP switch).
MODE KEY - Changes the print mode every time it is pressed.
PITCH INDICATORS - Shows the character pitch currently set: Proportional (PROP), 136, 163, or 222 characters/line.
PRINT PITCH KEY -
Selects one of the four available
character pitches.
TOF KEY - Ejects the current sheet, feeds a new sheet, and
moves the print head to the left margin.
PAPER FEED KEY --Advances the paper one line at a time
when the On Line indicator is off. If you hold the key down, you
can get consecutive line feeds, one after the other.
ON LINE KEY and INDICATOR - Glows green when the
printer is ready to receive data from your computer (on line).
When the printer is off line, it sends a signal to the computer indicating that it cannot accept data. Pressing the On Line key
switches the printer on line and off line. When you turn the
power switch on, the printer is placed on line automatically.
n Extra functions
There are twelve more functions that are not directly
specified on the control panel. You can use seven of them by
pressing a key when you turn on the power; five others are activated by pressing two control keys at once.
For details, please refer to the end of this chapter.
n Other controls
There are other controls, not connected to the control panel.
Some of the more important ones are:
POWER SWITCH - The switch that turns the printer on
and off is at the back, on the left side.
PLATEN KNOB - This knob is at the middle of the right
side and lets you turn the platen by hand, just like a typewriter.
Caution: Turn the platen knob only with the Power switch c&f.
Turning the knob with the power on could damage the
drive gears.
RELEASE LEVER - The release lever is on top of the
printer, near the left rear corner. You’ll be using it often - it
controls how strongly the paper is held against the platen. The
release lever has four positions: the top setting is used for inserting paper, the next is for single sheets, the third is for sprocketfeed paper, and the bottom one is used when adjusting the
paper.
PAPER BAIL - The bail is the movable bar that holds the
paper against the platen. Its position depends on the setting of
the release lever.
DIP SWITCHES - There are two sets of eight switches that
are used in interfacing the printer to your particular computer.
There are also switches to set page length, line spacing, and per-
-
foration skipping. See Appendix A for a complete list and explanation.
SELECTING AND LOADING PAPER
Your printer can handle the two basic types of paper - single
sheets (stationery, envelopes, multipart business forms, etc.)
and continuous paper (fan-fold perforated paper).
This is a good place to tell you about the release lever, which
you’ll be using often. This lever controls the pressure of the
paper against the platen.
It has four settings:
‘g -The top setting is used when you want to load paper in the
printer.
& - The second setting is for normal single sheets.
& - The third is for sprocket-feed paper.
u - The bottom one is used when you want to release the
paper completely to adjust it.
The paper bail holds the paper against the platen according to
the setting of the release lever. The bail is opened when the
release lever is in the top position, closed when the lever is in
the second or third positions, and opened by the printer when
the lever is in the bottom position.
I
Figure 2-3. Use friction feed for single sheets and tractor feed for
Release lever
continuous paper.
n Loading single sheets
Now, instead of feeding the paper in manually by turning the
platen knob, we’re going to use the release lever for automatic
feeding (the printer must be turned on). Single sheets from 5.5
to 14.5 inches wide can be used.
OK? Let’s start.
1. Move the sprockets and sheet guides on the tractor feed
unit all the way to the ends.
2. With the ribs of the paper guide toward you and the
sliding adjuster at the bottom left, insert the guide into
the slot at the back of the printer cover.
3. Insert the guide stand in the notches provided for it and
use it to prop up the paper guide.
4. Position the adjuster at the triangle marked on the guide
for standard margins, or set it according to your requirements.
5. Set the release lever for single sheets-the second position from the top.
‘igure 2-4. Raise the paper guide for loading single sheets.
15
._
. .
L,.
i.
6.
L.
I
L
Figure 2-5.
the notches provided for it.
Prop up the paper guide by inserting the guide stand in
L.
L
L.
L
1
Figure 2-6. You can insert a sheet of paper by using the release
lever.
16
6. Align a sheet of paper on the guide along the adjuster.
7. Turn on the power switch. (The Paper Empty indicator
will glow because there is no paper.)
8. Now set the release lever to the auto-feed setting-the
top position. The printer will advance the paper
automatically.
9. When the paper stops, set the release lever for single
sheets again.
To align paper that is not in straight-
. Set the release lever to the adjustment setting.
l Straighten the paper and adjust it for the margins you
want.
l Move the release lever back to its original setting.
Remember, you can also use the optional automatic sheet
feeder for single sheets.
n Loading sprocket-feed paper
This is the familiar computer paper, with the holes along the
sides and perforations between the sheets. It is also called
sprocket, punched, fan-fold, or just plain “computer paper.” It
can be as narrow as 4”, and up to 15.5” wide.
1. Turn on the printer and set the release lever for sprocketfeed paper.
2. If the paper guide is installed, remove it.
3. Place a stack of fan-fold paper behind the printer.
4. Open the sprocket covers, on the right and left sprocket
units, as shown in Figure 2-7.
5. Flip the clamp levers backward. This allows the two
sprocket units to move freely right and left so you can
align them with the holes in the paper.
6. Feed the end of the paper into the slot next to the platen
cover plate.
7. Fit the holes in the paper over the sprocket pins so the
paper is even, and clamp the sprocket units in place.
8. Check that the paper is still positioned correctly, and
close the sprocket covers (Figure 2-8).
9. The Paper Empty indicator should be glown. Turn the
platen knob to feed the paper until the indicator goes out.
10. Now turn the platen knob the other way just a bit, until
the indicator glows again.
I
17
Sprocket cover
Figure 2-7.
pigure 2-8.
Open the sprocket covers to expose the sprocket teeth.
Ready to run with sprocket-feed paper.
18
11. Set the release lever to the auto-feed setting. The printer
will advance the paper automatically.
12. When the paper stops, set the release lever for sprocket-
feed paper again.
13. Finally, install the paper guide on the printer. You can in-
stall it either to lie flat as shown in Figure 2-8, or to raise
as shown in Figure 2-9. Now you’re ready to roll!
__ -- -_
‘igure 2-Y. You can raise the paper guide with sprocket-feed
1
19
Figure 2-10. The adjustment lever allows for different thicknesses
of paper.
You shouldn’t have any trouble finding the right gap setting
for your paper. If necessary, experiment; you’ll soon find the
best position for the paper you’re using.
EXTRA FUNCTIONS WITH THE COUTRUL PANEL
There are many functions that are not directly specified on
the control panel. In this section, we’ll show you these extra
functions.
‘igure 2-12. The self-tests show you what the printer can print.
n Self-tests
Your printer has two built-in programs that printout sample
lines of letters, numbers, and other characters-to show you
that everything’s in good working order. Self-test 1 is the long
version, and self-test 2 is the short one. You can use either one
to show the characters available in the printer, to check the installation of the ribbon and paper, and to check the adjustment
of the head-to-platen gap.
Best of all, you don’t have to wait another minute-you can
print the self-test without hooking up the printer to your computer! It’s as simple as 1, 2, 3. . .
1. Plug in the printer (don’t turn it on yet).
2. Insert a sheet of paper (or sprocket paper, either one).
3. While holding down one of the following keys, turn on
the power switch:
Were you surprised? It’s fast, isn’t it? About 250 characters a
second with draft characters and 83 characters a second with
LQ characters.
When you want to terminate the long self-test function, turn
off the power switch.
n Hex dump
Can you guess what a “hex dump” is? No, it’s not where
witches throw away useless spells. A hex dump is an advanced
ability with your printer that you can use, in certain cases, to
find a problem with your system. Fortunately, such problems
rarely arise but the hex dump is available if one does. We’ll go
over hex dump in Chapter 7. Right now, we’ll just tell you how
to make a hex dump:
1. Plug in the printer (don’t turn it on yet).
2. Insert a sheet of paper, as you did for the self-tests.
3. While holding down both the Paper Feed and Mode keys,
turn on the power switch.
When you want to terminate the hex dump function, turn off
the power switch.
n Panel modes
As you’ll learn in Chapter 5, this printer has many software
controls. But if you want to print in one fixed mode, ignoring the
control codes, these Panel modes take effect for you. To set the
Panel modes, follow the procedures:
1. Plug in the printer (don’t turn it on yet).
2. While holding the key or keys as shown below, turn on
the power switch.
Key
Type Style
Mode
Print pitch
TOF
Type of Panel mode
Character set type
Print quality (draft or LQ)
Print pitch
All of the above
Notice that these modes stay on with ignoring the relative con-
trol codes until you turn off the printer.
n g-pin graphics emulation mode
You already know that this printer represents the state of the
art in tack-sharp 24-pin text printing. To complete the text ability of this printer, we have also the ability to do dot graphics 9-
pin printing. The IBM graphics printer mode utilizes g-pin
graphics software which is commonly used by the IBM printer.
The IBM printer requires a different line feed pitch of either
n/72nd or n/216th inches. This printer normally uses a pitch of
nll80th inches, due to its 24-pin design. To avoid software incompatibility with existing IBM graphics programs, this printer
has been designed to most closely emulate the requirements for
g-pin dot graphics compatibility.
This unique g-pin graphics emulation mode can be envoked as
follows:
--
1. Plug in the printer (don’t turn it on yet).
2. While holding the TOF key and the Paper Feed key, turn
on the power switch.
When you want to cancel this mode, turn off the power
switch.
During normal operation -
Top of foms”-Ti j 1
23
**: Hold down
*: Press
**
**
I
II Right margin set
(Left margin set
* *
*
I I
*
**
I
Figure 2-13.
the control panel keys while in the Off Line mode.
n Setting print start position
When you want to align the print start position, you can set it
by the micro-feed operation with the control panel, instead of
turning the platen knob manually.
1. Set the Off Line mode by pressing the On Line key.
2. While holding down the On Line key, press one of the
following keys.
3. When you can set the print start position, release the
Paper Feed key or the TOF key first, then release the On
Line key.
You can set many functions by the combinations of
Paper Feed key-Forward micro-feed
TOF key-Reverse micro-feed
J
n Setting the top of form
When you turn on the printer, the top of form is automatically
set to the current position. If you want to change the position,
24
you can reset it by the following procedures.
1. Set the Off Line mode by pressing the On Line key.
2. While holding the Print Pitch key, press the TOF key.
Your printer acknowledges the new top of form with the
sound of beep.
n Setting the left and right margins
As you’ll learn in Chapter 5, you can set the left and right
margins with the control codes. In addition, you can set them
manually just like a typewriter by the following procedures.
1. Set the Off Line mode by pressing the On Line key.
2. While holding the Mode key, press one of the following
keys.
TOF key-Left margin set
Paper Feed key-Right margin set
3. While holding the two keys, the print head moves across
the page step-by-step.
4. When the print head goes to the position where you want
to set margin, release the two keys. So the printer
acknowledges the margin with the sound of beep.
CONNECTING THE PRINTER
Now that you’ve assembled and tested your printer, you’re
surely looking foward to using it forward what you bought it for -
printing! We’re almost there - just connect it to your computer
as follows:
Figure 2- 14.
Connect the cable like thm
-
I. Make sure that both your computer and printer are turn-
ed off.
2. Connect the printer end of the interface cable to the connector socket at the right rear of the printer as shown in
Figure 2-14.
3. Connect the other end of the cable to your computer as
described in the computer manual.
MEMO
-
-
CHAPTER 3
USING COMMERCIAL
SOFTWARE
Subjects we’ll cover in Chapter 3 include-
. Using your printer with SuperCalc;
l Using your printer with word processors.
Many of you purchased this printer to use with commercial
software. You made a good choice because this printer is compatible with most commercial program, from word processing
programs to spreadsheet programs to accounting programs.
Many of these programs have a routine for describing your
printer. These routines are often in “installation programs.”
They typically give you a choice of printers or printer types to
pick from. Some typical descriptions that you might pick for
your printer are: “TTY type printer with backspace,” “IBM-dot
matrix printer,
printer.” Your printer should work fine with any of these
descriptions.
Some printer lists are not very clear, and may not include
anything that you think describes your printer. If you can’t
decide which description best fits your printer we recommend
that you narrow the list to two or three choices (you can quickly
eliminate all the daisywheel printer types) and then experiment.
You won’t hurt anything if you guess wrong; it just won’t work
right. This should quickly tell you if your guess is right. If all
else fails, though, your printer dealer will be happy to give you
some advice.
Some programs don’t ask you what kind of printer you have,
but instead they ask some questions about what your printer can
do. Here are the answers to the “most asked” questions. Your
printer can do a “backspace”.
form feed”.
With the questions answered, you are ready to start printing.
Read the manual that came with your commercial software to
see how to make it send for your printer to print. This is all you
” “Centronics-type printer,” “Dot matrix ASCII
Your printer can do a “hardware
28
need to know to use your printer as a regular printer. But this
printer isn’t just a regular printer. Your printer has many
capabilities that your commercial software isn’t aware of. A little later we will see what it takes to use some of your printer’s
advanced features with commercial software.
n First, some terminology
Your printer knows what to print because it knows how to interpret the codes that the computer sends to it. These codes are
numbers that the computer sends to your printer. Both the computer and the printer know the meaning of these codes because
they are a set of standard codes used by almost all microcomputers. This set of codes is the American Standard Code for Infor-
mation Interchange, which is usually referred to as ASCII (pro-
nounced ask-key). There are ASCII codes for all the letters of the
alphabet, both lower case and capital, the numbers from 0 to 9,
most punctuation marks, and some (but not all) of the printer’s
functions.
ASCII codes are referred to in several different ways, depending on the way they are used. Sometimes these codes are
treated as regular numbers. For example, the letter “A” is
represented by the number 65 in ASCII. Appendix B shows all
of the ASCII codes.
In BASIC, ASCII codes are used in the CHR$ function. This
function is used to print the character that is represented by the
number in the CHR$( ) function. The BASIC statement
PRINT CHR$(65) will print an “A” on the terminal.
In some other programming languages, ASCII codes are referred to by their hex value.
“Hex” is short for hexadecimal which is
a base-16 number system (our usual numbers are base-lo).
Since hex needs 16 digits, it uses the numbers 0 through 9 and
then it uses the letters A through F for digits. The ASCII code
for the letter “A” is 41 in hex.
Of course, most of the time we don’t even need to think about
this code system. Our computers are smart enough to know that
when we press the “A” key on our keyboard we want to print
the letter “A”. The computer takes care of all the rest.
But there are a number of ASCII codes that don’t have keys
on the keyboard. The most important of these codes are the
codes that ASCII values below 32. These codes control many of
this printer’s functions. Even though there aren’t keys for these
codes, most keyboards can send these codes. It’s done by
holding down the “control” key (many times marked CTRL) and
. .
L.
.^.
u.
L.
c
L.
c..
L
29
simultaneously pressing a letter key. The particular letter key
that is pressed determines what code is sent. Control and A
sends ASCII code 1, control and B sends ASCII code 2, and so
on. Because of the way they are created, these codes are often
referred to as “control-A” etc.
So there are four common ways of referring to the same set of
codes: the character or name of the code, the decimal ASCII
value, the hexadecimal ASCII value, and the “control-” value.
For example, the code that causes the printer to advance the
paper one line is ASCII 10 (decimal). This code is commonly
referred to by all the following names:
Line feed - its name
(LF) -
ASCII 10
the abbreviation of its name
its decimal value
-
ASCII &HOA - its hexadecimal value (the &H signifies
hex)
CHR$(lO) control-J -
the way it’s used in BASIC
the way you send it from a keyboard
There’s a chart in Appendix B that shows these side-by-side so
that you can convert back and forth.
The reason that we are telling you all this about ASCII codes
is that people are not very consistent about how they describe
ASCII codes. We are going to help you use your printer with
commercial software, but we don’t know what its documentation is going to call the various codes. So if you know all the different things that the codes might be called, it will be easier to
figure out what it is trying to tell you.
Now, armed with the knowledge of what to look for, you can
delve into manuals of your commercial software and dig out the
secrets of how to send “control codes” to your printer. When
you find the method that your program uses, then you can shop
through this manual to find the function that you want to use.
By translating the codes from the system that we use, to the
system that your commercial software uses, you should be able
to use many of your printer’s advanced features. It may help,
however, if we look at a couple of examples.
USING YOUR PRINTER WITH SUPERCALC
.,
SuperCalc is typical of the many spreadsheet programs that
are now available. It has the capability of using several of the advanced features of your printer. Perhaps the most often used
feature with spreadsheet programs is compressed printing.
Let’s see how to use compressed printing with SuperCalc.
In SuperCalc, the /Output command provides out put to the
printer. One of the options of the /Output command is S(etup).
This option provides you with a menu of functions to configure
SuperCalc to match your printer. You can change the number of
characters that SuperCalc will print on a line and the number of
lines that will print on a page. You should be sure that these
values match your printer. Your printer can print 136
characters per line of pica type, or 234 characters per line of con-
densed elite type. One of the other options on this menu is “send
setup codes to printer”.
This is how we tell this printer that we
want to use condensed print. The code to switch this printer into condensed print is ASCII 15, or control-O. So to switch on
condensed type, use the /Output command and, after selecting
D(isplay) and entering the range to print, select the S(etup) option, and the S(etup)-“Manual setup codes” sub option. Then, at
the prompt that says “Enter codes (CR when done)“, type control-0. Remember, to enter control-0 you should hold down the
CTRL key while you press the 0 key (That’s the letter Oh, not
the number zero). Then just press the return and select P(rint)
to print your report.
You only need to go through this procedure once each time
you use SuperCalc because your printer will stay in compressed
print until it’s turned off or reset.
You might also wish to use some of your printer’s other
features with SuperCalc. Find the code for the feature you wish
to use in Appendix C and use the same procedure given here.
-
--
-
USING YOUR PRINTER WITH WORD PROCESSORS
Not many word processing programs recognize the advanced
features of printers like your printer. They usually provide for
some method of making bold characters and underlining. But
your printer can do much more than that. The people that write
word processing programs do, however, know that there are a
lot of different printers on the market, and so they usually, (but
not always) provide a way of sending special codes to a printer.
We will study one example of this to see how a typical word pro-
-.
cessor handles it. Once you understand the concept you should
be able to use your program manual to figure out how your word
processor does it.
The program that we will study is‘the EasyWriter word processor for the IBM Personal Computer. This uses a fairly
typical method of handling special codes. Generally, word processing programs don’t want you to put non-printing codes in
the file. They “know” that they won’t print anything, and so
they “protect” you by not letting you use them. But the nonprinting codes are the ones that you need to use your printer’s
features. So EasyWriter provides a way to override this protection. If you precede a special code with a “control-O” then
EasyWriter will accept the next non-printing code.
Let’s look at a specific example. Suppose you want to print
the title of a book in boldface. The code sequence to select
boldface print is Escape G (that’s two separate characters).
Entering the G is no problem; it’s a printing character so
EasyWriter won’t object (although in this case it’s not going to
print). The Escape, however, is a non-printing character so it requires special handling. To enter the Escape code first enter control-0 (hold the Ctrl key while you press the letter 0). Then
press the Esc key. The Escape character shows on the screen as
a left pointing arrow. Now just type the letter G and you’re
done.
When you want to end the boldface print, you need to enter
Escape H. Use the same procedure: enter control-O, Esc, and
then H.
You can use many of your printer’s features this way. Find
the codes that you need in Appendix C.
A note to WordStar users: WordStar is probably the most
popular word processing program in the world. But it provides
no way to enter special printer control codes from the keyboard.
WordStar does, however, provide you with a way to use some of
your printer’s advanced features. WordStar has four special
commands that you can use to access your printer’s features.
These are called “user printer controls” and are control-P Q,
control-P W, control-P E, and control-P R. You might use two of
these to turn boldface on and off and the other two for some
other function. The process of setting up these codes is called
“patching” and is done with the install program that comes with
WordStar. The procedure is fairly involved, but it is explained
in the WordStar manual. If you have trouble figuring it out, ask
for assistance where you bought WordStar.
32
MEMO
CHAPTfiR 4
CONTROLLING
WITH BASIC
Subjects we’ll cover in Chapter 4 include-
* Listing BASIC programs on the printer;
l Printing from BASIC;
l CHR$ function;
l Command syntax;
l Problem codes.
In this chapter we will be teaching you how to use your
printer’s features using the BASIC programming language. It is
easy to communicate with your printer from BASIC and, though
it has its detrators, BASIC is the nearest thing to a universal
language among users of personal computers. But remember
that it’s not the only way to communicate with your printer, as
we have already seen.
SOME BASICS ABOUT BASIC
H First steps
The first things that a beginner learns to do are to list a program and to print a character string. Certainly these are the
easiest operations one can do, but even they may depend on
what computer you have. In Microsoft BASIC, we can list all
the steps in a program by entering LIST. This lists them on the
CRT screen; if we want to print them on a printer, we prefix the
command with an L (enter LLIST).
The Microsoft BASIC command for outputting information is
PRINT. Like the LIST command, this displays the information
on the CRT screen so we have to add an L (+ LPRINT) if we
want to use the printer. Just put whatever you want to print between quotes and after LPRINT (anything enclosed in quotes is
called a character string). For example, we would use LPRINT
“Hello!” to output “Hello!” to the printer. We’ll see later how to
c
LPRINT things other than character strings.
We started with Microsoft BASIC because it is the most widely used version of BASIC around. The programs in this manual
are written in Microsoft BASIC so they should run on most computers. But if strange things happen when you try to run a program, check the BASIC manual that came with your computer.
Let’s talk about Apple II computers for a minute. These
enormously popular computers use their own brand of BASIC.
To use an Apple II, enter the following - *
PR#l
LIST
PR#O
The PR#l tells the Apple to send everything to the printer,
the LIST or PRINT command sends it, and the PR#O returns
output to the screen.
Other computers, notably the Commodore C-64, require you
to open the printer as a numbered device then to direct output to
that device. For example, you might type the following to print
“Hello!” or to list a program in the C-64’s memory.
OPEN4.4
CMD4
LIST
CLOSE4
Here, the first line says that the printer is device number 4,
the second directs output to it, the third does the printing, and
the last line closes down device number 4.
Appendix H gives more information about listing programs on
the various computers. Find the part that applies to your computer and try it.
Now that we all know how our computers address the printer,
let’s try listing a BASIC program. Load a BASIC program and
LLIST it (or however your computer does it). We’ve crossed the
first major hurdle-learning how to list programs on your
printer. Now we are ready to jump into the world of programming with your printer. But first, there are a few fundamentals
that we need to cover.
PRRl
PRINT "Hello!"
PR#O
OPEN4,4
CMD4
PRINT "Hello!"
CLOSE4
n Establishing communications
We’ve learned something about communicating with our
printer. Now we need to adapt what we know to printing in a
35
BASIC program. Generally, computers use about the same procedure for printing in a program as they do to list a program.
Let’s try what we learned. Type the following:
NEW
10 LPRINT "TESTING"
RUN
Remember-we use LPRINT; you may have to use something
else!
At any rate, you should have the word “TESTING” on your
printer. Quite an achievement, isn’t it? Let’s get done with this
simple stuff so that we can go on to something interesting.
n The CHR$ function
We mentioned CHR$ in Chapter 3 as one way to express
ASCII codes. We are going to use it a lot in communicating with
this printer. This printer uses many of the ASCII code that
don’t represent letters and numbers. The CHR$ function gives
us an easy way to send these codes to the printer. Try this to see
how the CHR$ function works:
NEW
10 LPRINT CHR$(80)
RUN
That should print a “P” for Printer. If you check the chart in
Appendix B you will see that 80 is the ASCII code for “P”.
n Control codes
This printer uses many of the non-printing ASCII codes for
control codes. These codes perform a function rather than printing a character. Let’s try an easy one right now:
NEW
10 LPRINT CHRS(7)
RUN
36
Where did that noise come from? That’s the printer’s bell. We
will learn more about it in Chapter 5. We just wanted to illustrate a code that causes the printer to perform a function.
n The escape codes
Back when the ASCII system was set up, computer equip-
ment was relatively simple and thirty-three control codes were
considered sufficient at the time. The American
Standards people realized that, eventually, more control codes
would be needed so they included the escape (ESC) code to
allow almost any number of additional codes to be defined when
they became necessary.
ESC allows us to “escape” from the ordinary set of control
codes so we can specify additional functions and other information needed for a printer function. In this manual, we’ll write the
ESC code inside broken brackets, like this - (ESC).
(ESC) - decimal 27 - is always followed by at least one
other number; it is never used alone. The whole series of related
numbers is called an escape sequence.
n A note on command syntax
Because the readers of this manual will be running such a
wide variety of applications on so many different computers, we
just can’t show the exact way of sending codes to the printer for
each one of them. Instead, as we introduce you to each new command, we will show the commands as in this example:
(ESC)
“W” 1
This command that turns on expanded printing. (ESC), as we
mentioned earlier, is the escape code (which is ASCII code 27).
A letter or number in quotes (such as the “W” above) means that
the character should be sent to the printer (without the quotes).
In our example, you should send a capital W following the
escape code. In BASIC, you could do this in a couple of ways: by
sending the character itself (e.g. LPRINT “W”;), or by using the
CHR$ function to send the ASCII code for the character (e.g.
LPRINT CHR$(87);).
Many of printer commands end with a 1 or 0. When shown as
in the above example (i.e. no quotes and no “CHR$“), you can
use either ASCII code 1 (i.e. CHR$(l)) or the character “1”
(which is ASCII code 49). The same idea applies to commands
ending with 0.
So for out example above, any of these BASIC statements will
Even though, there are many commands that require the use
i.
of ASCII code 0; the character “0” (ASCII code 48) cannot be
substituted. In these cases, instead of an unadorned 0 we will
c,
L-
show CHR$(O) each time these commands are referenced.
n Some problem codes
Before we go too far we need to mention some codes that may
cause you problem.
Nearly all BASICS change some of the ASCII codes between
your BASIC program and your printer. IBM’s Microsoft BASIC
adds a CHR$(lO) (a line feed) to a CHR$(13) (a carriage return)
before sending it on. Another problem code is ASCII 26. Once
again we refer to Appendix H where some more specific information awaits.
That’s it for the basics. You are ready to learn how to use the
many features of your printer.
38
MEMO
CHAPTER 5
PRINTING TEXT
Subjects we’ll cover in Chapter 5 include-
* Letter quality (LQ) characters;
l Underlining and overlining;
l Superscripts and subscripts;
l Print boldface;
l Print pitches.
The rest of this manual will show you a little BASIC - just
enough for you to use your printer. We’re not going to try to
make you an expert programmer, though, only get you started.
All our examples will be given in Microsoft BASIC as used by
the IBM Personal Computer, but remember that you don’t need
to know BASIC to use your printer’s features. Just use the same
ASCII codes as we do in our examples with all DIP switches are
set on condition.
If your computer doesn’t use Microsoft BASIC, look in the ap-
pendix to see what changes you need for your BASIC.
You have already printed a few lines on your printer. Now it’s
time to start looking at the many variations of printing style that
you have available to you.
SOME SPECIAL KINDS OF TEXT
If you looked carefully at your printer’s self test, you noticed
that it can print many styles. But there’s more! Your printer can
underline or overline characters, print superscripts and
subscripts, and perhaps most exciting, print letter quality
characters.
n Letter Quality characters
This printer’s Letter Quality (sometimes abbreviated as LQ)
character set is ideal for correspondence and other important
40
printing, for it takes a keen eye to detect that it is from a dot
matrix printer. Normally, your printer prints draft quality
characters when the DIP switch 1-4 is set off. This is adequate
for most work and it prints fastest. But for the final printout, try
Letter Quality. The program below shows how.
Demo of LQ character set
10 '
20 LPRINT CHR$(27) ; "xl";
30 LPRINT "This line shows LETTER QUALITY!'*
40 LPRINT CHR$ (27) ; “x0” ;
50 LPRINT "This line shows standard print."
In this program, line 20 selects LQ characters with (ESC) “x”
1 command. Line 30 prints a sample before line 40 switches
printer back to draft printing with an (ESC) “~“0. When you
run the program you should get this:
This line shows LETTER QUALITY!
This line shows standard print.
Table 5-l
Letter quality commands
Function
Letter quality ON
Letter quality OFF
Control code
(ESC) “~"1
(ESC) “~"0
n Characters in the Font Cartridge
This printer offers you the Prestige LQ characters as standard. If you want to use other LQ character styles, use the optional font cartridges.
You can install those font cartridges following the procedures
described in Chapter 1. You can control the characters in those
font cartridges as shown below:
10 ’ Demo of optional characters
20 LPRINT CHR$(27):"xl";
30 LPRINT CHR$(27);"k";CHR$(l);
40 LPRINT "This line shows Font 1 characters."
50 LPRINT CHR$(27);"k";CHR$(2);
60 LPRINT “This line shows Font 2 characters.”
70 LPRINT CHR$(27);“k”;CHR$(O);
80 LPRINT “This line shows Internal Characters.”
90 END
When you’ve installed the Gothic Font Cartridge to the font
slot 1, and the Italic Prestige Font Cartridge to the font slot 2,
the results of this program look like this:
This line shows Font 1 characters.
This line shows Font 2 characters.
This line shows Internal Characters.
In this program, line 30 selects the characters on the font slot
1, with (ESC) “k” CHR$(l) command. Line 40 prints a sample
with the LQ characters in the font cartridge installed on the font
slot 1. Line 50 selects the font cartridge slot 2 with (ESC) “k”
CHR$(2) command. Line 60 prints a sample with the font slot 2
characters before line 70 switches printer back to internal LQ
characters with an (ESC) “k” CHR$(O) command.
You can control the font styles with the extra functions with
the control panel.
Table 5-2
Font selection commands
Function Control code
Selects font slot 1
(ESC) “k” CHR$( 1) or (ESC) “4”
Selects font slot 2 (ESC) “k” CHR$(2)
Selects internal characters
Cancels font slot 1
iESC j “k” CHR$(Oj
(ESC) “5”
n Underlines and overlines
Not only your printer print all characters in both draft and LQ,
but it can underline or overline them too. The control codes are
shown in Table 5-3.
42
Table 5-3
Underline and overline commands
1 Function 1 Control code I
Underline ON
Underline OFF
Overline ON (ESC) “p”1
f Overline OFF
(ESC) “-“l
(ESC) “-“0
, \---I -
1 (ESC) “‘-“O
Again, that’s simple. Let’s try it with this program:
10 ’
Demo of underlining and overlining
20 LPRINT “Demo of “;
30 LPRINT CHR$(27) ;“-1”;
40 LPRINT “UNDELINED”;
50 LPRINT CHR$(27) ;“-O”;
60 LPRI NT ‘* and ” ;
70 LPRINT CHR$(27);” 1”;
80 LPRINT “OVERLINED”;
90 LPRINT CHR$ (27) ; “-0” ;
100 LPRINT ” printing.”
It should come out like this:
Demo of UNDELINED and m printing.
In this program underline is turned on in line 30 with (ESC)
“
-“l, and then off in line 50 with (ESC) “-“O. The overline is
turned on in line 70 with (ESC)“-” 1, and then off in line 90
with (ESC)“-“O. There’s a new little wrinkle in this program,
though. The semicolons at the end of the lines told BASIC that
those lines were to be continued. Therefore, BASIC didn’t send
a carriage return and line feed at the end of those lines. We just
did this to illustrate that all these control codes can be used in
the middle of a line. It’s easy to underline or overline only part
of a line.
H Boldface printing
Your printer has very good density when it’s just printing
regularly. But sometimes you may want something to stand out
from the rest of the page. This printer provides a way to do this
with boldface printing.
The following table shows the control codes for getting into
and out of boldface mode.
Table 5-4
Boldface print commands
43
Function
Boldface ON
Boldface OFF
Control code
(ESC) “E” or (ESC) “G”
(ESC) “F” or (ESC) “H”
Try this short program to see the boldface mode:
' Demo of boldface
10
20 LPRINT CHR$ (27) ; “E” ;
30 LPRINT “This line is BOLDFACE printing."
40 LPRINT CHR$(27);"F";
50 LPRINT "This line is normal printing.*'
Run this program. The results will look like this:
This line is BOLDFACE printing.
This line is normal printing.
Line 20 turns on boldface with (ESC)“E” and line 30 prints a
line of text. In line 40 turns boldface off with (ESC)“F”, so your
printer is set for normal printing.
Look closely at the different lines of printing. First line,
boldface printing, has been printed twice, and they are moved
down just slightly the second time they are printed. Now that’s
pretty nice printing, isn’t it?
n Superscripts and subscripts
Your printer can print in two different heights of characters.
The smaller characters are called superscripts and subscripts and
are half the height of normal characters. Superscripts print even
with the tops of regular printing while subscripts print even with
the bottom of regular printing. They are frequently used to
reference footnotes, and in mathematical formulas.
Table 5-5 has the codes for using superscripts and subscripts.
44
Table 5-5
Superscripts and subscripts commands
Function
Superscript ON
Subscript ON
Super and subscript OFF
Here line 30 turns on superscripts with (ESC) “S’O. It’s turned off in line 50 with (ESC) “T”. Then between printing text,
subscripts are turned on in line 70 with (ESC) “S’l, and finally
off in line 90. Again, everything prints on one line because of the
semicolons.
-
CHANGING THE PRINT PITCH
In “printer talk,” the number of characters that can be printed
in one inch is called the print pitch or character pitch. Normally,
your printer is set for 10 characters per inch, which is called pica
(and is the same as the pica pitch on some typewriters). This
works out to 136 characters per line.
You can also print 12 characters per inch (elite pitch). This
gives you 163 characters per line.
You can set these pitches by using the Mode key on the con-
trol panel manually, or by software as shown in the table below.
Table 5-6
Print pitch commands
45
Pitch
Pica
Elite
Characters/inch
10
12
Control code
(ESC) “P"
(ESC)“M"
Try this program to see how these two pitches work.
' Demo of pica and elite pitches
10
20 LPRINT CHR$(27);"M";
30 LPRINT "This line is ELITE pitch."
40 LPRINT CHRS(27);"P";
50 LPRINT "This line is PICA pitch (normal)."
When you run this program you should get this:
This line is ELITE pitch.
This line is PICA pitch (normal).
Line 20 turns on elite pitch with (ESC) “M”. Line 30 prints a
line at 12 characters per inch. The (ESC) “P” in line 40 resets
the printer to pica pitch and line 50 prints a line in pica pitch.
n Expanded print
Each of the print pitches can be enlarged to twice its normal
width. This is called expanded print. Try this program to see
how it works:
w printing."
70 LPRINT "Notice that '*;
80 LPRINT CHR$(14);
90 LPRINT "EXPANDED mode"
100 LPRINT *'automatically turns off at the end of a
line."
46
Demonstration of EXPANDED printing.
Notice that EXPANDED mode
automatically turns off at the end of a line.
Expanded print set with CHR$(14) is automatically cancelled
at the end of the line. This is convenient in many applications,
such as for one line titles. Note that you didn’t need to put an
(ESC) in front of the CHR$(14), although (ESC) CHR$(14)
works just the same.
You can also cancel one line expanded print before a carriage
return with CHR$(20), as done in line 50.
Sometimes you may wish to stay in expanded print for more
than one line. Change your program to this:
When you turn on expanded print with (ESC) “W”1 it stays
on until you turn it off with (ESC) “W”0.
Table 5-7
Expanded print commands
Function
One line expanded ON
One line exDanded OFF CHR$(20)
Expanded 6N
Expanded OFF
Control code
CHR$(14) or (ESC)CHR$(14)
(ES6)“W” 1
(ESC)“W”O
I
/
?
:’
n Condensed print
Each of the print pitches also can be condensed to its normal
width. This is called condensed print. Try this program to see
how it works:
10 ’ Demo of condensed pitch
20 LPRINT "Demonstration of ";
30 LPRINT CHR$(15);
40 LPRINT "CONDENSED";
50 LPRINT CHR$(lS);
60 LPRINT w printing."
Demonstration of CONDENSED printing.
Condensed print set with CHR$(15) stays on until you turn it
off with CHR$( 18). Note that you don’t need to put an (ESC) in
front of the CHR$( 15), although (ESC) CHR$( 15) works just
the same.
47
Table 5-8
Condensed print commands
Function
Condensed ON
Condensed OFF
By combining expanded print and condensed print with the
two pitches, this printer has eight different character widths
available.
Enter this program to see how the print pitches, expanded
print and condensed print can be combined:
10
' Demo of various print pitches
20 LPRINT CHR$(15);
30 LPRINT CHR$(27);"M";
40 LPRINT "This line is CONDENSED ELITE pitch."
50 LPRINT CHRS(27);"P";
60 LPRINT "This line is CONDENSED PICA pitch."
70 LPRINT CHR$(lB);
80 LPRINT CHR$(27);"M";
90 LPRINT "This line is NORMAL ELITE pitch."
Control code
CHR$(15)or(ESC) CHR$(15)
CHR$(18)
48
100 LPRINT CHR$(27);"P";
110 LPRINT "This line is NORMAL PICA pitch."
120 LPRINT CHRS(27);"Wl";
130 LPRINT CHR$(15);
140 LPRINT CHRS(27);"M";
150 LPRINT "This line is EXPANDED CONDENSED ELITE."
160 LPRINT CHR$(27);"P";
170 LPRINT "This line is EXPANDED CONDENSED PICA."
180 LPRINT CHR$(lS);
190 LPRINT CHRS(27);"M";
200 LPRINT "This is EXPANDED ELITE."
210 LPRINT CHRS(27);"P";
220 LPRINT "This is EXPANDED PICA."
230 LPRINT CHR$(27);"WO";
Here’s what you should get from this program:
Thus line is CONDENSED ELITE pitch.
This line is CONDENSED PICA pitch.
This line is NORMAL ELITE pitch.
This line is NORMAL PICA pitch.
This 1 ine is EXPANDED CONDENSED ELITE f
This 1 ine is EXPANDED CONDENSED PICA,
This
This is
is EXPANDED EL.ITE,
EXPANP)ED PICA,
W Proportional printing
Have you ever noticed in books and magazines? Doesn’t it
look nice? The main reason is that each character is given an
amount of space proportional to its actual width. A typewriter
(and most printer), on the other hand, give every character the
same amount of space, no matter how wide it is. (Pica pitch, for
example, gives a “w” and an “i” l/10 of an inch each. Look these
letters closely and you’ll see that a “w” is two or three times as
wide as an “i”.)
Well, you too enjoy professional-looking proportional print-
ing. You can turn proportional printing on and off with the
following command.
Table 5-9
Proportional commands
49
Function
Proportional ON
Proportional OFF
Control code
(ESC)“p”l
(ESC)“p”O
Try this program to see how the proportional spacing works.
’ Demo of proportional printing
10
20 LPRINT CHR$(27) ; “~1”;
30 LPRINT “This line is PROPORTIONAL printing.”
40 LPRI NT CHR$ (27) ; “~0” ;
SO LPRINT “This line is NORMAL PICA print.ing.”
When you run this program you should get this:
This line is PROPORTIONAL printing.
This line is NORMAL PICA printing.
In this program line 20 turns on the proportional printing with
(ESC)“p” 1. Line 30 prints a line with proportional pitch. Then,
line 40 resets the proportional printing and line 50 prints a line
in normal pica pitch.
NOTE: When you change the print pitch by the MODE key on
the control panel,
this proportional spacing should be
automatically cancelled.
MIXING PRINT MODES
We have learned how to use the various print modes in-
dividually and together. Now we’ll see how to combine them
more efficiently.
You have at your disposal a unique command that lets you
choose any valid combination of print modes and pitch. This is
the Master Print mode command. It looks like this:
(ESC) “!” n
50
Here, the value of n defines the print style to be selected. The
value of n can range from 0 to 255, which is the range of values
that can be stored in one eight-bit byte. If you look at each bit in
this byte, you’ll find that each one represents a printing style
variation. Adding the binary values of the selected bits gives the
value of n for a particular combination of print styles.
Table 5-10 shows the decimal values of the bits in the Master
Print byte. To calculate the value n for a particular combination
of printing styles, just add the values of the features that you
want to combine.
For example, if you want to select elite expanded boldface
print, you would calculate the value of n like this:
Elite
1
Boldface 16
Expanded 32
n= 49
The command would look like this:
CHR$(27);“!“;CHR$(49)
To better understand the way the print modes work, consider
that each mode except pica (pica is the default) has a separate
switch that can turned on and off via software. Once the switch
is on, it stays on until turned off. When two modes that conflict
are turned on at the same time, the printer must choose which
one to use.
I
-
-
-
For example, suppose you turn on both Proportional and Condensed modes. Since these cannot combine the printer must
make a choice; in this case, the printer chooses Proportional.
Summary notes
1) Pica is the default pitch and is active when Elite is turned
off.
2) When two modes conflict, the one of lesser priority is
cancelled. For example, Proportional and Condensed can
not be printed at the same time, printing is Proportional.
3) Underline, and Expanded modes combine with any print
modes.
4) Proportional characters are always printed in Boldface.
51
MEMO
-
CHAPTER 6
FORMATTING TEXT
Subjects we’ll cover in Chapter 6 include-
* The carriage return and line feed;
l The amount of space between lines;
l Moving to the next page;
l The number of lines on a printed page;
l Horizontal and vertical tabs;
l Setting margins- left, right, and bottom.
-
Chapter 5 showed us all the basic techniques of using the
printer. Now we’re ready for the more advanced ones. We’ll concentrate on changing the appearance of the page to suit our
needs.
LINES AND LINE SPACING
n Starting a new line
Up until now the only time we have thought about printing on
a new line is when we didn’t want it to happen. We learned that
putting a semicolon (;) at the end of a BASIC line will not end the
line of printing. So somehow, the computer telling the printer
when to end one line and start another.
There are two codes that are used to end one line and start
another. They are carriage return (CHR$(13)) and line feed
(CHR$(lO)). Like the escape code, they have been given abbreviations which you’ll find many texts (including this one):
< CR > and < LF > . The codes are simple, but their action is a
little confusing (especially with BASIC). Carriage return is the
easiest. Each time that the printer receives a CHR$(13) it
returns the print head to the left margin. It does not advance the
paper (if DIP switch 2-6 is on; see below).
Line feed is more complicated. Each time the printer receives
a CHR$(lO) it both advances the paper one line and returns the
54
print head to the left margin, ready to start a new line.
Now to add a little confusion-most (but not all) versions of
BASIC add a line feed (CHR$(lO)) to every carriage return
(CHR$(13)) that they send. If your version of BASIC doesn’t do
this, then you should turn DIP switch 2-6 off so that your printer
will add the line feed for you. When you have DIP switch 2-6 off
the printer will do the same thing when it receives a carriage
return as it does when it receives a line feed.
If you find that your printer double spaces when it should
single space, then you probably need to turn DIP switch 2-6 on.
Table 6-1
Line feed commands
Function
Return print head to left margin CHR$(lS)
Advance paper one line
Control code
CHR$(lO)
n Changing the line spacing
When you turn your printer on the line spacing is set to 6 lines
per inch (or 8 lines per inch if DIP switch 2-8 is off). This is fine
for most printing applications, but sometimes you may want
something different. Your printer makes it easy to set the line
spacing to whatever you want.
Try this program to see how easy it is to change the line spacing:
10 ’
Demo of line spacing
20 FOR I=1 TO 20
30 IF I=13 THEN 60
40 LPRINT CHR$ (27) ; “A” ; CHRS ( I ) ; CHR$ (27) ; “2” ;
50 LPRINT “THIS LINE SPACING IS SET TO”;1
60 NEXT I
70 LPRINT “THIS LINE SPACING IS SET TO l/6 INCH.”
THIS LINE SPACING IS SET TO 9
THIS LINE SPACING IS SET TO 10
THIS LINE SPACING IS SET TO 11
THIS LINE SPACING IS SET TO 12
THIS LINE SPACING IS SET TO 14
THIS LINE SPACING IS SET TO 15
THIS LINE SPACING IS SET TO 16
THIS LINE SPACING IS SET TO 17
THIS LINE SPACING IS SET TO 18
THIS LINE SPACING IS SET TO 19
THIS LINE SPACING IS SET TO 20
THIS LINE SPACING IS SET TO l/6 INCH.
Line 40 defines and changes the line spacing. The command
(ESC)“A”CHR$(n) defines the line spacing as n/60 of an inch;
the (ESC)“2” command changes the line spacing to the amount
defined by the previous (ESC)“A”. The loop that is started in
line 20 increases the value of n (the variable I in the program)
each time it is executed. So the line spacing increases as the program continues. Line 30 shortcuts the loop when I = 13, since
BASIC won’t let us send CHR$(l3) without adding an unwanted
CHR$(lO) to it. Finally, the (ESC)“A”CHR$(lO) and (ESC)“2”
commands in line 80 reset the line spacing to 6 lines per inch
(IO/60 or l/6 inch).
NOTE: When you look the results closely, the line spacing with
the (ESC) “A” CHR$(l2) command sets the line spacing to l/6
inch instead of setting 12/60 inch. This is because that the g-pin
printers are normally sets the line spacing to 12/72 inch (l/6
inch) with this command, and most software programs use this
command to set the line spacing to l/6 inch, and we’ve thought
the compatibility with those programs. (The same reason for the
(ESC) “3” CHR$(36) command.)
56
When you are using your printer with the DIP switch 2-2 off,
the (ESC)“A”CHR$( )
n works to change the line spacing
without (ESC)“2”. So in this case, change the following lines as
shown below:
You may wonder why they picked l/60 of an inch as the increment for the line spacing command. There’s a good reason: the
dots that the printer makes are l/l80 inch apart. So this means
that you can vary the line spacing in increments as fine as three
dots - unless you want finer spacing, like one dot spacing.
The (ESC)“3”CHR$(n) command sets the line spacing in increments of l/180 inch. Change line 40 in your program so it is
like this:
40 LPRINT CHR$(27):"3";CHR$(I);
and run the program again. Now the results will look like this:
INCH.
The program works just the same as before, but the line spacing are just one-third what they were. This is because (ESC)“3”
CHR$(n) sets the line spacing to n/180 inch.
Table 6-2 shows all the line spacing commands, including
several “shortcut” commands for commonly used line spacings.
.
Table 6-2
Line spacing commands
Function
Set line spacing to l/8 inch
Set line sDacinz to 7160 inch
Set line macinn to l/6 inch or use 0W”A” defiiitiod (ESC )“2”
1 Set or define line spacing to n/60 inch
One-time line feed of n/180 inch (ESC)“J"CHR$(n)
-reverse line feed of n/180 inch 1 ( ESC)“
Control code
(ESC)“O”
(ESC)“l”
I (ESC)“
n Moving down the page without a carriage return
So far, all the commands that move the paper also move the
print head to the left margin. And normally this is what you
want. Sometimes, though, you may wish to move down the page
without moving the printhead back to the left margin. The
following commands do just that.
The (ESC)“J”CHR$(n) command causes the printer to make
one line feed of n/180 inch, but does not change the setting of the
line spacing. Try this program to see how it works:
10 ' Demo of one-time line feeds
20 LPRINT "LINE NUMBER 1."
30 LPRINT "LINE NUMBER 2.";
40 ' One-time line feed
50 LPRINT CHR$(27);“J*‘;CHR$(lOO);
60 LPRINT "LINE NUMBER 3."
70 LPRINT "LINE NUMBER 4."
80 END
Here is what your printer will produce:
LINE NUMBER 1.
LINE NUMBER 2.
LINE NUMBER 3.
LINE NUMBER 4.
58
The (ESC)“J”CHR$(lOO) in line 50 changes the spacing to
100/180 inches for one line only without moving the printhead.
The rest of the lines printed with the normal line spacing.
Notice that both line 30 and line 50 end with semicolons. This
prevents the normal line feed from occurring.
The (ESC)“j”CHR$(n) command works the same way except
that the paper moves in the opposite direction. Try this simple
change to your program and see what a difference it makes!
40 ’ One-time reverse line feed
50 LPRINT CHR$(27);“j”;CHR$(lOO);
LINE NUMBER 3.
LINE NUMBER 4.
LINE NUMBER 1.
LINE NUMBER 2.
PAGE CONTROL
Now that we have seen how to control line spacing, we can go
on to page control - positioning the printing on the page and ad-
justing the paper length.
n Form feed
The simplest forms control code is the form feed. Form feed
(or < FF >) is CHR$(12) and causes the printer to move the
paper to the top of the next sheet. Try it by changing lines 40
and 50 to this:
’ Form feed
;: LPRINT CHRS(12);
Before you run the program, turn your printer off and adjust
the paper so that the top of the sheet is even with the top of the
ribbon guide on the print head, then turn the printer back on. If
you don’t remember how to do this, review Chapter 2. When
you run the program, the results will look like this:
59
,____ iv------- -------- -
1 LINE NUMBER 1.
0,
01
LINE NUMBER 2.
I
I
I
-- ------ - ---- ------_-__
I LINE NUMBER 3.
0 ; LINE NUMBER 4.
OI
I
The form feed (CHR$(12)) in line 50 caused the printer to
move to the top of a new page before printing the last two lines.
n Changing the page length
You may have some computer forms that you wish to use with
this printer that are not 11 inches high. That’s no problem,
because you can tell your printer how high the forms are that
you are using. There are two commands for doing this, shown in
this table.
OI
I
Table 6-3
Form length control
Function
Advance paper to top of next page
Set the page length to n lines
Set the page length to n inches (ESC)“C”CHR$(O)CHR$(n)
Let’s set up a 7 inch high form length, which is typical of
many computer checks. The following program will do it.
10 ‘Demo of variable form lengths
20 LPRINT CHR$(27);“C”;CHR$(O):CHR$(7);
30 LPRINT “PAY TO THE ORDER OF : ”
40 LPRINT CHR$(12);
50 LPRINT “PAY TO THE ORDER OF : ”
60 END
Control code
CHR$(12)
(ESC)“C”CHR$(n)
This program should print
“PAY TO THE ORDER OF:”
twice, and they should be 7 inches apart. Line 20 sets the form
length to 7 inches. After line 30 prints, line 40 sends a form feed
advance the paper to the top of the next form. Line 50 then
prints its message.
After you have run this program, turn off the printer and ad-
just the top of form position. When you turn the printer back on
the page length will reset to its normal setting (usually 11
inches).
BOTTOM MARGIN
Many programs that you use a printer don’t keep track of
where they are printing on the page. This causes a problem
when you get to the bottom of a page because these programs
just keep on printing, right over the perforation. This makes it
very hard to read, especially if a line happens to fall right on the
perforation. And if you separate the pages then you are really in
trouble.
Of course your printer has a solution to this predicament. This
printer can keep track of the position on the page, and advance
the paper so that you won’t print too near the perforation. There
is a command to do this. The control codes to set and cancel are
given in the following table.
Table 6-4
Bottom margin commands
Function
Set bottom margin to n lines
Cancel bottom marain
Control code
(ESC)“N”CHR$(n)
(ESC)“O”
When you set the bottom margin with (ESC)“N”CHR$(n),
the value of n tells the printer how many blank lines should be
left at the bottom of the page.
Let’s try a simple application to see how these margins work.
Enter this program, which will print 150 lines without bottom
margins.
Demo of bottom margin
10 ’
40 LPRINT CHR.$(12);
' Form feed
50 FOR I=1 TO 150
60 LPRINT "THIS IS LINE";1
70 NEXT I
90 LPRINT CHR$(lZ);
' Form feed
100 END
When you run this program it will print 150 lines right down
the page and across the perforations. When it’s done line 90
sends a form feed to advance to the top of the next page. Look at
the lines that have printed near the perforations. Separate the
sheets and see if any of the lines have been torn in half. These
are the problems that the bottom margin will solve.
Now add the following lines to your program. (Don’t forget
the semicolons or you won’t get quite the same results that we
The first thing that this program does is to branch to the
subroutine that starts in line 70 . This subroutine prints 80 X’s
in a row. The first time that the subroutine is used, all the X’s fit
in one line. Then line 30 sets the left margin to 10, and line 40
sets the right margin to 70. Once again the subroutine is used,
but this time the X’s won’t all fit on one line since there is now
When you want to reset the margins to the default values, you
have two choices. You can either turn the printer off and back
64
on, or you can set margin values equal to the default values.
This means that you should set a left margin of 0 and right
margin of 136 in pica pitch.
If you change the pitch of your printing after you set your
margins, the margins will not change. They stay at the same
place on the page. So if you set the margins to give you 65 columns of printing when you are using pica type, then you change
to elite type you will have room for more than 65 columns of
elite printing between the margins.
HORIZONTAL AND VERTICAL TABS
Suppose you need to move across the page to a certain position several times in a document. It’s not much fun to type in
space after space. And you don’t have to - you can “tab” your
way across the page.
Your printer’s tabs are like those on a typewriter, but much
more powerful. You have both horizontal and vertical tabs
which can be used for both text and graphics - and they’re really handy for indenting paragraphs and making tables.
I
I
/
n Horizontal tabs
Horizontal tabs are set automatically every eight positions. To
move the print head to the next tab position, send CHR$(S).
Try this program to see how the default tabs work.
Even though the words are different length, they are spaced
out evenly by the horizontal tabs.
Now add the following line to your program to set different
horizontal tabs:
,
.
65
15 LPRINT CHR$(27);“D”;CHR$(7);CHR$(l4);CHR$(21);
CHRS(O) ;
(ESC)“D” is the command to begin setting horizontal tabs. It
must be followed by characters representing the positions that
you want the tabs set. In our program we are setting tabs in columns 7, 14, and 21. The CHR$(O) at the end ends the string of
tabs. In fact, any character that is not greater than the previous
one will stop setting tabs. This means that you must put all your
tab values in order, from least to greatest, or they won’t all get
set.
When you run the program now it produces this:
ONE
TWO THREE FOUR
The words are now closer together, but still evenly spaced.
To reset the default tabs, use the following program:
LPRINT CHR$ (27) ; “eO”CHR$ (8)
This command sets the horizontal tab to every eight columns.
Table 6-6
Horizontal tab commands
Function
Advance to next tab position
Set tabs at nl, n2, etc.
Set tabs every n columns
Control code
CHR$@)
(ESC)“D”CHR$(nl)
CHR$(nZ).....CHR$(O)
(ESC) “e” 0 CHR$(n)
n One-time horizontal tabs
Suppose you need to move to a position across the page, but
you only need to do it once. It doesn’t make much sense to set
up a tab to use only one time. There must be an easier way and of course there is.
The solution is called a one-time tab. Table 6-7 show the three
commands.
In this program, the print head is positioned before the “H” in
“Horizontal” is printed.
60 +++++ Horizontal tab.
62 +++++ Horizontal tab.
64 +++++ Horizontal tab.
66 +++++ Horizontal tab.
68 +++++
70 +++++
Horizontal tab.
Horizontal tab.
The relative horizontal tab command can move the print head
right from the current position. The formula for calculating how
much the print head moves is the same as in the absolute
horizontal tab command. However, the units by which the print
head actually moves vary with the print style you are using.
Table 6-8 shows the various options.
Table 6-8
Units of motion for the relative horizontal tab command
Vertical tabs have the same kinds of uses that horizontal tabs
do -theyjustworkinthe other direction.Horizontaltabs allow
you to reach a specific column on the page no matter where you
start from. Vertical tabs are the same. If you have a vertical tab
68
set at line 20, a vertical tab (or <VT>) will move you to line 20
whether you start from line 5 or line 19.
The vertical tab is not set at the power-on default. If you send
a CHR$(ll), which is the ASCII code for < VT > , before we
have set up tabs advance the paper one line. Enter this program
to see how this works.
(ESC)“B” is the command to set vertical tabs. Like the
horizontal tab setting command, tab positions must be defined
in ascending order. Our example sets vertical tabs at lines 10,
15,25 and 30. Then the CHR$(ll) in each of the following lines
advances the paper to the next vertical tab. The printout is
shown below.
FIRST TAB.
SECOND TAB.
THIRD TAB.
FOURTH TAB.
69
Add one more line to the program to demonstrate one more
feature of vertical tabs.
80 LPRINT CHR$(ll):"FIFTH TAB."
Now when you run the program the first page looks just like
before, but line 80 sends one more <VT > than there are tabs.
This doesn’t confuse your printer - it advances the paper to the
next tab position which happens to be the first tab position on
the next page. That’s nice, isn’t it?
There’s a one-time vertical tab command that works just like
the one-time horizontal tab command. Try this program how
these command work.
In this program, line 30 sends a one-time vertical tab with
(ESC) “f” 1 command. Line 50 sends a one-time horizontal tab
with (ESC) “f” 0 command. Finally, line 70 and line 80 send
one-time vertical tab and one-time horizontal tab, so the line 90
prints text at the specified position.
* 1st Line, 1st Column
* 4th Line, 1st Column
* 5th Line, 7th Column
* 8th Line, 5th Column
70
Table 6-9
Vertical tab commands
Function
Advance paper to next tab position
Set vertical tabs at nl, n.2, etc.
Set vertical tabs every n lines
One-time vertical tab
Control code
CHR$(ll)
(ESC)“B”CHR$(nl)
CHR$(nZ).....CHR$(O)
(ESC) “e” 1 CHR$(n)
(ESC) “f’ 1 CHR$(n)
W Vertical tab channels
Vertical tab channels are especially helpful in two situations.
The first occurs when you are writing a program to accompany
a preprinted form that can accommodate various types of
responces. The second occurs when you create a multipage
form or report with different vertical tabs on each page.
Table 6-10
Vertical tab channel commands
Function
Set vertical tabs at nl, ~2, etc.
as channel nO
Select vertical channel nO
Control code
(ESC)“b”CHR$(nO) CHR$(nl)
CHR$(nZ).....CHR$(O)
(ESC)“I”CHR$(nO)
You can store up to eight channels of tab stops. They are
numbered from 0 to 7. If you have already stored a set using
(ESC)“B” command, your printer has labelled it as channel 0.
Try this program how to see the vertical tab channels work.
120 LPRINT “2ND TAB OF CHANNEL’* ; I
130 LPRINT CHR$(12);
140 NEXT I
150 LPRINT CHR$(27) ;“@”
160 END
When you run this program you should get like this.
71
TOP OF FORM
1ST TAB OF CHANNEL 1
ZND TAB OF CHANNEL 1
TOP OF FORH
1ST TAB OF CHANNEL 2
2ND TAB OF CHANNEL 2
I
TOP OF FORH
1ST TAB OF CHANNEL 3
ZND TAB OF CHANNEL 3
I
In this program we set tabs at 10 and 20 in channel 1 in line
20. In line 30 we set tabs 15 and 25 in channel 2, and in line 40
we set tabs 17 and 28 in channel 3.
Because the channels are stored, you must make the printer to
recall one before you use it, so we used (ESC)“I”CHR$(nO) in
line 80.
72
MEMO
CHAPTER 7
SPECIAL FEATURES OF
THE PRINTER
Subjects we’ll cover in Chapter 7 include-
* Printer’s bell;
l Master reset;
l Uni-directional printing;
l International character sets;
l Printing BIG characters;
l The optional sheet feeder;
l Reading a hex dump.
In the previous chapters we have learned about several
groups of control codes. In this chapter we will look at more control codes. These codes don’t fit neatly into any of the groupings
that we have studied, but they add a lot of capability to your
printer. So here goes.
n Now hear this
You may have heard the printer’s bell if you have ever run out
of paper. And you may have wondered why it’s called a bell
when it beeps instead of ringing! It’s a long story that goes back
to the early days of computers, when teletype machines were used for computer terminals. These mechanical marvels had a bell
in them that could be heard for blocks. This bell was used to
signal the operator that somethings needed attention. The code
that the computer sent to the teletype machine to ring the bell
was, reasonably enough, called a bell code. Well the name bell
code is still with us, even if the bell has changed to a beeper, and
a lot of people still call the beeper a bell, even if it doesn’t sound
like one. So with our trivia lesson out of the way, let’s see how
we can ‘“ring the bell”.
The code to sound the “bell” is CHR$(7), which is ASCII code
7 or (BEL). Any time your printer receives this code it will
sound the bell for a quarter of a second. This can be used to re-
mind an operator to change the paper or to make another adjustment to the printer.
You can try this by typing:
LPRINT CHR$(7)
n Resetting the printer
Up to now when we wanted to reset the printer to the power
on condition we have had to either turn the printer off and then
on again, or to send the specific codes that reset the particular
features. There is an easier way. The control code (ESC) “62”
will reset all of the printer’s features to the power on condition
(as determined by the DIP switches), with one exception. This
exception is that (ESC) “62” will not erase any characters that
you have stored in the printer’s RAM memory.
In addition, if you set the “Panel” modes by the control panel
settings at the power on, these functions will be remain with this
control code.
n Putting your printer to sleep
You know how to put your printer off line with the On Line
key on the control panel. Your printer has another off line state
that can be controlled from your computer. When you turn the
printer off line from your computer, this printer will ignore
anything that you send it, except for the code to go on line again.
CHR$(lS) is the code to turn your printer off line; CHR$(17)
turns your printer to on line status.
n Printing the bottom of the sheet
Sometimes when you are using individual sheets of paper you
may want to print near the bottom of a sheet. The paper-out
detector usually stops the printer when you are about 1 inch
from the bottom of the sheet. This is notify you if you are running out of continuous paper.
Your printer has the ability to print right to the bottom of the
sheet. You can disable the paper-out detector so that it doesn’t
stop the printer. This will allow you to print to the end of the
sheet, and even beyond if you are not careful. The codes to control the paper-out detector, along with the other codes that we
have just learned are in the following table.
Table 7-1
Some miscellaneous commands
._~, ,.
75
Function
Sound bell
Master reset (ESC) “@”
---
I Off line
I On line
Paper-out detector off
Paper-out detector on
move mint head back one snace 1 CHI
.
Delete last character sent
Cancel text in print buffer
1 Immediate-mint on
1 Immediate-mint off
Cotitrol code
CHRW)
’ --lR$(19)
I CH
I CHI
@x17)
(ESC) “8”
(ESC) “9”
W8)
CHR$( 127)
CHR$(24)
’ .pSC) “i”1
I (E
I (ESC) “i”f 1
Add n dot spaces between characters 1 (ESC) CHR$(32) CHR$(n)
1 (ESC > “V” CHR$(n)
Repeat characters
CHR$(ml) ... CHR$(mx)
(ESC) “V” CHR$(O)
n Backspace, delete, and cancel text
Backspace (CHR$@)) “backs up” the printhead so that you
can print two characters right on top of each other. Each time
your printer receives a backspace it moves the printhead one
character to the left, instead of to the right. You can St&e over
multiple letters by sending more than one backspace code.
Delete (CHR$(127)) also “backs up” one character, but then it
“erases” the previous character (it’s erased from your printer’s
buffer, not from the paper).
Cancel text (CHR$(24)) deletes all the text in the print buffer;
that is, in the line before the delete text command. Since your
printer prints one line of text at a time, only that line will be
deleted.
The following program shows how these codes works.
BACKSPACE DOES NM WORK
DELETE DOES WORK
DOES NOT WORK
The backspace codes in line 30 move the printhead a total of
three spaces to the left so that the first part of line 40 will overprint the word “NOT”. The delete codes in line 60 “erase” the
three letters in the word “NOT” so that it doesn’t even print.
In line 90, CHR$(24) deletes the words in line 80. The
semicolon at the end of line 80 prevents a line feed from causing
that line to print before the printer receives the CHR$(24) code.
The text in line 100 prints as it normally would because it is
after CHR$(24).
n Immediate-print
This printer can print at fine rate of 250 characters per second. But it will also print more slowly at the speed of your typing. In immediate-$rint mode, the printhead prints one character
at a time, as you send it. This printer also moves the paper up so
that you can see the current line and then down to continue
printing.
You can turn immediate-print mode on with (ESC) “i” 1. But
before looking at it, let’s review the normal operation of the
print buffer. Enter this program.
20 A$="" :INPLJT
w TYPE A CHARACTER ",A$
30 IF A$="" THEN 50
40 LPRINT A$; : GOT0 20
50 LPRINT
: LPRINT CHR$(27);"@"
Now type several characters, and after each press the
RETURN key. True to form, the printer just stuffs the
characters into its buffer while it waits for a carriage return
code. (In this program the RETURN key doesn’t send a car-
77
riage return code.) To end this program and print the contents
of the buffer, press RETURN alone.
Now add this line:
10 LPRINT CHR$(27) ;"il";
And RUN the program. Your printer responds to your typing -
immediately.
When you are finished, press RETURN alone.
n Adjusting the width of space between characters
This printer provides a command that adjusts the space between all the characters that it prints when the DIP switch 2-2 is
set off. The (ESC) CHR$(32) CHR$(n) command adds blank
space between the characters. The units of space that are added
vary depending on the current print style, as shown in Table 7-
2.
Table 7-2
Unit of adjusting space width
Print style 1 Unit of motion
Draft characters 1 l/120-inch
1 LQ characters
1 l/MO-inch
1 LQ proportional characters 1 l/360-inch
Try this program to see how this works.
Demo of adjusting spaces
10 '
20 FOR I=5 TO 1 STEP -1
30 LPRINT CHR$(27);” “;CHR$(I);
40 LPRINT "This line is added";I;"spaces."
50 NEXT I
60 LPRINT CHR$(27) ;” “;CHR$(O) ;
70 LPRINT "This line is Normal space."
80 END
This line is
This line is added 4 spaces.
This line is added 3 spaces.
This line is added 2 spaces.
This line is added 1 spaces.
This line is Normal space.
added 5 spaces.
I
78
This command can be used to produce micro-justification,
which is a method of justifying lines by increasing the space be-
tween each character.
n Repeat characters
This printer has a command that automatically repeats
characters for you. Try this program to see how it works.
10 '
Demo of character repeat
20 LPRINT CHR$(27);"V";CHR$(4);
30 LPRINT "This line shows Repeat characters."
40 LPRINT CHR$(27);"V";CHR$(O);
50 LPRINT "And this is not."
60 END
In this program, line 20 selects the 4 times repeat with (ESC)
7” CHR$(4) command. And line 30 sets the characters for
repeating. Then line 40 terminates this command with (ESC)
“V” CHR$(O). The results from this program look like this.
This line shows Repeat characters.
This line shows Repeat characters.
This line shows Repeat characters.
This line shows Repeat characters.
And this is not.
n Uni-directional printing
Uni-directional printing is a big word that means printing in
~lle direction only. Your printer normally prints when the printhead is moving in both directions. But once in a while you may
have an application where you are more concerned about how
the vertical lines align than with how fast it prints. This printer
lets you make this choice. The table below shows the commands
for controlling how this printer prints.
Table 7-3
Printing direction commands
Function
Print in one direction
Print in both directions
One time print in one direction
Control code
(ESC)“U"l
(ESC) “U"0
(ESC) “("
,
L
Try this program to see the difference that printing in one
direction makes.
Uni-directional printing
10 ’
20 LPRINT CHR$(27);“A”;CHR$(6);
30 LPRINT CHR$(27) ;“2”;
40 FOR I=1 TO 10
50 LPRINT ” I ”
60 NEXT I
70 LPRINT :LPRINT
80 LPRINT CHR$(27) ;“Ul”;
90 FOR I=1 TO 10
100 LPRINT “I ”
110 NEXT I
120 LPRINT CHR$(12);CHR$(27);“@”
Here is what you will get. The top line is printed bi-directionally, and the bottom is printed uni-directionally. You will have to
look hard because there isn’t much difference.
Let’s analyze the program. Line 20 defines the line spacing to
6/60 of an inch so that the characters that we print will touch top
to bottom, and line 30 activates the definition. Lines 40 - 60
print 10 vertical line characters. Then line 80 sets one-direction
printing and the vertical lines are printed again. Finally line 120
sends a form feed to advance the paper to the top of a new page,
and then uses the master reset to restore the printer to the
8n
power on condition.
You can also set the printer to print in one direction for one
line only by using the (ESC) “(” command. This command immediately moves the printhead to the left margin and then
prints the remainder of the line from left to right.
H The seven bit dilemma
Certain computers (but not the IBM-PC fortunately!) don’t
have the capability to send eight bits on their parallel interface.
They can only send seven bits. This would make it impossible
for these computers to use this printer’s block graphics
characters and special symbols if our engineers hadn’t thought
of a solution. (All of these characters have ASCII codes greater
than 127 which means that the eighth bit must be on to use
them.) The solution lies in the three control codes given in the
following table:
Table 7-4
Eighth bit controls
H Block graphics characters and special symbols
Besides the upper and lower case letters and symbols that we
are by now familiar with, your printer has a whole different set
of characters that are for special uses. These characters include
block graphics for drawing forms and graphs, and special symbols for mathematical, engineering and professional uses. The
special characters are included in two character sets. The
character set you normally use is called character set #l. The
special characters are printed out when you send ASCII codes
160-255 to the printer.
Your printer also offers character set #2 which is almost the
same as character set #1 except for the addition of ASCII codes
3-6,21, and 128-159. Character set #2 is selected with (ESC)
“6”; to go back to character set #1, use (ESC)“7”.
You can also specify the power-on default character set by set-
ting DIP switch l-5 on for character set #1 and off for character
set #2 while the DIP switch 2-2 is set on. The following program
will print out all of the graphics characters available:
10 LPRINT CHR$(27);"0";
20 LPRINT CHR$(27);"6";
30 FOR J=3 TO 6
40 LPRINT '*
";J;CHR$(J);CHR$(9);
50 NEXT J
60 LPRINT '* 21 ";CHR$(21)
70 LPRINT
80 FOR J=128 TO 254 STEP 5
90 FOR I=J TO J+4
95 IF I>254 THEN 110
100 LPRINT I;CHR$(I);CHR$(9);
110 NEXT I
120 LPRINT :LPRINT
130 NEXT J
Figure 7-l shows what this program will print. If your chart
doesn’t look like this because it has regular letters and numbers
instead of the special symbols, then your computer is only using
seven bits (unless you have set DIP switches 2-2 and 2-5 off by
mistake). You can get the correct printout by changing line 100
to this:
138 &
143 A
148 ii
153 ij
158 pt
163 13
168 i
173 i
178 1
183 1
188 3
193 -l198 f=
203 ii=
4+
129 ii
134 a
139 i;
144 E
149 b
154 ii
159 f
164 A
169 c
174 a
179 1
184 1
189 J,
194 T
ILgg It
204 11
5+
130 6
135 c
140 i
145 ae
150 G
155 c
160 B
165 N
170 7
175 >>
180 1
185 jl
190 d
195 t
200 I!=
205 =
64
131 6
136 6
141 1
146 E
151 ii
156 f
161 i
166 B
171 +
176 III
181 j
186 II
191 1
196 -
201 r
206 jl
21 §
132 g
137 ti
142 A
147 6
152 y
157 v
162 6
167 Q
172 +
177 1
182 II
187 il
192 L
197 t
202 -'L
207 r
208 JL
213 r
218 r
223 228 C
233 8
238 E
243 I
248 O
253 2
209 $
214 r
219 4
224 a
229 CJ
234 i-2
239 n
244 f
249 l
254 .
210 T
215 -f
220 g
225 B
230 /A
235 6
240 E
245 J
250 -
L
Figure 7-1. Character set #2
211 IL
216 f
221 1
226 I'
231 'c
236 co
241 f
246 f
251 $
212 b
217 -)
222 [
227 T
232 9
237 8
242 2
247 =
252 n
83
If you have a 7-bit interface, add the following lines to the pro-
gram given above:
15 LPRINT CHR$(27);">";
95 LPRINT CHR$(27);"="
In this program line 10 selects character set #2 so that all the
graphics characters can be used (including the “club” symbol).
Then lines 20-80 print the 5 of clubs figure. Line 90 cancels
character set #2 (which is the same as selecting character set
#l).
Here is what this program prints:
n International character sets
Your printer is a multi-lingual printer for it can speak in
eleven languages! Your printer changes languages by changing
12 characters that are different for the different languages.
These sets of characters are called international character sets.
The control codes to select the international character sets are
given in Table 7-5.
Table 7-5
International character set commands
84
The characters that change are shown
code in Table 7-6.
Table 7-6
International character
n Printing BIG characters
You can even enlarge your character sets for attention-grabbing headings or special effects. There are two commands you
can use. Everything following any of them will be enlarged as
shown below, until the cancel code is entered.
When you run this program, you will get like this:
” SIZED PRINTING.”
-DOUBLE
THIS IS
SIZED PRINTING.
QUAD SIZED PRINTING .
As you can see, when the big character command is used, the
baseline for each character does not align. When you want to
align the baseline, try this program:
10 ’ Demo of aliging big characters
20 LPRINT CHR$ (27) ; “-1” ;
30 LPRINT “THIS IS “;
40 LPRINT CHR$(27);“j”;CHR$(24);
50 LPRINT CHR$(27) :“h”;CHR$( 1) ;
60 LPRI NT “DOUBLE” ;
When you run this program, you will get like this:
86
THIS IS
THIS IS
n g-pin graphics emulation mode
As you had learned in Chapter 2, this printer has a unique 9-
pin graphics emulation mode.
You can select this mode with a control code - (ESC)“g”.
After you’ve entered into the g-pin graphics emulation mode,
following commands work in the same manner for the g-pin
printers, as shown below:
(ESC)“A” n - Sets or defines line spacing to n/72 inch.
(ESC)“3” n
(ESC>“J” n
(ESC)“j” n - Sends a one-time reverse feed of n/216 inch.
In addition, the relationship between the dot graphics data
and the pins in the print head will be changed to suit for g-pin
printers.
Note: You must turn off the power switch to cancel this mode.
DOUBLE
SIZED PRINTING.
QUAI) SIZED PRINTING
- Sets line spacing to n/216 inch.
- Sends a one-time paper feed of n/216 inch.
.
n The optional sheet feeder
The automatic sheet feeder is a handy option that feeds single
cut sheets automatically. Work done on cut sheets looks better
that done on computer paper, and you don’t have to tear the
“ears” off each sheet as you must with fan-fold paper.
The automatic sheet feeder feeds a new sheet automatically
every time the printer receives or generates a form feed. Any
time you wish, you can turn the auto-feed unit on and off by
using control codes.
Table 7-8
Automatic sheet feeder commands
Function
Select automatic feed mode
Cancel automatic feed mode
Insert paper from first bin
Insert paper from second bin
Eject paper
Control code
(ESC)CHR$(25) CHR$(4) or “((4))”
(ESC)CHR$(25) CHR$(O) or “((0))”
(ESC)CHR$(25) CHR$(l) or “((1))”
(ESC)CHR$(25) CHR$(2) or “((2))”
(ESC)CHR$(25)“R” or “((R))”
87
When the automatic sheet feeder is installed, you must set the
DIP switch 2-4 on to detect the paper-out condition.
In addition, following functions are ignored when the auto-
matic sheet feeder is installed:
Setting of the page length
Top and bottom margins
Vertical tab settings
Caution: The five-character commands (e.g. “((0))“) work as the
.
.
automatic sheet feeder control codes whenever the automatic
sheet feeder is mounted on the printer (e.g. LLISTing).
On the other hand, the automatic sheet feeder is not mounted on
the printer, those five characters are printed as regular
characters.
n Reading a hex dump
We’ve seen how to make a hex dump in Chapter 2, but it’s not
really clear what we can do with one. We need a little
background first.
The BASIC in some computers changes ASCII codes before
they send them to the printer. If you run into problem because
of this, try this hex dump to check the ASCII codes.
First turn off the printer and run the following program. Hold
down both the Paper Feed key and Mode key and turn on the
printer.
; L.
10 FOR I=0 TO 255
20 LPRINT CHR$(I)
30 NEXT I
40 LPRINT
50 END
L
If your system passes the codes directly to the printer without
changing them, you will get like this. (You can print out the last
remaining line in the print buffer by putting the printer off line
with the On Line key.)
Most BASICS, however, are not quite that straight forward.
For example, the IBM-PC prints like the following.
Notice that your printer is receiving decimal code 13 (hex OD)
is coming with hex OA, which is really decimal 10. In addition,
your printer does not receive decimal code 26 (hex 1A).
Your printer prints hex numbers 16 per line, with printing the
characters on the right side. If it receives less than 16, it sits in a
holding pattern, awaiting more data. Taking the printer off line
dumps the characters to the paper.
To debug a program quickly, just use the hex dump capability. Appendix B will help you translate the hex codes to ASCII
equivalents.
-
-
-
CHAPTER 8
CREATING YOUR
OWN CHARACTERS
Subjects we’ll cover in Chapter 8 include-
* Designing your own characters;
l Printing your own characters;
l Print mode and the download characters.
In the previous chapters of this manual you’ve learned how to
control the printer to give dozens of different typefaces. By using various combinations of pitches, character weights, and font
selections, you can create nearly any effect you want to in text.
And with international character sets and the special text and
big characters described in Chapter 7, you can print almost any
character you think of.
But if “almost any character” isn’t good enough for you, then
it’s a good idea you have this printer! With it you can actually
create your own characters. As you’ll see in this chapter,
download characters can be used to print a logo, special
characters for foreign languages, scientific and professional applications, or any other specific printing task.
DOT MATRIX PRINTING
In order to create download characters, you’ll need some
understanding of how dot matrix printers work. The process is
called dot-matrix printing because each character is composed
of small dots arranged on a matrix, or grid. To see how that
character grid gets printed, you need to take a look at the print
head itself.
The printhead in this printer contains 24 wires apparently arranged in a vertical column. If you were to remove the print
head and look at the wires, you would see two staggered columns of twelve wires. However, the timing is such that they
print as one continuous column of 24 wires.
90
Figure 8-1 shows an enlarged schematic view of the front of
the printhead, showing the ends of the wires and their relationship to the draft characters. As you can see, the capital letters
use the top eighteen wires of the printhead, and the descenders
(such as the lower case “p” shown) use the bottom eighteen
pins. As the printhead moves across the page (in either direction
- that’s what is meant by bi-directional printing) it prints one
column of dots at a time. Each time a dot is supposed to print an
electromagnet inside the printhead causes the appropriate wire
to strike the ribbon (making this printer an impact printer).
3
O0
O0
O0
O0
O0
-
O0
O0
O0
0
OO
OO
?igure 8-l. As the printhead moves across the page, each of the
wires prints one row of dots.
THE PRINT MATRIX
All of the standard characters that this printer prints are formed from patterns of dots that are permanently stored in the
printer’s ROM (read-only memory). This includes all of the
standard ASCII characters, and special characters, the international character sets, and the LQ characters.
91
But there is another area of memory in this printer reserved
for user-defined characters. These are characters that you can
design and download into the printer. When download
characters are defined they are stored in RAM(random access
memory), which allows you to define or modify them at any
time.
Each of these draft characters, whether it is from the standard
ROM or in download RAM, is constructed on a grid which is
five “boxes” by twenty-four “boxes” high. In addition, a dot can
straddle any of the vertical lines. As an example, take a look at
the enlarged “9” superimposed on the grid in Figure 8-2. As you
can see, some dots are inside the boxes, and some are centered
on the vertical lines. This, in effect, makes the character grid 9
dots wide by 24 dots high.
Figure 8-2.
Dots can be inside boxes or straddle the vertical lines
of the grid.
DEFINING YOUR OWN CHARACTERS
You’ve seen how these characters are designed by using a
grid to layout the dots. Now you can define characters exactly
92
the same way. Make up some grids (photocopy Figure 8-3 if you
wish) and get ready to be creative! (Just in case you are not feeling creative, and to make our explanations a little clearer, we’ll
be using a picture of an automobile as an example of a draft
download character. You can see how we’ve laid it out in Figure
8-4. Later in this chapter we’ll use this character to create a
small graph.)
1st
byte
Figure
2nd
byte
J
3rd
byte
i
8-3.
128
64
32 32
16 16
8 8
4 4
2 2
1 1
OL
16
8
4
?
Use this grid (or one similar to it) to define your own
ASCII code:
Left space:
Right space:
Data
1st:
2nd:
3rd:
4th:
5th:
6th:
7th:
8th:
9th:
draft characters.
You’ll notice that Figure 8-3 includes a lot of information
around the grid. Don’t be intimidated; we’ll explain each item as
we come to it in our discussion of defining and actually printing
download characters.
n Rule 1: Dots cannot overlap
As you can see in Figure 8-4 our car has a nearly continuous
outline. But, you may ask, why not make it a really solid line and
print all the intermediate dots, as shown in Figure 8-5? Because
the dots that straddle the vertical lines in the grid actually
overlap those inside the boxes. If we tried to print overlapping
i
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.