Commodore MPS1200 a

Page 1
COMMODORE
.......
mps
DOTMATRIX PRINTER
users guide
Page 2
FOR USERS IN UK
WARNING: THIS APPARATUS MUST BE EARTHED ! IMPORTANT. The wires in this mains lead are coloured in accordance with the fol
Green and yellow Earth Blue Neutral Brown Live
As the colours of the wires in the mains lead of this apparatus may not correspond with the coloured marking identifying the terminals in your plug, proceed as follows:
The wire which is coloured green and yellow must be connected to the terminal in the plug which is marked by the letter E or by the safety earth symbol or coloured green or green and yellow.
The wire which is coloured blue must be connected to the terminal which is marked with the letter N or coloured black.
The wire which is coloured brown must be connected to the terminal which is marked with the letter L or coloured red.
Page 3
Commodore MPS 1200"
Users Manual
Page 4
Copyright 1986 by Commodore Electronics Limited Copyright 1985 by Citizen America Corporation All rights reserved.
This manual contains copyrighted and proprietary information. No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior written permission of Commodore Electronics Limited.
Commodore BASIC
Copyright 1985 by Commodore Electronics Limited All rights reserved. Copyright 1977 by Microsoft Corp.
All rights reserved.
Trademark Acknowledgements
Epson and Epson FX: Epson America, Inc. Jane: Arktronics Corporation
Print Shop: Broderbund Software, Inc.
Com mod ore MPS 1200 and MPS 1200 are trademarks of Commodore Electro nics Limited
Page 5
Introduction
In this manual, youll find out all about the MPS 1200s many printing functions: how you can print in regular draft letters or in near letter quality characters, as well as expanded, compressed, emphasized and doublestrike print, italics, superscripts and sub scripts. Additional features like reverse printing, double-height and international characters are also explained.
This printer has eight national character sets, corresponding to the Com modore 128 computer. These eight national character sets are as follows:
1. USA/UK/Netherlands, 2. Denmark/Norway, 3. Sweden/Finland,
4. Germany, 5. France/Belgium, 6. Italy, 7. Switzerland, 8. Spain.
Youll learn about designing your own characters and creating graphics on your MPS 1200, using your printer as either a Commo dore-compatible or Epson FX printer.
The MPS 1200 Users Manual is written not just for the program mer, but also for the non-programmer who wants professional printing results.
Before you unpack your printer (no matter which type of user you are), you should begin by reading Chapter 1. It tells you how to unpack and set up your printer correctly.
When you have the MPS 1200 set up and connected to your computer, read Chapter 2. It explains important things youll need to know to get the most out of your MPS 1200, such as how dot matrix printing works, how Commodore BASIC is used with your printer, and how your printer interacts with software.
If you plan to use your printer just with store-bought software and have no interest in programming, you only need to read the
Page 6
parts relevant to software in Chapter 2, then you can skip ahead to Appendix A to learn about printer maintenance.
If you plan to do your own programming or custom design graphics, you should read the entire book.
Chapters 3 through 9 explain about all the MPS 1200s features, with examples of control codes and escape sequences in programs you can type in and use right away. These programs demonstrate what each effect looks like and the proper syntax for the com mands.
No matter what the level of your computer skills, youll find the MPS 1200 printer to be a versatile high-quality printer that will suit your needs exactly.
Page 7
TABLE OF CONTENTS
Introduction i
Chapter 1 SETUP 1-1
Printer Location Unpacking and Assembly
Installing the Ribbon Installing the Paper Guide Installing the Printer Cover
Getting Acquainted
Printer Components The Control Panel
Control Panel Procedure
Selecting and Loading Paper
The Paper Select Lever Loading Single Sheets Installing the Tractor-Feed Loading Continuous Paper
Bottom-Feeding Continuous Paper Paper Thickness
The Printer Self-Test
The Maintenance Self-Test Connecting Your Computer Internal (DIP) Switches
Chapter 2 PRINTER BASICS 2-1
Dot Matrix Printing ASCII Codes Hexadecimal Numbers PET ASCII Codes Notes on Commodore BASIC
Secondary Addresses Choosing a Font with the Secondary Address
Control Codes and Escape Sequences
Printer Installation
Choosing the Right Configuration Software Printer Choices
Page 8
Word Processors
Literal Characters Spreadsheets, Databases, and Other Programs Initializing the Printer
Chapter 3 PRINTING TEXT 3-1
Near Letter Quality Character Print Width
Pitch
Pica Pitch
Elite Pitch
Expanded Print
One-line Expanded Print Compressed Print
Compressed Expanded Print Proportional Print Proportional Spacing
Justified Printing
Print Density
Emphasized Print
Doublestrike Print
Special Effects
Italics
Underlining
Reverse Print
Superscript
Subscript
Character Height
Vertically Enlarged Print The Master Commands
Master Reset
Master Pitch
Master Print Mode
Special Characters and Symbols
International Character Sets
Switching Configurations
Chapter 4 PAGE FORMATTING 4-1
The End of the Line
Carriage Return Line Feed A Note About BASIC
Line Spacing
Fixed Line Spacing
1/6 Inch Line Spacing 1/8 Inch Line Spacing
7/72 Inch Line Spacing
Page 9
Variable Line Spacing
Line Spacing of n/72 Inch Line Spacing of n/144 Inch Line Spacing of n/216 Inch A Variable Line Spacing Example
Variable Line Feeds
Line Feed of n/216 Inch
Page Design
New Page (Form Feed)
Page Length
Set Page Length By Lines
Set Page Length By Inches Margins
Top and Bottom Margins
Left Margin
Right Margin
Chapter 5 USING TABS 5-1
Horizontal Tabs
Move to Next Htab
Set Fixed Htabs
Variable Htabs
Relative Htab Dot Tabs
Relative Dot Tabs Vertical Tabs (Vtabs)
Move to Next Vtab
Fixed Vtabs
Variable Vtabs
Relative Vtab Vtab Channels
Define Vtab Channel
Select Vtab Channel
Chapter 6 EPSON MODE GRAPHICS 6-1
Introduction to Dot Graphics
Graphic Commands
Pin Numbers Graphics Density Line Length: Number of Columns Putting It All Together
Graphics for Special Applications
Master Graphics Command Changing Graphic Density Nine-pin Graphics
Page 10
Chapter 7
Chapter 8
Chapter 9
Appendix A Appendix B
Appendix C Appendix D Appendix E Index
Designing Graphics
Defining Shapes
Calculated Shapes (Plotting) COMMODORE DOT GRAPHICS 7-1 Bit Image Coding
Combining Bit Images to Form a Larger Image
All Bit Pattern Printing
Repeat Bit Image Printing
Dot Address Determination CREATING CHARACTERS 8-1 How the MPS 1200 Prints Characters
Designing Your Own Characters
Copying Standard Characters Saving Character Designs in the MPS 1200s Memory Attribute Byte Data Bytes
Printing Defined Characters
Special Effects ODDS AND ENDS 9-1 Local Character Set Selection Quote Mode Buffer Commands
Delete
Cancel
Master Reset
Backspace Unidirectional Print
Continuous Unidirectional Print
One-Line Unidirectional Print
Slashed Zero Paper Out Sensor The Eighth Bit
Eighth Bit On Eighth Bit Off
Cancel Eighth Bit Control Hex Dump Maintenance A-l MPS 1200 Character Sets
B-l Command Reference C-l The Internal (DIP) Switches
D-l
Technical Specifications E-l
Page 11
Chapter 1
Setup
This chapter will explain how to set up your MPS 1200 printer. Youll see how to pick a suitable location for your printer and unpack its components. Youll also learn how to install the ribbon, load paper and connect the printer to your computer.
PRINTER LOCATION
Before you set up your printer, you should think about the best location for it. Near your computer is a pretty good start, but there are a few other considerations you should take into account:
Choose a flat, sturdy surface with enough room for the paper to be fed freely into and flow out of the printer. If you use continu ous fanfold paper, youll need enough room behind the printer (or underneath with bottom-feeding) for a stack of paper.
Position the printer so its power cord and connection to the computer wont interfere with the paper flow.
If youre putting the printer on a wood surface, place a protective
mat between the printer and the surface to prevent possible
damage to the surface.
Avoid areas subject to excessive heat (such as direct sunlight), humidity, dust or grease.
Connect the printer to a steady source of electricity. Motors and
many appliances (like copiers, heaters, refrigerators and air con ditioners) cause fluctuations in the power line. You may want to use a surge protector which guards against power fluctuations. There are many good ones available.
1-1
Page 12
UNPACKING AND ASSEMBLY
When you unpack your MPS 1200, save the packing materials. They are specially designed to protect the printer, and will be useful in the event you need to ship it.
In the box, you should find the items shown below (in addition to this manual). If anything is missing or appears damaged, contact your dealer immediately.
Make sure you take the time to fill out and send the warranty card now, since it registers you as an MPS 1200 owner and validates
your warranty.
Figure 1-1. Inside the carton, you should find: 1) Printer, 2) tractor- feed unit, 3) paper guide, 4) power cord, 5) serial cable, 6) User’s Manual, 7) ribbon cartridge.
1-2
Page 13
Installing the Ribbon
The printer ribbon is a black plastic cartridge, and will be easy to install. Take the printer ribbon out of its packing materials, and open the printer cover. Holding the cartridge so the round knob is facing up and on the left side, place the cartridge in the printer as shown in
Figure 1-2. Gently push the cartridge down until it snaps into place. Slide the ribbon into place between the print head and the metal
ribbon guide. (To make this easier, the print head should be posi tioned near the center of the printer.) Remove any slack in the ribbon by turning the small plastic knob counterclockwise, then close the printer cover.
1-3
Page 14
CAUTION: When replacing a ribbon cartridge, turn the power off and
slide the print head to the right edge before removing the old ribbon, to avoid damaging the print head.
Installing the Paper Guide
The paper guide is a plastic incline with two sliding pieces on the front. The guide fits into a groove toward the back of the printer
and is used to lead sheets of paper into the printer. The sliding pieces guide the paper into the platen and keep it from getting crooked as it advances.
To install the paper guide, slide it into the lip at the rear of the printer at a 45 degree angle (see Figure 1-3). Once it fits securely into the lip, let it rest on the knobs on the back of the printer.
Figure 1-3. Installing the paper guide.
1-4
Page 15
Installing the Printer Cover
With the ribbon installed, you can replace the plastic cover on the printer. Hold the cover at a 45 degree angle (see Figure 1-4) and insert the two slots onto the tabs in the printer case. Now press down on the back edge of the cover until it snaps into place.
Figure 1-4. Installing the printer cover.
The printer cover has three basic positions: completely closed (dur ing printer operation), completely open (to access the inside of the printer) and halfway (for removing the cover from the printer).
1-5
Page 16
GETTING ACQUAINTED
Now that weve gotten this far, its time to take a look at the
features and functions of some of the components of the MPS 1200. These are shown below.
Figure 1-5. MPS 1200 printer components and controls.
Printer Components
Power switch
This switch, located on the lower left side near the front, is used to turn the printer on and off.
Platen
The platen is the hard rubber cylinder that carries the paper to the print head.
Paper feed knob
The paper feed knob, located on the right side of the printer, turns the platen. You can manually advance the paper by turning this knob.
1-6
Page 17
Paper select lever
This lever adjusts the pressure on the platen, according to the type of paper being used. This lever is located on the top right of the printer, near the back.
The paper select lever has two positions, front and back. The front position is used for single sheets or continuous paper
without the tractor-feed. The back position is used when you have installed the tractor-feed.
Paper thickness lever
The paper thickness lever is used to adjust the distance between the print head and the platen to accommodate forms with up to three carbonless copies. This lever is located in front of the platen (under the printer cover) on the right.
Printer cover
The printer cover serves many functionsas a dust cover, noise
buffer, paper bail and paper cutter. It protects the MPS 1200 from dust while reducing the sound level during printing. On the inside, the cover has a bar with three rollers, which holds the paper against the platen. And a special beveled edge serves as a paper cutter for tearing off sheets.
Paper guide
The adjustable sliders on the paper guide let you set the width for the paper to be fed into the printer. This will keep the paper flow going smoothly, without allowing the paper to shift or be fed unevenly.
The Control Panel
The control panel is located on the right front of the MPS 1200. It contains four rectangular blocks, one panel with three status lights and three touch switches.
POWER PAPER OUT READY
ONUNE
LF
III
Figure 1-6: The MPS 1200 control panel.
1-7
Page 18
Power light
The power light glows green when the printer is on.
Ready light
The ready light glows green when the printer is ready to accept data from the computer. During normal printing, it flickers as the printer tells the computer to start and stop sending data. This flicker is normal.
Paper out light
The paper out light flashes red when the printer is out of paper.
On-line Switch
The on-line switch determines whether the printer is controlled by
the computer and is able to receive data, or is controlled by the other switches on the printer. When the ready light is green, the printer is on-line and the computer controls the printer. When this light is off, the printer is off-line” and the other control panel switches can be used while information from the computer is suspended.
LF (Line Feed) Switch
This switch advances the paper one line each time it is pressed when the computer is off-line. Continuously holding down the switch allows you to advance the paper as far as you like.
FF (Form Feed) Switch
When the printer is off-line, pressing the FF switch advances the paper to the top of the next page.
The control panel switches are also important because they play a key role in turning on some of the MPS 1200s special features like the printer and maintenance self-tests and hex dump, described later in this manual.
CONTROL PANEL PROCEDURE
The control panel can enable you to print in many different type styles (known as fonts).
To enter font select mode, press and hold down the FF switch on
the control panel and press the On-line switch (while still holding down the FF switch).
1-8
Page 19
The Ready light starts flashing, and the different fonts may now be selected. To access each of the fonts shown below, press the On line switch the appropriate number of times. For example, if you want to print in italics, press the On-line switch twice. Each time you press the On-line switch, the Paper Out light flashes in red.
FONT SELECT (# On-line presses) PICA 0 NEAR LETTER QUALITY
(NLQ) 1 ITALIC 2 EMPHASIZED 3 COMPRESSED 4
When youve selected the desired font, press and release the FF switch. Then press the LF switch, which takes the MPS 1200 out of font select mode and back to normal printer operation, with the Ready light glowing green.
You can select combinations of fonts in this manner. For instance, you can select emphasized italic by entering one font, and then repeat the procedure to enter a second style (or even third or fourth). To return to normal printing, either reselect PICA by entering font select mode and exiting without pressing On-line (0
On-line presses), or turn the printer off then on again.
You can also access the NLQ font without entering font select
mode, by pressing and holding the LF switch and then pressing and
holding the On-line switch. When you release them, the printer
prints in NLQ style. To print draft characters again, just repeat this
procedure.
SELECTING AND LOADING PAPER
You can use either single sheets or continuous fan-fold paper with
your MPS 1200. Fan-fold paper, also known as pin-feed or con
tinuous paper, is probably when you think of as computer paper.
It comes in sheafs of continuous perforated sheets with holes
punched along the side. It is available plain or with lines or stripes
in various colors.
Continuous letterheads, pre-printed forms, labels and envelopes can also be used with the MPS 1200. The MPS 1200 can handle any of these, up to ten inches in width.
1-9
Page 20
The Paper Select Lever
The paper select lever (shown in Figure 1-7) sets the type of paper
feed the printer uses. In the forward position, it uses friction feed.
Friction feed increases the pressure on the platen so the paper is automatically fed by friction as the platen turns. This is used with single sheets, and when the tractor-feed is not in place.
The back position (labeled PIN) activates the tractor feed. It is used with continuous paper when the tractor-feed is installed. This setting releases the pressure on the platen and allows the paper to be fed by the pins on the sprockets on each side of the paper. The back position can also be used to allow adjustment or alignment of the paper, since it releases the pressure on the platen thats holding down the paper.
Figure 1-7. The paper select level has two positions for loading different types of paper.
Loading Single Sheets
This is pretty similar to loading paper into a typewriter; maybe its
a little easier due to the paper guide on the back of the printer. Heres how:
1. Move the paper select lever forward.
1-10
Page 21
2. Insert a sheet of paper into the slot behind the platen. The paper should slide in about one inch.
If you have the paper guide installed, set the two sliding guides to where you want to position the paper and the width of the paper; slide the paper in under the platen via the guide.
3. Turn the paper feed knob.
4. If necessary, make any adjustments by setting the paper select
switch back, repositioning the paper, and moving the paper select switch forward again.
You can also load paper using the LF switch:
1. If you havent already done so, plug in the power cord.
2. Turn the power switch on. The Power light should come on,
and the Paper Out light should flash. The Ready light will be out, meaning the printer is off-line and able to respond to control panel commands.
3. Move the paper select level forward and insert a sheet of paper
into the slot, via the paper guide if youve installed it.
4. Press and hold the LF switch until the paper has been fed to the
position you want. Or press the FF switch once, which func tions as an automatic sheet load, advancing the paper to about one inch above the first print line.
5. If necessary, make any adjustments by setting the paper select switch back, repositioning the paper, and moving the paper select switch forward again.
6. Press the On-line switch; the Paper Out light goes off and the Ready light turns on, signifying that the printer is now on-line and ready to go.
1-11
Page 22
Installing the Tractor-Feed
The tractor-feed unit is used with continuous paper, labels or forms, and is quite easy to install. It uses two sprockets, which can slide back and forth to adjust to paper width. These can be locked into position by flipping the locking levers on the back of the sprockets. The holes along the edges on each side of the paper fit into pins on these sprockets to feed the paper straight and evenly
through the printer.
Figure 1-8. Components of the tractor-feed mechanism.
The flip-up covers on the tractor clamp the paper into place on the pins. With each line feed, the pins move and pull the paper around the platen and through the printer. Paper supports, which can be moved left or right, guide the paper out of the tractor feed.
Heres how to install the tractor-feed:
1. Remove the printer cover and paper guide. You can just lean the cover in the up position if you like.
1-12
Page 23
2. Push in the two release levers on the back of each end of the tractor-feed, and place the plastic hooks on the bottom of the tractor into the tabs on the printer. The casing of the printer is shaped to accommodate the tractor-feed, which makes it easy to place in the correct position.
3. When youve set the tractor-feed in position on the printer, you can now let go of the release levers to lock the unit into place.
4. Install the paper supports and space them evenly on the tractor unit. You can replace the printer cover if you like.
1 Release lever on the back
Figure 1-9. Installing the tractor-feed unit.
1-13
Page 24
Loading Continuous Paper
Continuous paper can be loaded through the rear of the printer or through the bottom of the printer.
Heres how to load continuous paper from the rear of the printer
just below the platen:
1. Remove or lean the printer cover forward.
2. Turn the power switch off and slide the print head to the left.
3. Move the paper select lever forward and open the tractor covers.
4. Flip the locking levers forward and move the tractors to the approximate positions for the paper width. Adjust the paper supports so they are evenly spaced.
5. Place a stack of paper on a level surface behind the printer. Bring
the top sheet of the paper forward and insert it into the platen, as you would insert a single sheet.
6. Turn the paper knob until the paper advances past the metal
ribbon guide. Move the paper release lever back to the PIN position (allowing the paper to be moved freely).
7. Fit the punched holes on the paper onto the pins on the tractors,
moving the tractors to accommodate the width of the paper. Close the tractor covers to hold the paper in the pins.
8. Turn the paper feed knob until the perforation of the paper is lined up with the top of the ribbon guide. This will assure that you always start printing at the top of the next page.
1-14
Page 25
Figure 1-10. Align the top of the paper and the print head.
9. Adjust the paper left or right by sliding the tractor. When the
paper is positioned (usually the left edge is aligned with the print head), lock the tractors in place by flipping back the locking levers on the back of the tractor unit.
10. Replace the printer cover and turn on the power switch. Youre ready to start printing.
The placement of the feed paper stack and the output pile is impor tant for smooth feeding and printer operation. The feed paper stack must be placed either behind or below the back of the printer so the paper can flow smoothly into the printer without interfering with what comes out.
Wherever you place it, make sure the paper can feed into the printer in a straight line. If the stack is off-center, it may cause the paper to
misfeed. A typical setup for paper feeding is shown in Figure 1-11.
Page 26
Figure 1-11. A typical setup for printing with continuous paper.
Bottom-Feeding Continuous Paper
Bottom-feeding continuous paper is useful when you have a printer stand which allows you to place a stack of paper underneath. However, its important that the paper flows freely to avoid a misfeed.
Loading bottom-feed paper is very similar to loading paper into the rear of the printer. Follow all the steps described above, but load the paper into the bottom slot of the printer instead of the rear. When you turn the paper feed knob, the paper flows from under neath the platen instead of through the back. Then you can place your output pile directly behind the printer.
1-16
Page 27
\
Figure 1-12. Bottom-feed paper can be used with certain printer stands.
Paper Thickness
The MPS 1200 can print up to one original and two duplicate copies using carbonless paper. To print multiple copies, the print head must be adjusted using the paper thickness lever, located
just in front of the platen on the right side (see Figure 1-13).
Figure 1-13. The paper thickness lever.
1-17
Page 28
The paper thickness lever has five positions. For most applications, you can leave it at the second position from the narrowest gap between the print head and the platen (as set at the factory). To
adjust for multiple copies, move the lever toward the front of the printer. If the print seems too light, move the lever toward the rear of the printer. You shouldnt have to adjust the paper thickness often.
THE PRINTER SELF-TEST
The MPS 1200 contains a built-in self-test, a program that prints all the printers characters. The self-test assures that everything is working properly (including the installation of the ribbon and paper and the paper thickness setting). And it lets you see what your printing will look like.
Running the self-test is easy; you can do it without being hooked up to the computer. With paper loaded into the printer and the power switch off, plug the power cord into an electrical outlet. Then, while holding down the LF switch, turn the power switch on.
The result is a printout of all the MPS 1200s characters, at a speed
of 120 characters per second. Even at this speed, it will take a while, because the MPS 1200 has a couple of pages worth of characters. To interrupt the self-test, press the On-line switch. To resume, press the On-line switch again.
The self-test prints either Pica or NLQ characters, depending on which font is in use. To run the self-test with near letter quality characters, set DIP switch 1-4 to ON. (See later in this chapter for more information on DIP switches.) Figure 1-14 is a sample of the printer self-test with each character set.
1-18
Page 29
Pica Characters:
! "#*/.?/ ' < )* + ,- / 0 1 2 3456 7 89: ; < = >? ® ABCD EFGH IJKLM NOPQ R STUVW XYZCf ] T* * I - I I-. L - .-r
! " #*7.& ' < ) * + ,- . / 0 123456789 : ; O > ?©ABCD E FGH IJKLM N O PQ R STUVW X YZ Z £ 1 1* * I ~ - l I-, ^ L v n M #$*/.?< ' <> *+,-./01234 5 6 7 89 : ; < = >?©ABC D EF G HI JKLM N O PQRSTUVW X YZ C £ U t+ * I ~ - l I-, L Hi #*/.?< ' ( ) *+ , - . / 0 12 3 4 56 78 9: ; < = > ©ABCDEFGH I JKLMNOPQRSTUVWX YZ C £ J t-< I ~ -l I-, L"-_."1 *7.?< * ( ) *+ , /012 3 45678 9 : ; <= > ? © ABCDEFGHI JKLM NO PQRSTUVWXYZC£D T«^ -* I - I K ^L V / T "T® -#
7.?< * ( > *+ , - . / 0 1234 5 678 9 : ; < = > ‘©ABC D EFG H I JK LM N O P Q R STUVW XYZ l T< I _- l I-, L --T - » - # I & ' ( ) * + , -. / 0 1 23456789: ; <=>?@AB C D EFGHI JKLMN O PQRSTUVWXYZ C£D T-H-* I - I I-, -L - 1 »•_ I .-
' ( ) *+ , /01 23456 7 8 9: ; <=>?© ABCDEFGHIJK LM NOPQ RS TU V W XYZ C£D T-: I _- l I-. -,L ...T 1 »_#I ¿x
( ) * + ,- . / 0123456739 : ; < = > ©ABCDEFGH I JKLMNOPQRSTUVWXYZ C £ D T« * I - I K L - 1 )*I .XO ) * + ,- . / 0 123456789: ; < = > © ABCDEFGH I JKLMNOPQRSTUVWXYZC £ T T* I -I I-. - ,L - ^ r n » - » l .-XO*
. /012 3 45678 9 : ; < = >?@ ABCDE F G HI JKLM N OPQRSTUVWXYZCfD T * -* l " - I K v L V T T » - # l ."XO* I
+, - . /012 3 4 56789 : ; <=> ‘©ABCD E F G HI JKLM NO PQRSTUVWX YZ 1 T« * I - I K L -- T - * -# I .-XO* I*
, - . / 0 12 3 456789 : ; < = > '©ABCD E F G HI JKLMN O PQ R S TUVW XYZ C f : T*— * I - I K L--.-1 l* -* l .XO* l*+
- . / 0 123456789 : ; < = > ‘©ABCDEFG H I JK LM N OPQ RSTUVWX Y Z C f] T-t * I ~ -l h L ^ T " » - # I .XO* l*-Hi
. /0 123 4 5678 9: ; < = >?©ABCD EFGHIJKLMNOPQRS TUVWXYZI-. .XO * l*-HS I /0 1 23 4 56 7 89 :; < =>?@ A B CDEFGH I JKLMN O PQ RSTUVW X Y Z C £11 T** I ~ -l I-. L ---1 »-* 1 /XO* l*-HE Itr
NLQ Characters:
!"#$%&» <> « + ,-./01 2 3456789 : ; <= >?®ABC DEFGH1 J K LMNOPQ RSTUVW XYZ! £ 3 *« * 1
---
-I K NxT
!"#%*» <>«,-. /C123 456789: ; <=> ? ®ABCDEF GHI JKL M NOPQRSTUVWXY Z C £ 1 1* *1
---
-I K ^LNXl I
( >*♦, - . /012345 6 789: ;<= > ? C A B C D E F G H I J K L M N O P Q R S T U V W X Y Z C £]*« *1
---
-I K N/TT®
#***» <)* + , - ./ 0 1 2 3 456789 : ;< = >?® A B C D E F GH I JKLMNOP QRSTUVW X YZC £]*« * h V L V T 1 U
<># + ,-. / 0 12345 6789: ;<=>?®AB CDEFGHI J K LMNOPQ RSTUVW XYZC £]*«-* I
---
-I K V LN/T"D-j»
<)*+,-. /0123 456789 : ; < = >?®ABCDEFGH I J KLMNO PQRSTUV W XYZC £]*« * I
---
-I K
i.» <>«+,-. /01234 56789 : }<=>? ® A BCDEFGHIJKLM N O P QRSTUVWXYZC £]*« !
---
-I K /
» < >*+, - . /012 3 4 5 6789 : ; < = >?® A B C D E F G H I JKLMN O PQRSTUV WXYZC £3
---
-I K ''LN/TT8-4M /X <)*,-. /0123 45678 9: ;<=>?®ABCDEFGHIJKLMNOPQRSTUVWXYZC£] t« * l -I K SXD )#,-. /01234 56789 : ;< = >?«ABCDEFGHI JK LM NO PQRSTUVWXYZC£ 1 *1
--
-I K V L V T H - # I /XD*
/0 123456789: ; < = >?CABCDEFGH I JKL M NOPQRS T UVWXYZC £ ] T« * | ^"-I K y L v T l M l /XO* I
+ , /012345 6789: ; < = > ? © A BCDEFGHI JKLMNOPQRSTUVWXYZC£1 *« * I
--
-I K ,~'L.\xfl0-*l /XO* I*
, /0 123456789: ; < = >?®ABCDEFGH 1 JKLMNO PQ R S T U V W X Y ZC £]*« *1
--
-I K l*+
/0 12345 6789: ; < = >?®ABCDEFGH I JK L MNOPQRSTUVW X Y ZC £]*«— * I -I K ^l_\XTT®-4H /XO« !-«
. /0123 45678 9: ; < = >?®AB CDEFGHI JKLMNOP Q R S TUVWXYZC £3 t« * 1 "-I K'-'L\XTT®-4M /XO* !-« I
Figure 1-14. The MPS 1200 self-test.
When youre satisfied that everything is working correctly, turn the power switch off to stop the test.
The Maintenance Self-Test
The MPS 1200 has another self-test called a maintenance self-test. This is run by turning the power on with both the LF and On-line
buttons held down when you turn the power on. The print-out consists of two parts, a line identifying the version of
the control program and character generators in your printer and rows of Hs (which are used in the factory to check the printing alignment).
To stop this test, turn the printer off, then on again.
1-19
Page 30
CONNECTING YOUR COMPUTER
Your printer and computer communicate by means of a serial cable, which comes in the box with your MPS 1200. This cable connects from one of the two serial ports on the right side of the printer to the serial port on your computer or disk drive (usually on the back of a Commodore computer or drive).
WARNING: Before connecting any cables, make sure the power to
both the computer and printer is OFF, to avoid damaging either unit.
Figure 1-15 shows the serial connection with the cable on the right side of your printer.
The groove on the silver part of the cable must be at the top, or the
pins on the cable will not fit into the holes in the serial port. The cable end should slide in without being forced. Technical details about the serial connector may be found in Appendix E.
1-20
Page 31
INTERNAL (DIP) SWITCHES
The MPS 1200 contains several internal switches that you can set to determine how your printer functions. These switches are small levers known as DIP switches (Dual In-line Package), and each has only two settings (ON and OFF). They are set at the factory to the most frequently-used settings, but you may want to change them to customize your MPS 1200 to your own needs.
These switches are easily accessed and not hard to reset. There are two ways to get to these switches, by removing the device interface cartridge (see Figure 1-16) or by moving a plastic covering on the bottom of the inside of the printer (just in front of the platensee Figure 1-17). If youre going to remove the interface cartridge
(where you plug the serial cable in), make sure the power to both the printer and computer are OFF.
Figure 1-16. Removing the device interface cartridge.
1-21
Page 32
The eight switches of the DIP switches 1 (SW1) determine how your printer will function in such aspects as:
Device number (4 or 5)
ASCII translation (PETASCII or standard ASCII)
Control code (Commodore or Epson mode)
Print style (draft or near letter quality)
1-22
Page 33
Page length (11" or 12")
Paper end detector (on or off)
Automatic line feed (on or off)
Print pitch (pica or compressed) The three switches of the DIP switches 2 (SW2) determine the Com
modore national character sets as shown in table below. Switch 2-4 has no effect.
COU N TR Y
USA/UK/Netherlands OFF Denmark/Norway
Sweden/Finland OFF ON
Germany France/Belgium
Italy Switzerland ON ON Spain
SW2-1
OFF OFF ON OFF
ON OFF OFF ON
ON ON
SW2-2
OFF OFF
ON OFF ON
SW2-3
OFF ON
OFF ON
Many of these features will be discussed in the due course of the
manual, and Appendix D covers everything you need to know
about setting these DIP switches.
For now, a few words about control code mode, according to DIP switch 1-3.
Figure 1-18. The DIP Switches.
1-23
Page 34
The MPS 1200 has two modes” which determine how it reacts to different printer control codes, Commodore mode and Epson mode. When the switch is set to the OFF position, the MPS 1200 behaves like a Commodore 1525 or MPS 803 printer. With DIP switch 1-3 set to ON, the MPS 1200 emulates an Epson FX printer. Most characters, commands and escape sequences are common to the two modes, so how you set this switch will depend on your exact needs. As you read further into this manual, youll sec more of what the differences between these modes are. The factory
setting for this switch is OFF, in the Commodore mode.
1-24
Page 35
Chapter 2
Printer Basics
In this chapter, well cover how to use the MPS 1200 printer with commercial programs. We start with a discussion of how dot matrix printers work and how they use PET ASCII/ASCII codes to communicate with computers. We then cover how to use the MPS
1200 with word processors, spreadsheets, and database programs.
DOT MATRIX PRINTING
The MPS 1200 is called a dot matrix printer because each charac ter is printed as a group, or matrix, of dots. If you look very closely at the printed characters you can see the dots. Figure 2-1 shows how the letter H is formed from 17 dots.
Figure 2-1. The letter H is formed by 17 dots
To understand why a dot matrix printer prints as it does, we need to look at the print head. The print head in the MPS 1200 consists of a stack of 9 pins placed one above the other as shown in Figure 2-2.
2-1
Page 36
O O
O O O
O
O
O
O
U
Figure 2-2. The print head has nine pins
When the MPS 1200 receives a signal from the computer, the electronics inside the printer cause certain pins in the print head to strike the ribbon, creating a vertical pattern of dots on the paper. The print head then shifts slightly, prints another column of dots, shifts again, and so on, until the letter is formed. As the print head moves across the page, a line of characters is printed. Then it reverses direction and prints another line of characters as it returns. This process is called bidirectional printing.
The correct sequence of strikes and movement of the print head for each character is stored in the printers memory. The printer selects the character pattern you want based on a numerical code it receives from your computer. These codes are part of a set that is used throughout the computer industry. It is known as the Am erican
Stand a rd C od e fo r In fo rm atio n Interch ange, or ASCII (pronounced as
ask-key).
ASCII CODES
Most of the time you dont need to be concerned about ASCII codes. When you type a letter A on your keyboard, the computer knows which ASCII code to send to the printer. But if you want to send a nonprinting code to your printer, to change to italics or compressed print for example, you need to know the ASCII code and how to get your computer to send it.
2-2
Page 37
There are 256 ASCII codes, numbered 0 to 255. The first 128
include the codes for the letters of the alphabet (both lower and upper case), the digits 0 to 9, and punctuation marks. For example, the letter A is ASCII 65; the digit 6 is ASCII 54. The first 128 ASCII codes also contain a number of nonprinting codes, called control codes. These codes, ASCII 0 through 31, are the ones that control the MPS 1200 functions. We will have more to say about them later in this manual.
The second 128 codes, ASCII 128 to 255, are sometimes called the
high-bit or 8-bit ASCII characters. They are less standardized
than the first 128 and their meaning depends somewhat on the particular equipment and application involved. The MPS 1200 interprets the high-bit ASCII codes as uppercase characters, graphic
characters, and special symbols.
One of the most confusing things about ASCII codes is that there
are two numbering systems for the codes. Some books and pro
grams refer to them by their decimal value (0 to 255) and others use
their hexadecimal value.
Hexadecimal Numbers
The numbers we usually use are called decimal numbers because
they are based on ten—the ten digits 0 through 9. H exad ecim al
numbers, or hex numbers for short, are based on 16the ten digits
0 through 9 and the six letters A through F. To distinguish them
from decimal numbers, hex numbers are usually written in one of
three ways:
1. preceded by a dollar sign (e.g. $13 or $6A).
2. followed by an h (e.g. 13h or 6Ah)
3. preceded by an ampersand and H (e.g. &H13 or &H6A) All have the same meaning; it depends on which book you are
reading. In this book, we use the second style; hex numbers are followed with an h, as in 6Ah.
The ASCII codes in hexadecimal are OOh to FFh. Whether you use decimal or hexadecimal ASCII codes depends on your computer system and which software program you are using. Appendix B contains a complete list of all the ASCII codes with their decimal and hex values.
2-3
Page 38
PETASCII Codes
There are two versions of ASCII codes available on the MPS 1200, standard ASCII and PETASCII. Since standard ASCII codes are limited to letters, numbers, punctuation, symbols and certain con trol codes, there are extended versions of ASCII systems that
feature additional characters and control codes. The extended ver sion that you may make use of with this printer, PETASCII (the Commodore version of ASCII), differs from standard ASCII in a few ways. One difference is in the characters available. Additional ly, the hex values are sometimes different between the versions.
This printer (MPS 1200 European Version) has eight national character sets. These character sets are explained in Appendix B.
The hex values are slightly different for the same characters in ASCII and PETASCII. In this manual, where we list the BASIC language and hex value formats for escape sequences and control codes, we include the upper/lowercase PETASCII hex values.
Both ASCII and PETASCII values are listed in Appendix C. DIP switch 1-2 sets ASCII translation. When it is set in the OFF
position, the printer uses PETASCII code, the ON position sets ASCII. With the MPS 1200 set to PETASCII, both upper/lower case and uppercase/graphic character sets are available; with ASCII, only the upper/lowercase (text mode) set is used, although many Commodore block graphic characters are available in the upper/ lowercase character set.
When switch 1-2 is set to the ON position (for ASCII), two things happen. First, the MPS 1200 uses only the characters in the upper/ lowercase character set, regardless of the secondary address used in the OPEN statement (see later in this chapter for secondary ad dresses). Second, standard ASCII codes for alphabetic characters (A through Z and a through z) received by the MPS 1200 are translated to their corresponding PET ASCII values before printing.
In other words, with switch 1-2 set On, the MPS 1200 expects the computer to send ASCII rather than PET ASCII character codes.
This is useful when using commercial programs like word proces
sors, which have standard printer setup or installation routines.
2-4
Page 39
Notes On Commodore BASIC
If youre not using a commercial program, you have to use a programming language to communicate with your printer. Since BASIC is the most popular programming language, were using it in this manual to demonstrate the MPS 1200s features. The MPS
1200 works just as well with other high-level languages such as C or PASCAL. Simply send the same ASCII or PETASCII codes with whatever print statements your language uses.
There are many different versions of BASIC around. The pro grams to come in this manual illustrating how to use the Commo dore MPS 1200 printers features are written in (not surprisingly) Commodore BASIC. We’ll go over a few commands in the next couple of pages so youre familiar with Commodore BASIC as it relates to printers.
Commodore BASIC does not use the LPRINT statement, which is used in many other BASICs. Instead, it uses the OPEN, PRINT# and CLOSE commands.
The OPEN statement allows your computer to access devices such as disk drives, monitor screens and, for our purposes, printers.
Add the OPEN statement at the beginning of a program to enable communication with the printer. The word OPEN is followed by a logical file number, which is the number to which all other BASIC statements will refer. This number can be from 1 to 255. The second number after the file number is the device number. The device number for the printer can be either 4 or 5. So, a line such as
open 1,4
opens a channel with the file number 1 to use the printer, assuming the device select switch is set to device 4.
There can be a third number, known as a secondary address, which will be discussed shortly.
Any file that you open must be closed when youre done with it. The command for this is straight-forward enoughthe CLOSE command.
2-5
Page 40
This command completes and closes any files used by OPEN statements. The number following the word CLOSE is the file number to be closed, so the command CLOSE 1 closes logical file 1.
In between the opening and closing of a file, you communicate with the printer. The main statement you use in Commodore BASIC for this is the PRINT# statement.
There are a few differences between this statement and the PRINT. First of all, the word PRINT# is followed by a number, which refers to the device or data file previously opened. The number is followed by a comma, and a list of things to be PRINTed. In this
manual, PRINT# statements will be used for issuing instructions
to the printer on what type or special effects to use, spacing, tabs,
graphics, etc. in addition to text characters. Heres a short example of an instruction to the printer:
10 open 1,4 20 p r in t # l,"hello there!" 30 close 1
HELLO THERE!
Youll be seeing a lot of short (and not-so-short) examples like this in the very near future.
You can print out a listing of a program on your printer with the following:
open 1,4
cmd 1
11st
pr i nt # l:closel
(The print# 1 command in the last line was used to clear the buffer.) CMD sends the output which normally would go to the screen (i.e.
PRINT statement, LISTS, but not POKEs into the screen) to
another device instead. This could be a printer, or a data file on tape
or disk. This device or file must be OPENed first. The CMD
command must be followed by a naumber or numeric variable
referring to the file. In the example above, the file number was 4,
from the OPEN command.
2-6
Page 41
Secondary Addresses
The secondary address is an additional parameter to use with the
OPEN command. The secondary address allows you to perform some printer control functions, such as setting the number of lines per page or line spacing in a manner compatible with Commodore dot matrix printers such as the 1525/MPS 801, MPS 803, 1526/ MPS 802 and 1000.
The OPEN statement with a secondary address would look like this:
open l,4,n
with 1 being the file number, 4 specifying the printer and n deter
mining the secondary address command issued. The available val ues for n in the secondary address are 0, 3, 6, 7 and 10. Table 2.1 lists what each does:
Table 2-1. Secondary Address Functions.
n Function
0 Selects uppercase/graphics character set 3 Sets number of lines per page (see Chapter 4) 6 Sets line feed pitch (see Chapter 4) 7 Selects uppercase/lowercase character set
10 Resets printer
If the OPEN statement does not include a third number specifying the secondary address, a value of 0 is assumed.
Choosing a Character Set with the Secondary Address
Using the statement
10 open 1,4,7
instructs the printer to interpret the codes for characters received
from the computer in upper and lower case rather than as capitals and graphic symbols (which is the default with switch 1-2 set to PETASCII.) Figure 2-4 shows both character sets.
2-7
Page 42
MPS 1200 GRAPH ICS MODE
MPS 1200 TE XT MODE
0 1 2 3
4
5 6 7 8
9 A B C
D E F
0
1 2 3
4 5 6
7 8 9 A B
C D
E F
0 0 @ P-1
r
-
I
r
0
0 @
P
-
P
r
-
P
r
1
!
1
A
Q
1
1
_L
1
!
1
a
R
A
Q
1_LAQ1
-L
2
"
2 B R 1
_ m
-r
1
_ m
T
2
"
2
b
r B R
m
T B
R
T
3
tt
3 C S-*
-
H
-
-H
3
# 3
c
s C
S
H C
S
H
4
$ A
D T
-
1
_1-1_
1
4 $4d
t D
T
1
D T
_ !
5
%
5 E U
1
1
1 1
5
%5e u
E U
1 1 E U11
6 &
6 F V
- 1 _
1
6 &
6
f
V F
V
1
F V
1
7
»
7GU
1
ü
1-1Ci1
7
»
7gw G
W 1
G
U 1
8
(8HX1 4
1 4
-
8
( 8 h
X H X
H
X
9
)
9IY
1
r
1
r
9
) 9 i
y
I Y
I Y
_
A
«
J Z 1
J 1 J
A
«
j
Z J
Z
1 J
Z
1 r
B
+
;
K
[ 4
£
4
£
B
+
;
k [
K 4 £
K 4 £
C
,
<
L£L
L
C
,
<
1 £
L
L
D
- =
M ] 1
>
J
1
L
_i
D
-
m ] M
1
L
M
1
L
-i
E
>
N î fT
î
fT 1
E
> n
î N
K
IN I
F /
?
0 -
r
_
p
_
fT
F /
7
o
0
_
%
0
-
Figure 2-3. Commodore mode character sets
(USA/UK/Netherlands)
The programs in this manual all include the secondary address of 7 in the OPEN statements so the program listings appear in upper/ lower case when theyre printed out. Without this character set in use, the programs would appear in uppercase letters and graphic symbols. The same codes would still be sent to the printer and the printer would act exactly the same, but the reader of this manual probably wouldnt fare as well as the printer in following the programs.
CONTROL CODE AND ESCAPE
SEQUENCES
Now that weve reviewed some BASIC commands to communi cate with the MPS 1200, let’s consider how you actually tell it what
you want it to do: control codes and escape sequences. As we said
earlier, the MPS 1200 has two modes, Commodore and Epson
modes, where it behaves differently when you give it certain instructions (although most commands get the same result in either mode). These instructions to the printer come in the form of control codes or escape sequences.
2-8
Page 43
A control code is a command given to the printer in the form of a non-printing ASCII or PETASCII code. An example would be
10 p rint#1 ,chr*(14)
which would tell the printer to turn expanded print on. All the control codes available on the MPS 1200 are covered in the upcom ing chapters, and Appendix C contains all the control code com mands for both Commodore and Epson modes.
Many MPS features are controlled with escape sequences. Escape sequences are the same for the MPS 1200 in both Commodore and Epson modes. They are called escape sequences because the com
mand starts with the ASCII/PETASCII code for ESCape (chr$(27)) and is followed by other codes which determine the instruction for the printer. The sequence ESC 4 sets italic characters, and can be issued with the command
20 print#i,chr*<27>;chr*(52)
That doesnt look like ESC 4, but it is; chr$(27) is the ASCII code
for ESC (get used to it, youll be using it a lot) and chr$(52) is the code for 4. The MPS 1200s escape sequences are explained with examples for each throughout this manual. Appendix C also con tains a complete list of all the escape codes and their functions, showing both the PETASCII and ASCII versions.
If you enter your program with your computer set to upper/ lowercase (text) mode, and your printer is set to PETASCII mode, you may enter the escape sequences using the familiar Epson- standard characters. For example, the above command to set italic characters may be written as:
20 print#l,chr*<27> "4"
When keying in the example programs that follow, pay close attention to the case (upper or lower) of the letters in the escape sequence. If the sequence requires a capital E, make sure you hold down the shift key when you type E.
2-9
Page 44
Because ESC is used so often, many programmers define chr$(27) as a string variable in their programs with an assignment statement. To turn on italics, for example, you could use:
10 openl,4, 7
15 e sc $ = c h r $ (27) 20 p ri nt # l, e* c* ,,4 M 30 close 1
ESCS is much shorter to type than chr$(27). Adding one assign ment statement at the beginning of a long program can save a lot of typing.
Now reset the MPS 1200 by switching the power off and on before you move on, unless you want to continue printing in italics.
Remember, to clear a program from the computers memory, type NEW and press RETURN before entering a new program. This does not reset the printer; other ways beside turning the printer off and on will be explained at the end of this chapter.
PRINTER INSTALLATION
The MPS 1200 is compatible with most commercial programs word processors, spreadsheets, database and graphic drawing pro grams. Before you can see some printing, however, most pro grams require that you install” your printer, that is, tell your program what kind of printer you have.
Choosing the Right Configuration
This is where the question of which way (Commodore-compatible or Epson-compatible) you want your MPS 1200 configured needs to be answered. Lets look at the differences between the two configurations.
The differences between the two configurations are not great. A few of the control codes, which are instructions from your comput er to the MPS 1200, work differently in the two configurations.
Generally, if you are writing or using programs written in BASIC, you probably want your MPS 1200 configured as a Commodore PETASCII printer. (DIP switches 1-2 and 1-3 OFF).
2-10
Page 45
If you are using commercial software designed to support a variety of printers (such as word processors, spread sheet programs, etc.), you should probably select the Epson FX compatible mode (switch 1-3 O N). Nearly all software supports Epson printers, and will allow the MPS 1200 to produce special printing effects such as bold, italics, underline, superscripts, and subscripts under program control by the commercial software.
If your software does not allow selection of PET ASCII (or CBM ASCII) along with the choice of Epson compatible printer control, then set DIP switch 1-2 to ON, which will permit the software to send true ASCII characters to the MPS 1200, and your printer will print the characters properly.
Software Printer Choices
Many programs, especially word processors, include an installation routine for your printer. Typically, the installation routine gives you a choice of several printers or printer types. It may also ask
some questions about backspacing, line feeds, and form feeds. Any of the following printer choices will work for the MPS 1200:
MPS801”, MPS803, MPS1000, Commodore printer, Commodore compatible printer, Epson printer, TTY-type printer with backspace”, ASCII dot matrix printer. Selecting one of these options should do the trick.
The following summarizes the most likely uses for the configura tions of switches 1-2 and 1-3. In particular, note the settings as they
apply to graphic drawing programs, whether the program in ques
tion was designed for use with a Commodore or Epson-compatible
printer for screen dumps.
2-11
Page 46
Switch 1-2 Switch 1-3
Potential Use
OFF
OFF
MPS 801, MPS 803 emulation with Commo dore 64 software packages such as EasyScript,
Jane and Print Shop, which use Commodore
Bit Map graphics.
OFF
ON
BASIC programmers who want to make use of standard control codes, such as backspace, compressed print, etc.
ON
ON
Epson FX emulation with Commodore 64 or 128 commercial software packages which have Epson-compatible ASCII printer driv ers. These software packages generate stan dard ASCII upper and lowercase characters, and often embed escape sequences in their out put streams.
ON
OFF
No real practical use for this switch combina tion.
Some programs need more information about your printer, how
ever. If your program wants to know, the MPS 1200 printer:
uses device number 4 or 5
uses no communications protocol
does not require a printer initialization string (for normal 80- column printing)
can backspace (ASCII 8) if set to Epson mode
can underline (ASCII 95 or escape sequence)
does an automatic line feed in Commodore mode
does not do an automatic line feed in Epson mode, unless you change internal switch 1-7
can do a form feed (ASCII 12)
2-12
Page 47
If your program asks other questions, or doesnt have any printer choices that resemble those above, eliminate the choices involving letter quality or daisy-wheel printers (with names like Diablo and Spinwriter) and experiment. The worst that will happen is that youll get very strange results or no results at all and you can make a different printer choice.
Once youve completed the installation, youre ready to use your new MPS 1200 printer. Try a short printing sample using your program. You will see what a good choice you made in purchasing the MPS 1200 printer.
WORD PROCESSORS
Strange as it may seen, the special printing effects built into many word processing programs are limited to boldface and underlining. Fortunately, most programs provide a way to send special codes to the MPS 1200 to take advantage of its additional capabilities such as italics, compressed and double width print, superscripts and sub script, graphics characters, and so on. But it takes a little maneuver ing.
The trick is to get your word processing program to place the necessary nonprinting codes into your text file and send them on to the printer without interpreting them as its own commands.
Literal Characters
A literal” character tells the word processing program that the character following it is to be accepted literally (placed in the text file as is) and not interpreted as a word processing command. The literal character in many word processing programs is itself a
particular nonprinting control character. Different programs use different keys. Check your word processor’s user manual to see how to insert nonprinting codes into your file.
For example, to select emphasized print, you must send the code ESCape E to the MPS 1200. To enter ESC E into your text file, key your word processors literal character, ESC, and then E. It doesnt matter how this sequence shows on your screen; when you print the file, the MPS 1200 will get the message that you want empha sized print.
2-13
Page 48
Remember, when inserting escape sequences manually, to send the proper version of ASCII code related to how DIP switch 1-2 is set. Since PET ASCII (switch 1-2 OFF) and ASCII (switch 1-2 ON) are slightly different, make sure the version that you use is consistent with how switch 1-2 is set.
SPREADSHEETS, DATABASES, AND OTHER PROGRAMS
Most of these programs provide a setup option in their output or print mode that asks you to make two settings for your printer: the number of characters per line, and the codes to be sent to the printer at the start of printing, called the printer initialization string.
The two settings are related. The number of characters per line depends on the print mode, which is determined by the initializa tion string you send. Table 2-2 shows printer initialization strings for some common print modes.
Table 2-2. Printer Initialization Strings
Print Characters Initialization Mode per Line String
10-pitch Pica
80 None
12-pitch Elite
96 ESC M
Compressed Pica 136
ESC chr$(15)*
Compressed Elite 160 ESC M ESC chr$(15)
*If you plan to use your printer mostly for financial applications, you may want to set the internal switches so that compressed mode is automatically selected when the MPS 1200 is turned on (sec Appendix D). If you make this change, the initialization string for compressed print is not needed when you send your output to the printer.
Initializing The Printer
When you in itia lize the MPS 1200, you clear any special settings
you have made and return the printer to the settings specified by the current internal switch settings and the Read Only Memory (ROM) of the printer.
2-14
Page 49
There are three ways to initialize the printer:
1. By turning the power switch OFF, then ON again.
2. By sending the software command ESC@.
3. By sending a secondary address of 10 in a print channel (OPEN) command.
Table 2-3 shows you what happens during initialization:
Table 2-3. Printer Initialization Settings
Setting Description
Print head
Returned to the home position (the extreme left)
On-line status Placed on line, unless out of paper
Print buffer
Cleared, including download characters
Margins
All margins are cleared
Tab settings
All tab settings are cleared; horizontal tabs are set at every eight columns
Character pitch
10 characters per inch, or set by switch 1-8*
Line spacing
1/6 inch
Page length
11 inches, or set by switch 1-5*
Top of form
Current paper position
Switch settings
Records current settings
Cut sheet feeder
Initialized, if installed; any paper is ejected
Tor details concerning internal switch settings, refer to Appendix D. In this manual, the term p ow e r on default v alue s, or simply defa ults,
are those set by initialization.
IMPORTANT: It is a good idea to reset the printer after running each
program in this manual.
2-15
Page 50
Page 51
Chapter 3
Printing Text
Starting with this chapter well look at each of the MPS 1200s features in detailwhat the feature does, how it works, and how to use it. We’ll show you example programs that illustrate how to send the control codes to the MPS 1200.
If you plan to write your own programs, youll find the programs in this section provide examples of proper command syntax and may be useful as subroutines. If you dont know BASIC, you can still use all of the MPS 1200s features. Just follow the code syntax in the example programs.
This chapter covers the commands that control the way the MPS
1200 prints text. Youll learn how to get near letter quality print
and proportional spacing, how to change pitch and character width
and height, how to use doublestrike, emphasized, italic, reverse print, underlining, and how to print superscripts and subscripts.
When you finish this chapter youll be able to customize your text printing exactly to your task and needs.
NOTE: So that your sample programs come out the same, we assume
that you have internal switch 1-2 OFF (to configure your MPS 1200 as a PET ASCII printer).
NEAR LETTER QUALITY
Format ON OFF
BASIC chr$(27) x1 chr$(27) xO
Hex 1B58 31 1B58 30
3-1
Page 52
Near letter quality (NLQ) printing is a feature you will use often. In this mode, the MPS 1200 uses a special character set very similar to the type on a typewriter or letter-quality printer. Using NLQ printing for your correspondence and reports gives them a polished professional look.
To make the commands easy to remember, many of the MPS
1200s features are turned on and off in the same fashion. Adding a 1 to the command turns the feature on; adding a 0 to the command
turns the feature off. NLQ mode uses this scheme. The NLQ command is ESC x (the x must be lower case). To turn
on near letter quality mode, send ESC xl to the MPS 1200; to turn it off, send ESC xO. Try it by typing the following BASIC pro
gram:
10 open 1,4,7
20 pr int#l,ch r*(2 7>"xl" ?"NL Q Mode'1 30 pr int#l ,chr*< 27>"xO";" Not The NLQ M o d e 40 closel
NLQ Mode
Not The NLQ Mode
Sometimes it is more convenient to use their PET ASCII or ASCII codes rather than typing xl and xO.
Using PET ASCII codes, the same program becomes:
10 ope nl,4, 7
20 pr in t# !,ch r $ (27);ch r $(88)q ch r$ (49)q"NLQ Mode" 30 p rint #l,c hr* <27 >;ch r*< 88 >;c hr*< 48) 5"Not The NLQ Mode" 40 c 1os e 1
NLQ Mode
Not The NL Q Mode
NOTE: Since the 1 and 0 work as on and off switches rather than actual
characters, you can substitute chrS(l) and chr$(0) for their actual ASCII codes if you like.
3-2
Page 53
The following program demonstrates the difference between near letter quality characters and standard characters:
10 open 1,4,7
20 -for n=32to90: a$=a$+chr$ (n) : next n 30 pr int#l, chr$ (27) " >i 1 " ; "NLQ Mode" 40 print#l,a$ 50 print#l,c hr$(27)"xO";"Not The NLQ Mode" 60 print#l,a$ 70 closel
NLQ Mode
!"#$%& ()# + ,-./ 0 123456789 : ;< = >?@abcdef g h i jk 1mnopq rst uv wxy z
Not The NLQ Mo de
! ' ( ) *+, /0123456789: ; < = >?@abcde-f gh i jk lmnopgrstuvwxyz
When you run this program, the complete character set for near letter quality followed by the complete standard set will be printed.
NLQ (Commodore mode only)
Format
BASIC Hex
ON
chr$(31)
1F
OFF
chr$(159)
9F
With switch 1-3 set to Commodore mode, you can also print in NLQ by issuing the printer control code chr$(31). chr$(159) turns it off, as in the following example:
10 open 1, 4 , 7
20 p r i n t # l , c h r $ ( 3 1 ) ; "NLQ Mode Commodore mode o n ly "
30 p r i n t t t l , ch r $ <1 59 );" Not The NLQ Mode" 40 c l o s e l
NLQ Mode--Commodore mode only
Not The NLQ Mode ...
Near letter quality printing looks good, doesn’t it? So why not use this mode all the time? For certain applications, you may want to do that. But there are some things about near letter quality mode you should know first.
3-3
Page 54
Near letter quality achieves its crisp appearance by printing each line twice. The speed of near letter quality print is therefore slower than standard print. If you are printing a long document, the slower speed can make a considerable difference.
In some cases, you may want to change between near letter quality and standard mode without using BASIC to send the MPS 1200 a
command. For example, when using a word processor you may want to use a standard mode for quick notes and draft copies, and
near letter quality mode for finished products. For these applica
tions, the MPS 1200 provides a way to turn near letter quality mode on and off using the control panel.
With the MPS 1200 on-line, hold the LF (line feed) switch down while pressing the On-line switch. You will see the print head shift twice, indicating that the MPS 1200 is now in near letter quality mode. To change back to standard mode, repeat the procedure. This time the print head jumps just once, indicating that the MPS 1200 has changed to standard draft mode.
You can use the control panel to change between near letter quality and standard mode any time the on-line and ready lights are lit, even if the mode was previously changed by a program command. For example, you can have your word processor select near letter quality mode automatically by including ESC xl in its printer initialization string. If you later want to print a quick draft copy, you can use the control panel to change to standard mode.
NOTE: Some word processing programs send a reset code to the
printer as they start printing. This reset code will change the printer back to draft printing. These programs wont allow you to change to near letter quality using the control panel, unless you can make the word processing program pause dur ing printing so that you can change modes.
CHARACTER PRINT WIDTH
The MPS 1200 has three ways to change the width of a printed character: (1) changing the basic pitch, (2) expanding the charac ters, and (3) compressing the characters. By combining these three methods, the MPS 1200 can print in eight different character widths as shown in Table 3.1.
3-4
Page 55
Table 3.1 Character Widths
Character Width Characters/Inch Max. Characters/Line
Pica Standard 10
80
Pica Expanded 5
40
Pica Compressed 17
136
Pica Compressed
Expanded 8.5
68
Elite Standard 12
96
Elite Expanded
6
48
Elite Compressed
20
160
Elite Compressed
Expanded 10 80
We’ll cover the commands for each of these print widths in this section.
Pitch
The pitch tells you how many characters will be printed in one inch. It is another term for characters per inch, or CPI.
The MPS 1200 is capable of two basic pitches: 10-pitch, called pica,
and 12-pitch, called elite. They are described below.
Pica Pitch
Format ON OFF
BASIC chr$(27) P" chr$(27) M" Hex 1B DO 1B CD
Pica is the default pitch. When you first turn on the MPS 1200, it will print at 10 characters per inch by default until you change it. Pica pitch does not cancel other width commands such as expanded or compressed print. Pica pitch can be turned off by selecting the other pitch command, which is elite.
3-5
Page 56
Elite Pitch
Format
BASIC Hex
ON
chr$(27) M 1BCD
OFF
chr$(27) P 1B DO
You tell the MPS 1200 to change to 12-pitch elite by sending the command ESC M. To change back to 10-pitch pica, send the
command ESC P.
To see the difference between 10- and 12-pitch, run the following
program:
10 o p e n l , 4 , 7
20 p r i n t# l ,c h r * < 2 7 > MP"
30 p r in t # l ," C o m p a r e t h i s li n e in 12 p i t c h e l i t e " 40 p r in t # l, c h r* < 2 7 ) " M " 50 p r i n t # l , " t o th i s li n e in 10 p i t c h p ic a " s p r i n t # l 60 p r i n t # l , c h r $ ( 27 ) "P " ; " You c an a l s o h av e "c hr $ (2 7 )" M " 70 p r i n t t t l , " bo th p it c h e s in one 1i n e " ; c h r $ <27)" P " ; 80 p r i n t t t l , " i f you li k e . "
100 c l o s e 1
Compa re t h i s l in e in 12 p i t c h e l i t e
to t his lin e in 10 pitch pica
You ca n a l s o ha ve both pitches in one line i f you li k e .
You will see these results:
The semicolons in program lines 60 and 70 tell BASIC not to send a carriage return and line feed at the end of the print statement. This BASIC technique allows you to send the MPS 1200 strings of
characters mixed with commands and still have everything print on
one line.
Pitch can also be changed with the master pitch command, ESC3, and with the master select command, ESC !. These master com mands are described later in this chapter.
3-6
Page 57
Expanded Print
Format
BASIC Hex
ON
chr$(27) W1 1BD7 31
OFF
chr$(27) WO 1BD7 30
Both of the MPS 1200s pitches can be expanded to twice their normal width. In expanded print, the width of the characters and the spaces are doubled. This means the maximum number of characters per line is cut in half.
Expanded pica prints 5 characters per inch, so you can print a maximum of 40 characters per line on the MPS 1200. Expanded elite prints 6 characters per inch, for a maximum of 48 characters per line.
The command to select expanded print is ESC W. Like the NLQ command, the expanded print command uses a 1 and 0 as its on and off switches. Sending ESC W1 to the MPS 1200 turns on expanded print; sending ESC W0 turns off expanded print. Try the following
statements: 10
10 op e n 1,4 , 7 20 f o r n= 3 2 t o 5 6s a$ = a$ + ch r$ (n ): n e xt n 30 i f x=l t he n 60 40 p r i n t # l , c h r $ (2 7 ); c h r $ ( 8 0 ) ; "P ica" 50 g ot o 70
60 p r in t # l, c h r* < 2 7 ) "M " ; " E l it e"
70 p r i n t # l , c h r * ( 27 ) "Wl"; "e xpand it "
80 p r i n t # l , a $
90 p r i n t # l , c h r $ ( 27 )" W0"; "no, d o n ' t "
100 p r i n t # l ,a $ 105 x—x +1 s i f x <2 then 30
110 c l o s e 1
3-7
Page 58
Pica
e X p an d i. t;
! ' C > _ s<S> 1 S 3 4 5 4 £ »
no, don 71
Í "#*"/.& ' ( ) / 0 1 23 45 67 8
E l i t e
expand ± t
! aa# « X S < ' < > -*h- , - / 0 1 2 3 4 5 6 7 8
no, don 't
! " #$/.?/. '<)*+,-. /O12345678
Now change the pitch to elite with ESC M and try expanded print again. Youll see what a difference pitch can make.
In Commodore mode, you can also select expanded print with a control code, chr$(14). Send chr$(14) to the printer to turn on expanded print, and chr$(15) to turn it off.
One frequent use for expanded print is for headlines and titles. In this case, you need to turn on expanded print for just one line and then return to a normal character width. You can do this by sending ESC Wl, printing the headline, and then sending ESC WO. But there is an easier way.
One-line Expanded Print
Format
BASIC Hex
ON
chr$(27) chr$(14) 1B0E
OFF
chr$(27) WO 1BD7 30
Epson mode only Format
ON
OFF
BASIC chr$(14) chr$(20) Hex 0E 14
The command ESC chr$(14), or chrS(14) in Epson mode, turns on expanded print for one line only. The MPS 1200 automatically
returns to normal print for the next line. Type these statements to see how it works:
3-8
Page 59
10 open 1,4,7
20 p r int#l,c hr $(27);chr $(14);"This line will be expanded." 30 p rint#l,"But this line won't." 40 closel
Th is line will be e x p am d ed -
But this line won't.
If you want only part of a line in expanded print, the command chr$(20) in Epson mode can be used in mid-line to cancel chr$(14) or ESC chr$(14). The following example shows this:
10 o p en 1,4,7
20 p r int#l,"Both "5 c h r $ ( 2 7 ) ;c h r $ (1 4 ) ;"expande d";
ch r $(20);" and normal print"
30 closel
Both e x p a n d e d and normal pr int
Note that while you can cancel one-line expanded set by ESC chr$(14) or chr$(14) with ESC WO, you cannot cancel ESC W1 with a chr$(20) or chr$(15).
Compressed Print
Format
BASIC Hex
ON
chr$(27) chr$(15) 1B OF
OFF
chr$(27) chr$(18) 1B12
Epson mode only
Format ON OFF
BASIC chr$(15) chr$(18) Hex OF 12
The characters in both of the MPS 1200s pitches can be com
pressed to approximately 60% of their width so you can print fit more characters per line. As with expanded print, both characters and spaces are affected.
3-9
Page 60
Compressed pica prints 17 characters per inch, for a maximum of 136 characters per line. Compressed elite prints 20 characters per inch, so you can print a maximum of 160 characters per line.
You can compress the print in either pitch by sending ESC chr$(15) (or just chr$(15) in Epson mode). The command ESC chr$(18) (or
just chr$(18) in Epson mode) turns off compressed print and re
turns you to either pica or elite pitch, whichever you set last. Note that compressed print is not turned off automatically at the
end of a line, as was one-line expanded print. Run the following program to see the effect of compressed print:
10 open 1,4,7
20 print#l,ch r$(27);chr$(15);"This would never fit
comfortably on a single line-.-"
30 print#l,c hr$(27);chr$(18);"if it were all regular print"
40 closel
This would never fit coafortably on a single line...
i f i t we re a ll r e g u l a r p ri nt
Compressed Expanded Print
You are also able to turn on both compressed and expanded print in combination with pica or elite pitch. The result is a character width about 85% of the normal pitch. Compressed expanded pica prints
8.5 characters per inch, a maximum of 68 characters per line. Compressed expanded elite prints 10 characters per inch, which is a maximum of 80 characters per line.
The following program demonstrates all eight of the MPS 1200s character widths. Key in the program, run it, and keep the printout as a guide to the MPS 1200s different characters widths.
3-10
Page 61
10 openl,4,7
20 s c $ = c h r $ (27) 30 pr i nt #l , "CPI=Characters Per In ch":print#l 40 p ri n t #l , sc$"M" ; sc$; chr$ < 15) ; 50 pr i nt # l ,"Elite Compressed: 20 CPI" 60 printttl, sc$"P" ; sc$; chr$ (15) ; 70 pr i nt # 1 , "Pica C om pr ess ed :17 CPI" 80 pr i nt # l ,sc$" @" ;sc VM" ; 90 p ri n t# l, "Elite S ta nd ar d: 12 CPI"
100 pri n t# l ,sc$ " P "; 110 printttl,"Pica S ta nd ar d: 10 CPI" 120 pri n t# l ,sc $" M " ;sc$ ; c h r$ (15) ; s c$ " Wl " ;
130 printttl,"Elite Compressed E x p an de d :10 CPI" 140 printttl,sc$" P " ;c h r$(27);chr$ <15) ; 150 printttl,"Pica Compressed Expande d:0.5 CPI"
160 printttl,sc$"M";set; chr $(18) ;
170 printttl,"Elite Ex pa nd ed : 6 CPI"
180 printttl,sc$ "P " ;
190 printttl,"Pica Ex pande d:5 CPI"
20 0 printttl,sc$"W0"; 2 10 closel
C P I = C h a ra c t e rs P er Inch
Elite (^pressed:26 CPI Pica Conpressed:17 CPI E lit e S tanda rd :12 CPI P ic a S t a n d a r d : 10 CPI
Elite Compressed Expanded:10 CPI
Pica Compressed Expanded:8.5 CPI Elite E x p a n d ed = OR I P ic a E xpande d:5 CPI
3-11
Page 62
PROPORTIONAL PRINT
Format
BASIC Hex
ON
chr$(27) p1 1B 50 31
OFF
chr$(27) pO 1B 50 30
Until now, all of the print widths we have discussed have been fixed. That is, each character has the same width; in pica printing, an i occupies 1/10 of an inch, an M occupies 1/10 of an inch, an o occupies 1/10 of an inch, etc. But because the shapes of the letters are quite different, some characters (notably i” and 1) are printed with a lot of space around them. A step forward in reada bility and aesthetics comes with proportional printing, where the space each printed character occupies is proportional to its shape.
The command to turn on proportional print is ESC pi; to return to normal fixed spacing, use ESC pO. Note that you must use a lower
case p.
5 ope n 1,4,7
10 p rin tttl ,ch r*(27 )" p i "; 20 g osu b 100 30 pr int#:L, c hr $ (27) "p0" ; 40 g osu b 100 50 end
100 printttl,"A step -forward in r ea d ab i li ty and aesth et ic s"
110 pr in t#l , "c omes with ";
120 pri n t # 1,c hr$ (27)"4";
130 printttl,"propo rti ona l printin g";
140 printttl,chr $ (27)"5" ;
150 printttl,"where the" 160 printttl,"w idth each pri nte d ch ar a ct e r oc cu p ie s is" 170 printttl,"propo rtio nal to its s hap e." 180 printttl 190 re tur n
200 clo se 1
3-12
Page 63
A step forward in readability and aesthetics comes with prop ortio nal printing where the width each printed character occupies is proportional to its shape.
A b 1 0 p f o r w a r d :i. n r e a d a b i 1 i t y a n d a e s t h e t i c s
c o m 0S wi 11") /..) r o p o r t i o n a 1 p r i it t x n g w h e r e t h e w :i. d t h e a c: h p r i n t ed c h a r a c t; e r o c c u p i e s i s p ro p o r t i o n a 1 to i t s s h a p e .
Proportional characters are always printed in emphasized print and are compatible with all of the styles and widths we have discussed so far: draft, neat letter quality, expanded, compressed, elite and pica. By changing the width (say, from pica to elite), you change the overall width, but the printing will be the same as either regular
pica or regular elite.
Using the previous program, add the line below to make every thing print with proportional characters. Compare the results to your earlier printout; they will be similar, but noticeably different.
PROPORTIONAL SPACING
Format ON OFF
BASIC chr$(27)“ ;chr$(n) chr$(27) ;chr$(0) Hex 1B 20 nh 1B 20 OOh
If you think weve discussed character print width just about enough, bear with us for one more variation! In addition to chang ing the width of the actual printed characters, you can also vary the space between the characters. This feature can be used in creating fancy justified text or if you just want the print to appear looser.
The command for proportional spacing is, appropriately enough,
ESC (space). Following the space is the number of additional print columns (or dots) that you would like to place between each character. To specify this number, you must use the chr$ function; you cannot use a statement like PRINT#l,chr$(27) 9” and expect to add 9 dots between characters.
3-13
Page 64
This short program should demonstrate the effect of the propor tional spacing command:
10 open 1,4,7
15 -for n = 11o 10 20 print#l,chr*<27>" Mchr$(n); 30 print#l,"The same letters, different spacing" 40 next n 50 prin t#l,chr*(27)" "chr*<0) 60 closel
The same letters, dif ferent spacin g
The s a me let t er s, d i f f e r e n t spa c i n g
Th e same letters, different spacing
The same letters, different spacing
The same letters, different spacing
The same letters, different spacing
The same letters, different spacing The same letters, different spacing The same letters, different spacing The same letters, different spacing
The last statement returns the MPS 1200 to its default overall character spacing: 0 dots. Proportional spacing can be combined with all print features, including proportional printing.
JUSTIFIED PRINTING
Format
BASIC Hex
ON
chr$(27)"a”chr$(n) 1B41 nh
OFF
chr$(27)“a”chr$(0) 1B41 OOh
Justified printing prints lines in the NLQ mode that are aligned in
any of four different ways. To use this command, send ESC a followed by the ASCII code for a number from 0 to 3 to specify the type of justification you want (see Table 3.2).
3-14
Page 65
Table 3-2. Styles of Justified Printing
n Justification Style
0 Flush against the left margin (default)
1 Centered (between left and right margins) 2 Flush against the right margin 3Fully justified (flush against both margins)
With fully justified printing, the MPS 1200 adjusts the spaces between every word on a line from 0.5 to 2 characters width. If it
fails, the word on the margin is recorrected almost to the original position.
10 open 1,4,7 20 pr int ttl ,ch r$ (27)" xl"; 30 p rin ttt l, chr$ (27) "Q"chr$<40) ; 40 p ri nt # l, ch r$ (27)"a "chr$ (0) 50 p rin ttt l, "Flush l ef t"
60 pri ntt tl, c hr$(27)Ma"chr$(l)
70 p rin ttt l, "Centered between the margins" 80 p rin tt tl, ch r* (27)"a"chr$(2) 90 p ri nt # l, "Flush right"
100 p rintttl, chr$ (27) "a"chr$(3)
110 pr intt tl, "This text is ju st ifie d flush on both sid es.
115 p rin tttl , "Notice how it a utom aticall y wraps around,
ju st ifi ed at both m argins."
120 p rin tttl ,c hr $(27)"@":close 1
Flush left
Centered between the margins
Flush right
This text is justified flush on both sides.
Notice how it automatically wraps around,
justified at both margins.
3-15
Page 66
PRINT DENSITY
When printing text, it is sometimes desirable to have some words stand out darker than the rest. Headlines are often printed in boldface, for example. The MPS 1200 has two features that allow you to vary the darkness, or density, of the print: emphasized and doublestrike print. For very dark printing, you can use both at once.
Emphasized Print
Format ON OFF
BASIC chr$(27) E chr$(27) F Hex 1BC5 1BC6
In emphasized print, the characters are double-printed in one pass. Each character is printed a second time offset slightly to the right so that the dots overlap and produce a shadow effect.
When proportional printing is in effect, the characters are automati
cally printed in emphasized mode.
5 open 1, 4,7 20 p r i n t # i , c h r$ (2 7)"E" ; " YES SIR! RIGHT AWAY, SIR 30 p r i n t # l , c h r$ (2 7) "F "; ". . - when I g et around to 40 c lo s el
YESSIR! RIGHT AWAY, SIR!
---when I get around to it-
Doublestrike Print
Format ON OFF
BASIC chr$(27) G chr$(27) H Hex 1BC7 1BC8
3-16
Page 67
In doublestrike, the MPS 1200 prints the entire line and then returns to print it a second time. You probably didnt notice, but on the second pass the paper is rolled up very slightly so that the dots print just below those from the first pass.
The names are slightly misleading because both features actually darken the characters by printing them twice. The difference is in the way the second printing is done. To see the difference, try the following program and watch the print head as the program runs.
10 openl,4,7 20 print#l,chr*<27>"E";"Double strike" 30 printttl,ch r $ (27)"G";"Double strike and emphasized" 40 print#l,chr$(27)"F";ch r $(27)"H";"Neither" 50 closel
Your result will look like this:
Double strike
Double strike and emphasized
Neither
Now you know why combining both methods produces such dark print. In emphasized doublestrike, each letter is printed four times.
Emphasized and doublestrike both produce a higher quality print, but they take considerably more time to print. They also take a toll on your printer ribbon. For these reasons, most people use them only for headlines and occasional words that need emphasis.
SPECIAL EFFECTS
Perhaps you think weve covered a lot of special effects already, but the MPS 1200 still has quite a few more to come. In this section well cover italics, underlining, reverse print, as well as superscripts and subscripts. Except for reverse print, all of these features can be combined with the print width and print density features weve discussed already in this chapter. Together they produce over 200 varieties of print styles!
3-17
Page 68
Italics
Format
BASIC Hex
ON
chr$(27) 4 1B34
OFF
chr$(27) 5 1B35
Italics are another means of adding emphasis and variety to your printing. The MPS 1200 has a complete italic character set separate from its standard roman characters. Because of this, you can com bine any of the features discussed in this chapter with the italic commands. You can print in mean letter quality italics, elite italics, compressed italics, emphasized italics, and so on.
The command to turn on italics is ESC 4. The command ESC 5 turns off italics. Try the following program to see the difference between the MPS 1200s roman and italic characters:
1© openl,4,7
15 for n=32 to 5 6 : a$=a$+ ch r$( n):next n
20 p rin t# l, ch r* <2 7) "4";"Italic characters" 25 print#l,a $ 30 p r i nt # l,c h r$(27)"5";"Normal characters" 35 print#l,a $ 80 printttl,"Normal— ";chr $ <2 7) "4 ";"and italic 90 p ri nt #l ,ch r$ <27 )"5"; "characters"
10 0 c1 os e1
You will see the following results:
Ita lic cha rac ter s
/ " # * % & < ) * + , - . / 0 1 2 3 4 5 6 7 8
Normal char acters
! "#*'/.?<' (>*+,-. /012345678
Nor ma l and it ali c characters
3-18
Page 69
To print a single word or phrase in italics in the middle of a line of
roman print, just insert the italic commands before and after the word as in line 80.
NOTE: Commodore graphic characters do not have an italic font.
Underlining
Format
BASIC Hex
ON
chr$(27) -1’ 1B2D 31
OFF
chr$(27) -O' 1B2D 30
The MPS 1200 can underline any of its print styles, roman or italic.
The underline command is ESC - (hyphen). It uses 1 and 0 as its on and off switches. Sending ESC -1 turns underlining on; sending ESC -0 turns underlining off. You can substitute chr$(l) and chr$(0) for the actual ASCII codes since 1 and 0 work as on and off switches rather than the actual characters.
Another use for underlining is to draw rules, to set something apart, to create special forms, or for fill-in-the-blanks. The MPS
1200 underlines everything, spaces and characters, from the point
that underlining is turned on to the point that it is turned off. The following program illustrates a few underlining effects:
10 open 1,4,7
20 pri nt#l,"The MPS 1200 can ";
30 pr i nt #! ,c h r$(27)"-1 ";"under1 ine"
40 p r in t# l,c h r$ (27)"-0";"or let you sign on the"
50 p ri n t# !,ch r$(27)"-1"; "
60 p r in t# l,c h r$ (27)"-0";" DOTTED LINE"
70 close!
The MPS 1200 can un de r l ine or let you sign on the
DOTTED LINE
3-19
Page 70
Reverse Print
Format
BASIC Hex
OR
BASIC
Hex
ON
chr$(27) r 1B52
chr$(27) chr$(126) 21”
1B7E 32 31
OFF
chr$(27) t 1B54
chr$(27) chr$(126) 20” 1B7E 32 30
Commodore mode only
Format ON
OFF
BASIC
chr$(18)
chr$(146)
Hex
12
92
There are two escape sequences you can use to access reverse print.
One is ESC r (make sure its a lower case r) and the other command is ESC21. The character before the 21 is called a tilde. This symbol probably isnt on your keyboard, so you must use its ASCII code form: chr$(126). This version of the reverse print command uses 1 and 0 as its on and off switches. Sending ESC~21 turns on reverse print; sending ESC~20 turns off reverse print. You can create many special effects using reverse print with some ingenuity and a little programming.
In Commodore mode, you can also turn reverse on and off by sending the control codes chr$(18) to turn reverse printing on and chr$(146) to return to normal non-reversed printing.
5 open 1,4 ,7
10 f or n=32 to 5 6 :a $~ a$ + chr $( n):next n
20 p r i nt #l ,ch r* ( 2 7 > ; ch r$ (1 26 )"2 1" ; "R ev ers e p r i n t" 25 pr i nt # l,a$
30 pr in t # l, ch r* (27) ;c:hr$ (126) "20"; "Not rev er se p r in t" 35 p r i n t# l, a* 40 c lo se 1
Not reverse print
! "#*7.8«' <)*+,-. /0 12345678
3-20
Page 71
Superscript
Format
BASIC Hex
ON
chr$(27) SO 1BD3 30
OFF
chr$(27) T 1BD4
Subscript
Format
BASIC Hex
ON
chr$(27)S r
1BD3 31
OFF
chr$(27) T 1BD4
The superscript and subscript feature prints characters at half their normal height. Superscript prints its characters in the top half of the line, and subscript prints on the bottom half of the line. The width of the script characters matches whatever pitch is in effect. Script characters can be used with all of the MPS 1200s features except reverse print.
The script command is ESC S. It uses 0 and 1 differently from the other commands weve looked at. Sending ESC SO turns on super script; sending ESC SI turns on subscript. ESC T (for text) turns off either mode and returns to normal (full-height) characters.
The following program shows how the script command works:
10 op en 1,4,7 20 print#!,"You";chr$(27)"SO";"TM " ;chr*(27)"T"; 30 print#!,"can print in" ; chr$(27)"S 0 "; " superscript " ; chr*(27)"T " ; 40 print#l,"and";chr*(27)"SI";" subscript ";chr*(27)"T" 50 print#l,"1ike this:"
70 p r i n t # l , c h r * ( 2 7 ) "T"
80 c l o s e !
You can print in and
lik e this:
Ha SCU
3-21
Page 72
Footnotes and mathematical formulas are probably the most com mon use of superscript and subscripts, but they have other uses as well, such as packing a lot of text in a small space, as in some legal contracts, for example.
Character Height
The MPS 1200 has another feature which is especially useful for printing signs and headlines: vertically enlarged printing. To print these characters, the print head makes two passes over the paper, printing the top half in the first pass and the bottom half in the second pass. This makes the character twice as high as regular print.
Vertically Enlarged Print
Format ON OFF
BASIC
chr$(27) h”
chr$(27) u
Hex
OR
1B48
1B55
BASIC chr$(27) chr$(126) 11”
chr$(27) chr$(126) 10
Hex
1B7E 31 31 1B7E 31 30
There are two escape sequences you can use to access vertically enlarged print. One sequence is ESC h (note the lower case h) to turn it on and ESC u to return to normal height printing. The other command sequence is ESC11, which requires you to use the ASCII code chr$(126) for the tilde. This form of the command uses 1 and 0 as its on and off switches. Sending ESC11 turns on vertically enlarged print; sending ESC10 returns to normal height printing.
10 open 1,4,7 20 p rint#l,c hr $(27);chr$(126)"11";"Hey, You!!" 30 print#l,c hr $(27)"G";ch r$ (27);chr*(126)"10";
"That sure got your"
40 p rin t# l,ch r* (2 7> ;c hr *( 12 6) "1 1" ;" A" ; chr$ (27> ;
c h r$ ( 126 )" 10"; "tt en tio n"
50 closel
H ey, You!!
That sure got your Attention
3-22
Page 73
You can use vertically enlarged printing with any of the MPS
1200s character widths: pica, elite, compressed, and expanded. For really professional looking headlines, try near letter quality, ex panded, proportional width, vertically enlarged characters. Verti
cally enlarged printing can also be mixed with most of the MPS
1200s other print styles which you learned about in this chapter.
As you can see in the program that follows, you can combine
vertically enlarged characters and regular characters in one line.
The characters align at the top.
THE MASTER COMMANDS
As youve seen, the MPS 1200 has quite a number of text printing
features, with different commands to turn each feature on and off.
So many, in fact, that keeping track of which features are on and off
when writing a program can be quite a chore. Consider, for exam
ple, how you would tell the MPS 1200 to change from expanded
emphasized pica italic to underlined elite doublestrike. First, you
would turn off expanded with ESC WO, turn off emphasized with
ESC F, and turn off italic with ESC 5. Then you would turn on
underlining with ESC. . . .well, you see what we mean.
Fortunately, there is an easier way. The MPS 1200 has three master
commands that each control several features at once. They are the
master reset command, the master pitch command, and the master
print mode command.
Master Reset
Format ON
BASIC chr$(27)@ Hex 1B40
Master reset is the simplest master command. It cancels all features and allows you to start from ground zero. It is equivalent to switching off the power to the MPS 1200 and turning it on again. Unless you change the MPS 1200s internal switches, master reset will return you to pica, roman, singlestrike, bidirectional print and set the top-of-form.
3-23
Page 74
ui ^
The master reset command is ESC @. Note: Internal switch 1-8
must be set to the OFF position to reset to pica. Try the following
program to see how it works:
10 openl,4,7
20 print#l,chr*<27>"E"chr$(27)"-l";
chr $(27)"Wl" ;
30 print#l,chr$<27) "G"chr*(27) "4" 5 chr$ (27) ;chr*(15)
"One with the works"
O print#l,ch r$ (27)"@",".- . and one without."
0 closel
On « »ith thm storks
...and one without.
You can also do a master reset by sending a secondary address of
10. For example, the statements OPEN 10,4,10:PRINT#10:CLOSE 10 also reset the printer.
Master Pitch
Format ON OFF
BASIC chr$(27)chr$(126)3”chr$(n) chr$(27)chr$(126)3”chr$(0) Hex 1B 7E 33 nh 1B 7E 33 OOh
The master pitch command allows you to change between com pressed and normal print in pica or elite with one command. The
master pitch command is ESC~3. To select the particular pitch combination you want, send its ASCII code number, chrS(n) (with n being 0, 1, 2, 5, 6 or 7) after the master pitch command. Table 3-3 shows the values for n and the corresponding pitch selection.
3-24
Page 75
Table 3-3. Values for Master Pitch Numbers
n Pitch
0 Pica 1 Elite 2 Pica compressed 5 13.3 CPI 6 15 CPI 7Elite compressed * 10
Unlike some other commands weve covered, you cannot attach the pitch number to the master command with a statement like PRINT#l,chr$(27);chr$(126);32”. You must use the chr$ func tion to send the pitch number.
10 open 1,4,7 20 for x = l to 6 30 read n 40 printttl, c hr*( 27 )ch r* <1 26) ,,3 ,,chr*(n) 50 pr i n t# l , "Th is is just one o-f many sp ac ing possi bi li ti es " 60 next x 70 d a t a0 , 1 ,2, 5,6, 7
This is just one o-f many s pacin g po ss ib il iti es
T h is is ju st one o-f many spa cing p o s s ib il it ie s
This is just one of many spacing possibilities
This is just one o-f many spacing p o s s ib ilitie s
This is just one o-f many spacing possibilities
This is just one of
aany spacing possibilities
3-25
Page 76
Master Print Mode
Format
BASIC Hex
ON
chr$(27)“!”chr$(n)
1B21 nh
OFF
chr$(27)“!”chr$(0) 1B21 OOh
The master print mode command is one of the MPS 1200s most powerful commands. With it, you can select most combinations of print pitch, character width, print quality, and special effects using just one command.
The master print mode command is ESC !. As with the master
pitch command, you select the print mode you want by sending the ASCII code corresponding to its print mode number.
Each combination of features on the MPS 1200 is assigned a unique number called the print mode number. For example, elite em phasized expanded compressed underlined italics, thankfully, is simply mode 237. To select this mouthful, you can send the com mand ESC ! chr$(237). Try it with the program below.
10 open 1,4,7 20 p r i n t # l ,chr$(27)"!"chr*(237) 30 p r i n t #l ,"With master print, there are over
100 p oss ibl e combinations"
40 printttl,ch r $(2 7)"!" ch r $ (0) ; "And the re's alwa ys
vanilla, i-f you like."
50 closel
Hith master print, there are oyer 100 possible combinations
And there 's alwa ys vanilla, i-f you like.
The trick to using the master print mode command is knowing the
print mode number for the combination of features you want. With over 100 combinations available, learning their numbers is not the answer.
Fortunately, there is a simple way. Each of the seven features selectable with the master print mode
command has a value associated with it as shown in Table 3-4.
3-26
Page 77
10
20
30 40 50
Table 3-4. Values for Print Mode Numbers.
Bit Feature
Value
0 Pica 0 0 Elite
1 1 Proportional 2 2 Compressed 4
3 Emphasized 8 4 Doublestrike 16
5 Expanded
32
6 Italics
64
7 Underlining 128
The print mode number for any combination of features is the sum of the values of the features, for example:
Elite
= 1
Emphasized
= 8 Expanded = 32 Compressed
= 4 Italic
= 64 Underlined = 128
Print Mode Number = 237
Each feature is controlled by one bit in a byte of memory. The feature is activated when its bit is on, inactive when its bit is off. A feature’s value is the decimal equivalent of the 8-digit binary num ber with a 1 in the position corresponding to the feature’s bit number.
The following program selects any of 256 different print styles. It
can be used as a reference chart showing all of the possible print mode numbers along with a sample of each of the MPS 1200s print styles.
open 1,4,7 print#l,chr*<27>!"chr*<56> print#l, "COMMODORE MPS 1200 PRINT MODE COMMAND'1 print#l,chr*<27>"!"chr*<0> print#l," ULN ITA EXP DDL EMP CMP PRO ELT"
3-27
Page 78
60 p r i n t# ! , " 128 64 32 16 8 4 2 1
70 fo r n7=0 to 128 st ep 128
80 f o r n6=0 to 64 step 64
90 for n5=0 t o 32 s tep 32
100 f o r n4=0 to 16 s tep 16 110 f or n3=0 to 8 s tep 8 120 f or n2=0 t o 4 step 4 130 fo r n 1=0 to 2 s tep 2 140 f or n0=0 to 1 s tep 1
145
pr
i n t # 1 , "
I.
150
if
n7
then
printttl,"
! * " S seise
print#!,
160
i f
n6 then
print#!,"
! *
";:else print#!,
170 if n5
then print#l,"
! * "5 :else
print#l,
180
if
n4
then
print#!,"
! *
";:e 1 se print#l,
190
if n 3 then print#!,"
! *
"5 seise
print#l,
200
if n2
then
printttl,"
! *
"5 seise
print#l,
210
if
n 1
then
print#!,"
! *
";seise
print#l,
220 i f
nO
then
print#!,"
! *
";seise print#!,
230 n=n0+n1+n2+n3+n4+n5+n6+n7
240 p ri nt;# l , " ! " ; 250 p r in t # l, c h r$ ( 27 ) " ! " chr$ (n) ; "P rin t M o d e rn 260 p r in t # l , c h r $ ( 2 7) " '"c hr$ (0) 270 n ext n O ,n 1 ,n 2,n 3, n4 ,n 5,n 6, n7 280 c l os e 1
3-28
Page 79
SPECIAL CHARACTERS AND SYMBOLS
In addition to letters, numbers, and punctuation in both roman and
italic, the MPS 1200 also has many accented characters and graphic symbols in its repertoire.
International Character Sets
Format ON OFF
BASIC chr$(27) FT chr$(n) chr$(27) R chr$(11) Hex 1BD2nh 1B D2 OBh
The MPS 1200 can print accented characters from nine languages by redefining up to 12 of the character codes to accommodate the accented characters and special symbols used in each language. To select a particular set of characters, send ESC R followed by the ASCII code number for the set you want. The values of n are shown in Table 3-5. Although the ESC R command may be sent while the printer is in either uppercase/graphics or upper/lowcrcase
(text) mode, the MPS 1200 will only print the international charac
ters when in text mode. In uppercase/graphics mode, the standard
Commodore graphics character set is used.
Table 3-5. Values of n for International
Character Sets.
n
Country
n
Country
0
U.S.A.
6
Italy
1
France
7
Spain
2
Germany
8
Japan
3
England
9
Norway
4
Denmark I
10
Denmark II
5
Sweden
11
Commodore standard (default)
To print a character from the international character set you select ed, send its PETASCII code number (or its equivalent character in standard PETASCII). The PETASCII codes that change and the international characters are shown in Table 3-6.
3-29
Page 80
Table 3-6. International Characters
Country
PET ASCII Code 35 36 64 91
92
93 94
95
96 123 124
125
126
U.S.A.
# $ ©
[
\
3
{
i
)
France
* $
£
a
9
§
'
£ Ü £
Germany
# $
§ A
Ö
0
A
S
Ö
U
ß
England
£ $
©
l
\
3
A
(1(
}
*-
Denmark 1
# $
©
A
0
A
n
a
0
£
Sweden
# a £ A
Ö A Ü
£
ä
Ö
£ u
Italy
# $
©
o
\
£
Ü £ Ö £ i
Spain
R $
©
»
¿
»
ft }
-
Japan
# $
©
c
¥
3
-
{
1
)
*-
Norway
#
a
£
A 0
A Ü
£
SB
0
£
Ü
Denmark II
# $
£
A 0 A
Ü
£
SB
0
£
u
Commodore
USA/UK
# $
©
C £ 3
*
4-
+
«
1 X
Denmark
# $ © s
0
£
'T
4-
A 0
A
X
Sweden
# $
© ä Ö
£
T*
4-
___
A Ü A
X
Germany # $ §
C \
3
'T
%
A Ö
0
7t
France
# $
©
C
\ 3
e i
o
K
Italy
#
$
©
c \ 3
*
e
i
K
Switzerland
# $ ©
c \ 3
-r
\
e
i
2
K
Spain
#
$ © c \ 3
T*
*
i ¿
K
Note that by selecting the U.S.A. character set, the MPS 1200 will print standard ASCII characters not available on other Commodore dot matrix printers.
To restore the international characters to their standard PET ASCII form, use the command ESC R chrS(ll). International characters
can be used with any of the MPS 1200s other features, including near letter quality, and italics.
Example:
10 o pen 1,4,7 20 pr in t# l,c h r* < 2 7 > "R " c h r* ( 7) 30 p r i n t # l , " 3Ma" ; ch r$ (124) ; "a na en Madrid*?" 40 pr i n t # l , c hr $ (27) " R" ch r* (2 ) 50 p r i n t # l , "f c h , no! En M ";ch r$(125);" n c h e n . " 60 c l o s e l
3-30
Page 81
¿Mañana en Madrid ?
Äch, no! En München.
In the Spanish character set (n = 7), the left bracket, PET ASCII code 91, is redefined as ¡ and PETASCII code 124, is redefined as ñ. Alternately, you could change line 20 to print#l,chr$(91)Hasta
machr$(124)“ana!” which would give you the same results.
Switching Configurations
Format Epson Configuration Commodore Configuration
BASIC chr$(27) ~50 chr$(27) -51 Hex 1B7E35 30 1B7E 35 31 * 30
This command switches the MPS 1200 printer between the Epson FX configuration and the Commodore configuration. You can also change the configuration in the hardware by setting DIP switch 1-3 on or off, but this method overrides the setting of the switch. This command uses 0 and 1 as its on and off switches. Sending the
command ESC 51 switches to Commodore mode, and ESC 50 switches to Epson. Since 0 and 1 work as on and off switches rather than as actual characters, you can substitute chrS(O) and chrS(l) for their actual ASCII codes if you like.
Switching configurations changes the functions of several control codes. The following program issues the same control codes in each configuration, with very different results.
10 ope n 4 ,4 ,7 20 p r i n t # 4 , " E p s o n Mod e: 11 30 p r in t # 4 , c h r * (2 7 ) c h r * ( 1 2 6 )" 5 0 " s g os u b 50 40 pr i n t # 4 , " C o m mo d or e M od e : " 45 p r in t # 4 , c h r * (2 7 ) c h r $ ( 1 2 6 )" 5 1 ": g o s ub 50 46 p r in t # 4 , c h r $ (2 7 ) " 0 " :c lo s e 4 : end 50 pr i n t # 4 , c h r $ ( 1 4) " T h is i s c h r *( 14 ) command" 60 p r in t # 4 , " C o n t in u a t io n o-f c h r * (1 4) on n e xt 1 i n e " ; eh r * (2 7 ) "WO" 70 p rin t # 4 , e h r * (1 4 )" C h r * (1 4) p lu s " c h r * ( 1 5 )"c h r * (1 5) on th e same l in e " 80 p r in t # 4 , c h r* ( 1 5) "C hr* (15 ) p lu s " c h r * ( 18 )"c hr* (18 ) on th e same l in e " 90 p r in t # 4 , c h r * ( 1 4) " C h r * (14 ) p lu s " c h r * ( 20 ) " c h r* (2 0) on the sam e l in e "
100 pr in t # 4 : p r i n t # 4
110 r e t u rn
3-31
Page 82
Epson Mode:
T h i s i s c h < 1 4 ) c o m m a m d
Continuation of chr*(14) on next line C h r '* < 1 ^ > p lu s chr$(lS) on the same li n e Chrf(lS) plus chr* (18) on the same line C h r * < 1
* \-
> p lu s chr*(20) on the same line
Commodore Mode:
T h is i s c h r-* (14) c o m m a n d C o n t i n u a t i o n o -F c h (14) on n e xt l in e
p 1 u is chr$(15) on the same line
Chr«(15> plus M m H M H M m a i C h n ^ (14) p l u s c h ( 2 C) ) o n t h e s a m e l in e
3-32
Page 83
Chapter 4
Page Formatting
Page formatting commands tell the MPS 1200 w here to print (as opposed to text printing commands that tell it h ow to print). This chapter describes the commands that control where your text ap pears on the pagethe distance between lines, page margins, and page length.
THE END OF THE LINE
How does the printer know when to start a new line? There are two ASCII codes that control the end of a lineASCII 13, called a
carriage return,
and ASCII 10, called a line fe e d . Other related com mands are ASCII 141, a carriage return without a line feed in Commodore mode, and ASCII 141 and 138, which work the same as ASCII 13 and 10 respectively, in Epson mode.
Carriage Return
BASIC chr$(13) Hex OD
A carriage return brings the print head to the left margin, but does not advance the paper to the next line. Therefore, many computers automatically add a line feed (ASCII 10) to each carriage return. In Commodore mode, a line feed is automatically added.
You can add an automatic line feed to each carriage return in Epson mode by setting internal switch 1-7 ON if your computer does not add line feeds for you (see Appendix D).
4-1
Page 84
In Commodore mode (DIP switch 1-3 set to OFF), switch 1-7 is ignored. You can still get a carriage return without automatic line feed in Commodore mode by using chr$(141) instead of chr$(13).
Example:
10 op en 1,4,7
20 p ri n t #l , "This is o n";c h r f (13);"two lines' 30 print #l,"but these print"; 40 print#l," on one line." 50 c1ose 1
This is on
two lines
but these print on one line.
NOTE: The semicolon in line 20 tells BASIC not to send a carriage
return (and line feed) to the printer, allowing you to continue the next statement on the same printed line.
Line Feed
BASIC chr$(10) Hex OA * 30
A line feed returns the print head to the left margin and advances the paper to the next line. Many computers automatically add a line feed to each carriage return. If yours does not, you can add a line feed to each carriage return by setting internal switch 1-7 ON (see Appendix D).
Example:
10 open 1,4,7 20 print#l,"This is on ";chr$(10);"two lines" 30 print#l,"Even with semicolons";chr $( 1 0 ) i t'11 be on two lines. 40 close 1
This is on two lines Even with semicolons
it'll be on two lines.
4-2
Page 85
Carriage Return Without Line Feed (Commodore mode only)
BASIC chr$(141) Hex 8D
In Commodore mode (DIP switch 1-3 OFF), sending chrS(141) causes the printer to perform a carriage return without a line feed to move down to the next line. The following programs show how this can be used for such effects as doubleprinting and underlining in Commodore mode.
10 open 1,4,7 20 p r i n t # l ," Carri age Retur n without Line Fe e d";c hr$(141); 30 p r i n t # l ,"C arri age Retu rn without Line Feed"
40 clo se 1
Carriage Return without Line Feed
10 open 1,4,7 20 print#l,"Under1ined Characters";chr*(141); 30 print#!,"
______________________
"
40 close 1
Under1ineri Charac ters
A Note About BASIC
The MPS 1200 normally starts a new line with each PRINT# statement because BASIC sends an end-of-line code for you automatically. In Commodore BASIC, no semicolon at the end of PRINT# statement causes the printer to perform a carriage return. Some commercial software sends both a carriage return and a line feed at the end of each line.
4-3
Page 86
The MPS 1200 can adapt to both situations by means of internal switch 1-7. Setting this switch ON in Epson mode adds a line feed to each carriage return the printer receives. It should be on if your software does not send a line feed with each carriage return. If your software sends a line feed with each carriage return, switch 1-7 should be OFF. In Commodore mode (switch 1-3 OFF), the MPS
1200 always adds a line feed to each carriage return, regardless of
the setting of switch 1-7. You can avoid beginning a new line with a PRINT# statement by
ending the previous PRINT# statement with a semicolon.
LINE SPACING
Each time the MPS 1200 receives a line feed, the paper moves a certain distance. But that distance, called the line spacing, need not always be the same. The MPS 1200 has several commands that allow you to change the line spacing.
When you turn on the printer the line spacing is set to six lines per inch, standard typewriter spacing. This is the setting you will probably use most often for text, but for some applications you may wish to change to a smaller or larger line spacing.
The line spacing commands are based on multiples of 1/72 of an inch. The reason for this odd measurement is that the pins in the print head are spaced 1/72 inch apart. Using this measure, then, allows you to vary the line spacing by as little as one-third of a dot for very fine graphics.
Fixed Line Spacing
Fixed line spacing commands let you change the distance the paper is advanced in fixed increments of 1/6 inch, 1/8 inch, or 7/72 inch. The three commands are described below.
1/6 inch Line Spacing
BASIC chr$(27) 2 Hex 1B32
4-4
Page 87
This command sets the line spacing to 1/6 inch, printing six lines per inch.
Example:
10 o p e n 1 ,4 , 7
20 p ri nt# l," T h e s e li ne s a re sp a ce d "
30 p r i nt# l, "at the d e fa u l t se t t i n g " 40 p r i nt# l, "of six li nes p e r inch ." 50 c l o s e 1
Th es e li n e s a re spac ed at t he d e f au l t s e tt i n g
of six l in e s pe r inch.
1/8 inch Line Spacing
BASIC chr$(27) 0 Hex 1B30
This command sets the line spacing to 1/8 inch, printing eight lines per inch.
Example:
10 o p e n 1 , 4, 7
15 pr i nt# l ,ch r *< 2 7>"0" 20 pr int #l, "T h e s e lines are s p a c e d " 30 p ri nt# l, "at e i gh t li ne s p e r inch" 40 p r in t#l ," us i ng the ESC 0 c o m m a n d " 45 print#l , chr * <27 ) "2 N 50 p r int# l," an d b ac k a ga in " 60 prin t#l," to six l ine s p e r in ch" 70 pri nt#l ,"w it h the E SC 2 c omm and ." 80 c1ose 1
Th e s e li n es ar e sp a ce d at e i g h t l i ne s pe r inch us i n g the ES C 0 co m ma n d
and bac k a g a i n
to six lin e s pe r inch
wit h the E S C 2 c om ma nd .
4-5
Page 88
7/72 inch Line Spacing
BASIC chr$(27) 1 Hex 1B31
This command changes the line spacing to 7/72 inch, printing
approximately 10.3 lines per inch. It is used mainly with graphics
so that the tops and bottoms of the graphic characters connect, but
can be used in other applications as well (see the example below).
Example:
10 open 1,4,7 20 pr int#l, chr#<27) "SO" * chr$ (27) T " 30 print#!,"SMALL PRINT looks good 40 pr in t#:L, " when printed on" 50 print#l,"SMALL LINES" 60 print#l,chr$(27)"@" 70 close 1
8 M A L . L F F. X N T l o o k « a o o d w h « m p r i n t e d can S M A L L L~ XNEHe
NOTE: This program uses ESC SO to select superscript.
Variable Line Spacing
The MPS 1200 has three commands that allow you to vary the line spacing in increments of 1/72, 1/144, and 1/216 of an inchthat is, one, one-half, and one-third of a dot. The finer increments are used mainly for graphics. You can also vary line spacing by increments of 1/216th of an inch using the secondary address.
Line Spacing of n/72 inch
BASIC chr$(27) A chr$(n) (n = 0 to 85) H e x 1 B C 1 n h ( n h = OOh to 55h)
4-6
Page 89
This command sets the line spacing to n/72 of an inch, adjusting the line spacing to 1-dot increments. To use it, send chr$(27) A followed by the ASCII code for the number of 72nds you want, from 0 to 85. For example, chrS(27) A chr$(24) will change the line spacing to 24/72 of an inch or 3 lines per inch.
Example:
10 open 1,4,7 20 p r i n t #l , chr$ (27) "A" r,chr*<24> 30 for n=l to 3 40 pr in t# l , "These lines are 24/72 of an inch apart." 50 next n 60 p ri n t # l ,c h r$(27)"®" 70 clo se 1
These lines are 24 /72 of an inch apart.
These lines are 24/7 2 of an inch apart.
These lines are 24/72 of an inch apart.
Line Spacing of n/144 inch
chr$(27) chr$(126) 0 chr$(n) 1B7E 30 nh
BASIC Hex
(n = 0 to 125)
(nh = OOh to 7Dh)
This command sets the line spacing to n/144 of an inch, adjusting
the line spacing to 1/2-dot increments. To use it, send chr$(27) ~0 followed by the ASCII code for the number of 144ths you want, from 0 to 125. For example, chr$(27) ~0 chr$(12) will change the line spacing to 12/144 of an inch or 12 lines per inch.
Example:
10 open 1,4,7 20 prin t#l ,ch r*(2 7); chr *(12 6)" 0"c hr$ (12) 30 for n= 1 to 3 40 pr i nt #l ,"These lines are 12/144 of an inch apart." 50 next n 60 print#l,chr*(27)"®" 70 close 1
» i i i
4-7
Page 90
Line Spacing of n/216 inch
BASIC chr$(27) 3 chr$(n) (n = 0 to 255)
Hex1B 33 nh (nh = OOh to FFh)
This command sets the line spacing to n/216 of an inch, adjusting
the line spacing to 1/3-dot increments. To use it, send the printer chr$(27) 3 followed by the ASCII code for the number of216ths you want, from 0 to 255. For example, chr$(27) 3 chr$(24) will change the line spacing to 24/216 of an inch or 9 lines per inch.
Example:
10 open 1,4,7 20 print#l,chr*<27) ,l3"chr$(24) 30 for n=l to 3 40 pr i nt #l ,"These lines are 24/216 of an inch apart." 50 next n 60 print#l,chr*<27) 70 close 1
These lines are 24/216 of an inch apart. These lines are 24/216 of an inch apart. These lines are 24/216 of an inch apart.
n/216 inch Spacing with Secondary Address 6
Theres another way to change line spacing, by using the secondary address of the OPEN command. A secondary address value of 6 controls the number of n/216 steps between successive lines of print. The number you give is divided into 216 to determine the number of lines per inch. Thus, a value of 27 produces eight lines per inch, 72 produces three lines per inch, etc. The default value is 36, which produces 6 lines per inch. The following illustrates spacing determined by a secondary address:
4-8
Page 91
10 open 4,4,7
20 open 6,4,6
25 -for t=l to 5
30 read i 40 pr int# 6 , c hr$(i) 50 print#4,"HHHHH"; 60 next t 70 close 6:close 4
100 da t a l ,27,36,72,144
A Variable Line Spacing Example
The following program demonstrates the different spacing you can get with the variable line spacing commands:
10 open 1,4,7 20 k=0s print#l chr$ (27) ; »-l'1 30 sp*(1)=chr$(27)+ "A"s sp*(2)=chr*(27)
+chr$ <126)+"0": sp$ (3) =chr$ (27) + "3"
40 50
p rin t# l," S pa c in g gosub 110
vari ed
by
1/72 o f
an inch :
60 70
p r in t # l , "Sp acing gosub 110
vari ed
by
1/144 of
an inch
80 90
p r in t # l , " Spac ing gosub 110
vari ed
by
1/216 o f
an inch
100 p r i n t# l ,c h r* < 2 7) " -O " ;s e n d 110 k=k + l 120 -for n=0 to 20 130 if n=9 then goto 170 140 if n = l 3 then go to 170 150 p ri nt # l,s p$(k );c h r $ (n ); 160 go su b 210 170 next n 180 p r i n t # l , c h r * < 2 7 ) "2"
190 pr int #l 200 return 205 rem next line leave 40 sp aces 210 pr in t# l,"
220 return
230 do sel
4-9
Page 92
Spacing varied by 1/72 o-f an inch
Spacing varied by 1/144 of an inch:
Spacing varied by 1/216 of an inch:
In this program, line 20 initializes the counter K and turns on underlining. Line 30 defines the three variable spacing commands as SPS(l), SP$(2), and SP$(3). The commands are actually sent in the subroutine beginning at line 110. The counter K determines which command is needed and line 150 sends it and the value chr$(n) to the printer. The subroutine at line 210 then prints 35 underlined spaces. Line 180 resets the spacing to six lines per inch and line 190 skips a line to begin the next set of lines.
4-10
Page 93
f -4 K»
VARIABLE LINE FEEDS
If you want to move to another line without returning to the left margin, the MPS 1200 provides one command to do this. It allows you to move down in 1/216 inch increments.
Line Feed of n/216 inch
BASIC chr$(27) J chr$(n) (n = 0 to 255)
Hex1B CA n h ( n h = OOh to FFh)
The one-time line feed command immediately advances the paper whatever distance you specify without changing the print head position. To use it, send chr$(27) Jfollowed by the ASCII code for the number of 216ths you want, from 0 to 255.
Example:
10 open 1,4,7
0 print#l,"ESC J chr$<18) advances the paper"chr$(27)"J"chr$(18); 0 print#l,"one half line."
40 closel ESC J chr$(18) advancers the paper . , . . .
r r one half line.
PAGE DESIGN
In addition to the commands to control spacing between lines, the MPS 1200 provides several commands that allow you to adjust the overall placement of the printing on the page.
New Page (Form Feed)
BASIC chr$(12) Hex OC
A form feed advances the paper to the top of the next page, the same as the FF switch on the MPS 1200s control panel does. The MPS 1200 measures the length of the page starting with the posi tion of the paper when you first turn on the printer. Therefore, in order for the form feed command to advance the paper the proper distance, you must line up the top of the page at the print head when you turn on the printer or after you send a master reset (ESC @) command or secondary address 10.
4-11
Page 94
You can substitute chr$(140) for chr$(12) in Epson mode to get the same results. You can set the power-on default page length to either 11 inches by setting internal switch 1-5 OFF, or to 12 inches by setting switch 1-5 ON. (See Appendix D.) You can also set the
page length with ESC C.
Example:
10 open 1,4,7
20 pr int #l, "Top o-f page 1 "
30 pr int# 1, chr$ (12) ; " Top o-f page 2M 40 closel
Page Length
When you first turn on the MPS 1200, the page length is set to 11 inches (or 12 inches if internal switch 1-5 is set ON). Each form feed, therefore, advances the paper 11 inches. Although this is the most common page length, some applications may require a differ ent page length setting. Labels, envelopes, and computer checks are examples.
You can set the page length through software control in two ways: by the number of lines, or by inches. The command to do this is ESC C.
Set page length by lines
BASIC chr$(27) C” chr$(n) (n = 1 to 255) Hex 1BC3 nh (nh = 01 h to FFh)
This command sets the page length to n lines. To use this com mand, send the printer ESC C followed by the ASCII code for the number of lines you want, from 1 to 255. For example, chr$(27) C chr$(6) sets the page length to 6 lines, a typical setting for mailing labels.
The actual page length is set internally in inches, determined by multiplying the lines per page by the line spacing in effect at the time. Later changes in line spacing, therefore, have no effect on the length of the page. (They will change the number of lines per page, however.)
4-12
Page 95
10 open 1,4,7
20 print#l,chr$<27)"C'chr*(6> 30 -for n=l to 3 40 printttl,"Name" 50 p ri n t #l , "Address" 60 p r i nt # l, "C ity , State" 70 p ri n t #l ,ch r$(12) 80 next n 90 c1ose 1
Name
Address City, St ate
[3 Lines]
Name Address City, State
[3 Lines]
Name Address City, State
You can also set page length in Commodore mode by using secon dary address 3 along with the control codes chr$(147) to turn paging on and chr$(19) to turn paging off. Send chrS(147) first to turn paging on; if you dont include a secondary address of 3, page length defaults to 60 lines (so 6 blank lines are left at the bottom of the page). The number given with the file in the OPEN statement with the secondary address of 3 (chr$(56) in line 40) specifies the number of lines per page. So the statements
10 open 4,4,7
20 open 2,4,3
30 p r i n t # 4, c h r $(147) 40 p r i n t # 2, c h r $(56) 50 c lose 2:clo se4
set the page length to 56 lines. To turn paging off, send the printer
chr$(19). Theres a little more on using chr$(147) and chr$(19) on setting the top and bottom margins later in this chapter.
Example:
4-13
Page 96
Set page length by inches
BASIC chr$(27) C” chr$(0) chr$(n) (n = 1 to 150) H e x 1 B C 3 00 n h ( n h = 01 h to 96h)
This command sets the page length to n inches. To use this com mand, send ESC C followed by chrS(O) and then the ASCII code for the number of inches you want, from 0 to 150. For example, chr$(27) C chr$(0) chr$(7) sets the page length to 7 inches, a typical length for many computer forms. Line spacing has no effect on the page length set in inches.
Example:
10 open 1,4,7 20 print#l,chr*<27)"C"chr*<0>;chr*<3> 30 print#l,"Customer N u mberchr $ (9);"Order Numbers" 40 print#l,ch r* (12);"Customer N u m b e r c h r$ (9);"Order Numbers" 50 print#l,chr*<27) "C"chr*<0> ;chr*<ll> 60 close 1
Customer Number: Order Numbers
Customer Numbers Order Numbers
When you run the program above, you will see the information printed twice, three inches apart. Line 40 resets the page length to 11 inches.
MARGINS
The MPS 1200 has four commands that let you set the margins on your page. In order for these commands to work properly, the MPS 1200 must know where the top of the page is. Therefore, always make sure the top of the page is lined up with the metal ribbon guide when you turn on the MPS 1200.
4-14
Page 97
Top and Bottom Margins
ON OFF
BASIC chr$(27) N” chrS(n) chr$(27) 0
(n = 1 to 127) 1BCF
Hex IBCEnh
(nh = 01 h to 7Fh)
The top/bottom margin command, ESC N, is sometimes called the skip-over-perforation command. It sets the number of lines to skip at the bottom of every page (above the perforation on continu ous paper). To use the top/bottom margin command, send ESC N followed by the ASCII code for the number of lines you want to skip. For example, chr$(27) N chr$(6) skips six lines at the bottom of the page.
To set the top margin, first line up the top of the page at the ribbon guide (the first line prints approximately 3/8 inch from the top, which is equivalent to skipping one line). To increase the top margin, advance the paper the required number of linesmanually or using the LF switch with the MPS 1200 off-lineand then switch the power off and on to reset the new top of the form.
Now, when you send the ESC N command, add the number of
lines in the top margin to the number of lines in the bottom margin
and use the sum with ESC N. For example, to get a 6-line margin at the top and bottom of each page, the total number of margin lines is 12. Set the top of the page five lines above the ribbon guide and send the command chr$(27) N chr$(12).
The ESC O (letter O) command cancels the top/bottom margin or skip-over-perforation. When set with ESC N, the skip-over-pcr- foration feature can also be canceled by changing the page length or by the master reset command.
4-15
Page 98
Example:
10 open 1,4,7
20 p ri nt #l ,c hr *( 27 >" C 'c hr *(8)
30 print #l,chr$<27>"N"chr*< 3> 40 -for i = l to 14 50 p r i n t# l ,"1 ine number ";i 60 next i 70 print #l,chr*<27>"®" 80 c 1 ose 1
line
number
i
line
number
line
number
TT o
1 ine
number-
4 line number 5 line
number 6
1 ine
number
7
1 ine number
8
1 ine
number
9
1 ine number 1 0 1 ine
number
11
line
number
12
1 ine number
13
line
number 14
NOTE: In the program above, a top margin of 1 line is set by moving
the paper down one line, then turning the power off and on again. The bottom margin is 2 lines.
4-16
Page 99
Setting Margins with the Secondary
Address (Commodore mode only)
ON OFF
BASIC chr$(147) chr$(19) Hex 93 13
In Commodore mode, chr$(147) works the same as the escape code chr$(27)“Nchr$(6) and chr$(19) turns off paging as does the se quence chr$(27)“0 . chr$(147) can be very useful in long BASIC programs. With this code, you can print out a long listing skipping over the page perforation. An example of this application for LISTing long BASIC programs:
open4,4,7:cmd4,chr$(147);:list:print#4:close4
Left Margin
BASIC chr$(27) I chr$(n) (n = 0 to 255) H e x 1 B 4 C nh (nh = OOh to FFh)
The ESC 1 (lower case 1) command sets the left margin at column n. Printing starts at column (n + 1). To use it, send ESC 1 followed by the ASCII code for the column number you want. For example, chr$(27) 1 chrS(10) sets the left margin at column 10, leaving 10 blank columns (printing will start in column 11). The actual width of the margin is determined by the character width in effect when
the margin is set. Later changes in the character width do not affect the width of the margin.
If the margin setting exceeds the maximum number of columns in a line for the character width in effect, the setting is ignored.
4-17
Page 100
10 open 1,4,7
20 p ri n t # 1,"123456789012345678901234567890" 30 print #l,"Th e power-on left margin"
40 pr i n t# l ,"starts at the left-most" 50 p r in t # l,"print position." 60 print#! ,chr $(27) " l"chr* (10)5 70 pr int#l,"Th e left margin now starts" 80 print#l,"at column (n + 1) which" 90 print#l,"is column 11."
100 p ri nt # l,chri(27)"1"chr $ (0); 110 pr i n t# l ,"Default left margin again."
12 0 close 1
1234567890123456789012345678 90 The powei on left margin starts at the left-most
print position.
The left margin now starts at column (n + 1) which
is column 1 1.
Default left margin again.
Right Margin
Example:
BASIC chr$(27) Q chr$(n) (n = 1 to 255) H e x 1 B D 1 n h ( n h = 01 h to FFh)
The sequence ESC Q sets the right margin at column n. To use it, send ESC Q followed by the ASCII code for the column number you want. For example, chr$(27) Q chr$(70) sets the right mar
gin at column 70. This will allow printing up to (and including) column 70. The actual width of the margin is determined by the character width in effect when the margin is set. Later changes in the character width do not affect the width of the margin.
The minimum value of n is 1 as expanded character width.
4-18
Loading...