USER’S MANUAli h NOT INTENDED FOR SALE PN 80821206 -___ --.-. - .-_.
Federal Communications Commission Radio Fre uency Interference 3 tatement This equipment generates and uses radio frequency energy and if not installed and used properly, that is, in strict accordance with the manufacturer’s instructions, may cause interference to radio and television reception.
A Special Message to the New Owner Congratulations for choosing this printer, one of the finest available at any price. Your new printer will reward you with many years of high-quality document printing, and is backed by Star Micronics’ more than 30 years in manufacturing precision parts. You already know that it represents the state of the art in tack-sharp dot matrix printing with its rugged 24-pin print head.
Table of Contents Chapter 1 Setting Up Your Printer Where shall we put it? What have we here? Removing the printer cover Removing the packing tube Removing shipping screws Installing the platen knob Installing the ribbon cartridge Installing the mute cover Installing the interface board Installing the font cartridge 1 Chapter 2 Getting to Know Your Printer Controls and parts of the printer Parts of the printer Controls and indicators Extra functions Other controls Selecting and loading paper Loading sin
Chapter 4 Controlling with BASIC Some basics about BASIC First steps Establishing communications The CHR$ function Control codes The escape codes A note on command syntax Some problem codes 33 Chapter 5 Printing Text Some special kinds of text Letter Quality characters Characters in the Font Cartridge Underlines and overlines Boldface printing Superscripts and subscripts Changing the print pitch Expanded print Condensed print Proportional printing Mixing print modes 39 Chapter 6 53 Formatting Text Li
73 Chapter 7 Special Features of the Printer Now hear this Resetting the printer Putting your printer to sleep Printing the bottom of the sheet Backspace, delete, and cancel text Immediate-print Adjusting the width of space between characters Repeat characters Uni-directional printing The seven bit dilemma Block graphics characters and special symbols International character sets Printing BIG characters The optional sheet feeder Reading a hex dump Chapter 8 89 Creating Your Own Characters Dot matrix pri
Chapter 9 107 Dot Graphics Comparing dot graphics with download characters Using the dot graphics command Specifying the number of columns of dots Specifying the graphics data Combining text and graphics Printing a design or logo Plotting with your printer How the program works Using the 24-pin graphics mode Compatibility with existing software Redefining alternate graphics codes Chapter 10 Caring for Your Printer Cleaning the printer Replacing the ribbon Replacing the print head 127 -- - ~~ ~,-- .
,. Appendix G Serial Interface Specifications Configuring the serial interface The serial protocols Serial busy protocols XON/XOFF protocol ACK protocol Appendix H 209 Connecting with Computer Connecting with IBM-PC and Compaq BASIC programming Listing programs Connecting with Apple II computers Applesoft BASIC Listing programs Connecting with TRS-80 computers TRS-80 BASIC Listing programs Connecting with Kaypro, Osborne, and other CP/M computers Using MBASIC Listing programs 203 ‘_ .,.
I CHAPTER 1 SETTING UP YOUR PRINTER Subjects we’ll cover in Chapter 1 include. Choosing a suitable place for your printer; l Unpacking your new printer; l Setting it up. WHERE SHALL WE PUT IT? Before you do anything else, give some thought to where you’ll be using your printer. Obviously, it will be somewhere near your computer. And both printer and computer will lead longer, healthier lives if they like their surroundings. For instance, we recommend. . .
Check to make sure you have all six items: 1) Printer, igure l-l. 2) Mute cover, 3) Paper guide, 4) Platen knob, 5) Ribbon cartridge, and 6) User’s manual. You should also have a parallel interface board to connect your computer to the printer. Also available are a parallel interface board with extra buffer memory and a serial interface board, both optional. (More on the interfaces later.
3 tion and movement for both removing and replacing the cover. I Figure l-2. Remove the printer cover by lifting carefully. n Removing the packing tube The printer is shipped with a protective spiral tube to keep the print head from being damaged during shipping. We have to remove this tube. First, take off the printer cover. See the tube on the carriage rail (Figure l-3). Pull it off carefully. I Figure 1-3. Remove the protective tube from the carriage rail.
4 To get at these, remove the printer cover from the printer. Then remove the screws with a Phillips screwdriver as shown in Figure l-4. You’ll be smart to save these screws, along with the rest of the packing material and the shipping carton, in case you ever have to ship the printer. Tape the screws somewhere on the carton or packing. Figure 1-4. There are two shipping screws inside the printer, dur- ing shipping. They should be removed before use.
L Figure 1-5. Press the cartridge into place until the holding springs snap into place. 1. Turn off the power and remove the printer cover. 2. Now slide the print head gently to the center of the printer. Warning: The print head gets hot during operation, so let it cool off before you touch it. Print head Figure 1-6. All you have to do is to slide the print head carriage manually to your right or left, then the ribbon slips down by itself into its proper position.
6 3. Using the guide holders as a fulcrum with the ribbon facing away from you, as shown in Figure 1-5, lightly press the cartridge down until the two holder springs snap shut to hold the cartridge firmly in place. 4. Check that the cartridge fits so that the drive pins engage the cartridge teeth. 5. Gently slide the print head carriage manually all the way to your right or left until the ribbon automatically slips down into its proper place between the print head and the silver ribbon guide. 6.
I 7 Up to this point, we’ve been clearing the decks for action, so to speak. There are only a couple more things left to do before we can start printing - install the interface board and the font cartridge. W Installing the interface board I I Interface cover Interface board Figure 1-8. Slide the I/F board into the slot. The parallel interface board that comes with your printer contains all the electronics that your printer needs to talk to a computer.
8 n Installing the font cartridge This printer is mounted the Prestige characters as standard. You can add two different character styles by installing the optional font cartridges to the printer. To install or change a font cartridge, start by turing off the power switch. Fit the font cartridge into the slots and slide it all the way. Figure 1-9. switch off.
CHAPTER 2 GETTING TO KNOW YOUR PRINTER Subjects we’ll cover in Chapter 2 include what they’re for and how l Parts of the printer to use them; l Paper selection and loading; l Adjustment; l Testing printer operation. CONTROLS AND PARTS OF THE PRINTER W Parts of the printer First, we’ll go over the parts of the printer. You saw most of these when you unpacked your printer. Now we’ll give you a brief explanation of what they do.
Mute cover Printer cover Font cartridge slot ’ Interface cover L Figure 2-1. Front and rear views of the printer. INTERFACE COVER - On the back of the printer, this conceals and protects the interface board. The cover is cut away to expose the external connector to which you attach your computer cable.
11 SLOTS FOR FONT CARTRIDGES - These are the two openings at the bottom right of the front of the printer. Inserting an optional font cartridge pushes the small door up out of the way and exposes a connector which accepts the cartridge. H Controls and indicators Now let’s go over the controls and indicators of the printer, starting with the control panel on the right. There are seven indicators and five keys on the control panel. Figure 2-2. The control panel.
TOF KEY - Ejects the current sheet, feeds a new sheet, and moves the print head to the left margin. PAPER FEED KEY --Advances the paper one line at a time when the On Line indicator is off. If you hold the key down, you can get consecutive line feeds, one after the other. ON LINE KEY and INDICATOR - Glows green when the printer is ready to receive data from your computer (on line). When the printer is off line, it sends a signal to the computer indicating that it cannot accept data.
foration skipping. planation. See Appendix SELECTING AND LOADING A for a complete list and ex- PAPER Your printer can handle the two basic types of paper - single sheets (stationery, envelopes, multipart business forms, etc.) and continuous paper (fan-fold perforated paper). This is a good place to tell you about the release lever, which you’ll be using often. This lever controls the pressure of the paper against the platen.
,. .: .. n Loading single sheets Now, instead of feeding the paper in manually by turning the platen knob, we’re going to use the release lever for automatic feeding (the printer must be turned on). Single sheets from 5.5 to 14.5 inches wide can be used. OK? Let’s start. 1. Move the sprockets and sheet guides on the tractor feed unit all the way to the ends. 2.
15 ._ . . L,. i. 6. L. L I Figure 2-5. Prop up the paper guide by inserting the guide stand in the notches provided for it. 1 L. L L. L Figure 2-6. lever.
16 6. Align a sheet of paper on the guide along the adjuster. 7. Turn on the power switch. (The Paper Empty indicator will glow because there is no paper.) 8. Now set the release lever to the auto-feed setting-the top position. The printer will advance the paper automatically. 9. When the paper stops, set the release lever for single sheets again. To align paper that is not in straight. Set the release lever to the adjustment setting. l Straighten the paper and adjust it for the margins you want.
17 I Sprocket cover Figure 2-7. pigure 2-8. Open the sprocket covers to expose the sprocket teeth. Ready to run with sprocket-feed paper.
18 11. Set the release lever to the auto-feed setting. The printer will advance the paper automatically. 12. When the paper stops, set the release lever for sprocketfeed paper again. 13. Finally, install the paper guide on the printer. You can install it either to lie flat as shown in Figure 2-8, or to raise as shown in Figure 2-9. Now you’re ready to roll! __ -- ‘igure 2-Y.
19 Figure 2-10. of paper. The adjustment lever allows for different thicknesses You shouldn’t have any trouble finding the right gap setting for your paper. If necessary, experiment; you’ll soon find the best position for the paper you’re using. EXTRA FUNCTIONS WITH THE COUTRUL PANEL There are many functions that are not directly specified on the control panel. In this section, we’ll show you these extra functions.
Self-test 1 DIP switch 2-2 ON ‘+,-./0123456769:;<=,?BABCDEFGHIJKLMNOPORSTUVWXYZ[\] DIP switch 2-2 OFF !“t$t&‘()*+,-./0123456784:;~=~?@ABCDEFGHIJKLMNOPORSTUVWXYZ[\]~~~~b .<=>?@ABCDEFGHIJKLtlNOPQRSTUVWXYZ[\]---ab !“Y$%h’()“+,-./0123456709:, !“tSt&‘()*+,-./0123456789:;<.,7eABCDEFGHIJKLMNOPQRSTUVWXYZ[\]-~~8b *<=>?@ABCDEFGHIJKLtlNOPQRSTUVWXYZ[\]!“#S%h’()g+,-./01234S6709:, !“~$tb’()~+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOP~RSTUVWXYZ[\]-~~~b !“#$X&‘()‘+.-.
cdefghijklmnopqrstuvwxyz(~)cdefghijklmnopqrstuvwxyz( cdefghlJklmnopqr~tuvwxyz(~)- I)- cdefghijklmnopqrstuvwxyz(: cdafghljklmnopqr~tuvwxyl(l)- )- cdefghijklmnopqrstuvHxyz(l)- cdefghlJklmnopqrrtuvwxyz(~)dafghljklmnopqr~tuvwxyz(~}efgh!jklmnopqr¶tuvwxyz(~)- !“tl$Xh !“lLSt&’ !“?lSS&‘() fgh~Jklmnopqrstuvwxy2(:)gh~Jklmnopqrstuvwxyz(: hlJklmnopqr~tuVWxyz{:)- !“#S%&‘O’ 1‘ ()‘+,-./0123456769:;cl,?eABCDEFGH ( )‘+,-./0123456769:;<‘>?eABCDETGHI l+,-./0123456789:;c=>?@ABCDEFGHIJ +,-.
1. Plug in the printer (don’t turn it on yet). 2. Insert a sheet of paper, as you did for the self-tests. 3. While holding down both the Paper Feed and Mode keys, turn on the power switch. When you want to terminate the power switch. the hex dump function, turn off n Panel modes As you’ll learn in Chapter 5, this printer has many software controls. But if you want to print in one fixed mode, ignoring the control codes, these Panel modes take effect for you.
23 1. Plug in the printer (don’t turn it on yet). 2. While holding the TOF key and the Paper Feed key, turn on the power switch. When you want to cancel this mode, switch. During normal operation turn off the power - Top of foms”-Ti j 1 * * ** ** * * I I I ** I **: Hold down *: Press II (Left Right margin set margin set Figure 2-13. You can set many functions by the combinations the control panel keys while in the Off Line mode.
24 you can reset it by the following procedures. 1. Set the Off Line mode by pressing the On Line key. 2. While holding the Print Pitch key, press the TOF key. Your printer acknowledges the new top of form with the sound of beep. n Setting the left and right margins As you’ll learn in Chapter 5, you can set the left and right margins with the control codes. In addition, you can set them manually just like a typewriter by the following procedures. 1. Set the Off Line mode by pressing the On Line key. 2.
I. Make sure that both your computer and printer are turned off. 2. Connect the printer end of the interface cable to the connector socket at the right rear of the printer as shown in Figure 2-14. 3. Connect the other end of the cable to your computer as described in the computer manual.
MEMO -
CHAPTER 3 USING COMMERCIAL SOFTWARE Subjects we’ll cover in Chapter 3 include. Using your printer with SuperCalc; l Using your printer with word processors. Many of you purchased this printer to use with commercial software. You made a good choice because this printer is compatible with most commercial program, from word processing programs to spreadsheet programs to accounting programs. Many of these programs have a routine for describing your printer. These routines are often in “installation programs.
28 need to know to use your printer as a regular printer. But this printer isn’t just a regular printer. Your printer has many capabilities that your commercial software isn’t aware of. A little later we will see what it takes to use some of your printer’s advanced features with commercial software. n First, some terminology Your printer knows what to print because it knows how to interpret the codes that the computer sends to it. These codes are numbers that the computer sends to your printer.
29 .. L. .^. u. L. c L. c.. L simultaneously pressing a letter key. The particular letter key that is pressed determines what code is sent. Control and A sends ASCII code 1, control and B sends ASCII code 2, and so on. Because of the way they are created, these codes are often referred to as “control-A” etc. So there are four common ways of referring to the same set of codes: the character or name of the code, the decimal ASCII value, the hexadecimal ASCII value, and the “control-” value.
are now available. It has the capability of using several of the advanced features of your printer. Perhaps the most often used feature with spreadsheet programs is compressed printing. Let’s see how to use compressed printing with SuperCalc. In SuperCalc, the /Output command provides out put to the printer. One of the options of the /Output command is S(etup). This option provides you with a menu of functions to configure SuperCalc to match your printer.
cessor handles it. Once you understand the concept you should be able to use your program manual to figure out how your word processor does it. The program that we will study is‘the EasyWriter word processor for the IBM Personal Computer. This uses a fairly typical method of handling special codes. Generally, word processing programs don’t want you to put non-printing codes in the file. They “know” that they won’t print anything, and so they “protect” you by not letting you use them.
32 MEMO
CHAPTfiR 4 CONTROLLING WITH BASIC Subjects we’ll cover in Chapter 4 include* Listing BASIC programs on the printer; l Printing from BASIC; l CHR$ function; l Command syntax; l Problem codes. In this chapter we will be teaching you how to use your printer’s features using the BASIC programming language. It is easy to communicate with your printer from BASIC and, though it has its detrators, BASIC is the nearest thing to a universal language among users of personal computers.
c LPRINT things other than character strings. We started with Microsoft BASIC because it is the most widely used version of BASIC around. The programs in this manual are written in Microsoft BASIC so they should run on most computers. But if strange things happen when you try to run a program, check the BASIC manual that came with your computer. Let’s talk about Apple II computers for a minute. These enormously popular computers use their own brand of BASIC.
35 BASIC program. Generally, computers use about the same procedure for printing in a program as they do to list a program. Let’s try what we learned. Type the following: NEW 10 LPRINT "TESTING" RUN Remember-we use LPRINT; you may have to use something else! At any rate, you should have the word “TESTING” on your printer. Quite an achievement, isn’t it? Let’s get done with this simple stuff so that we can go on to something interesting.
36 Where did that noise come from? That’s the printer’s bell. We will learn more about it in Chapter 5. We just wanted to illustrate a code that causes the printer to perform a function. n The escape codes Back when the ASCII system was set up, computer equipment was relatively simple and thirty-three control codes were considered sufficient at the time.
37 ending with 0. So for out example above, any of these BASIC statements have the same result: L”. i. c, L- cc. L c... I-. will LPRINT CHR$(27);"W"CHR$(l) LPRINT CHR$(27);"W"CHR$(49) LPRINT CHRS(27);"Wl" Even though, of ASCII code substituted. In show CHR$(O) there are many commands that require the use 0; the character “0” (ASCII code 48) cannot be these cases, instead of an unadorned 0 we will each time these commands are referenced.
38 MEMO
CHAPTER 5 PRINTING TEXT Subjects we’ll cover in Chapter 5 include* Letter quality (LQ) characters; l Underlining and overlining; l Superscripts and subscripts; l Print boldface; l Print pitches. The rest of this manual will show you a little BASIC - just enough for you to use your printer. We’re not going to try to make you an expert programmer, though, only get you started.
40 printing, for it takes a keen eye to detect matrix printer. Normally, your printer characters when the DIP switch 1-4 is set for most work and it prints fastest. But for Letter Quality. The program below shows 10 20 30 40 50 ' Demo LPRINT LPRINT LPRINT LPRINT that it is from a dot prints draft quality off. This is adequate the final printout, try how. of LQ character set CHR$(27) ; "xl"; "This line shows LETTER QUALITY!'* CHR$(27) ; “x0” ; "This line shows standard print.
60 70 80 90 LPRINT “This line shows Font 2 characters.” LPRINT CHR$(27);“k”;CHR$(O); LPRINT “This line shows Internal Characters.” END When you’ve installed the Gothic Font Cartridge to the font slot 1, and the Italic Prestige Font Cartridge to the font slot 2, the results of this program look like this: This line This This line shows line shows shows Font 1 characters. Font 2 characters. Internal Characters.
42 Table 5-3 Underline and overline commands 1Function 1Control code Underline ON Underline OFF Overline ON f Overline OFF (ESC) (ESC) (ESC) 1 (ESC) , \---I I “-“l “-“0 “p”1 “‘-“O - Again, that’s simple. Let’s try it with this program: ’ Demo of underlining and overlining LPRINT “Demo of “; LPRINT CHR$(27) ;“-1”; LPRINT “UNDELINED”; LPRINT CHR$(27) ;“-O”; LPRI NT ‘* and ” ; LPRINT CHR$(27);” 1”; LPRINT “OVERLINED”; LPRINT CHR$(27) ; “-0” ; 100 LPRINT ” printing.
43 with boldface printing. The following table shows the control codes for getting into and out of boldface mode. Table 5-4 Boldface print commands Function Control code Boldface ON Boldface OFF (ESC) “E” or (ESC) “G” (ESC) “F” or (ESC) “H” Try this short program 10 20 30 40 50 ' Demo LPRINT LPRINT LPRINT LPRINT of boldface CHR$(27) ; “E” ; “This line is BOLDFACE printing." CHR$(27);"F"; "This line is normal printing.*' Run this program.
; . 44 Table 5-5 Superscripts and subscripts commands Function Control code Superscript ON Subscript ON Super and subscript OFF (ESC>“S”O (ESC)“S”l (ESC)“T” Try this program to see them work: - 10 ' Demo of superscripts and subscripts 20 LPRINT "Look! "; 30 LPRINT CHR$(27);"SO"; 40 LPRINT "SUPERSCRIPTS *'; 50 LPRINT CHRS(27);"T"; 60 LPRINT "& **; 70 LPRINT CHRS(27);"Sl"; 80 LPRINT "SUBSCRIPTS "; 90 LPRINT CHR$(27);"T"; 100 LPRINT "on one line." Look! SUPERSCRIPT5 & SUBSCRIPTS on one line.
45 Table 5-6 Print pitch commands Pitch Pica Elite Characters/inch 10 12 Control code (ESC) “P" (ESC)“M" Try this program to see how these two pitches work. 10 20 30 40 50 ' Demo LPRINT LPRINT LPRINT LPRINT of pica and elite pitches CHR$(27);"M"; "This line is ELITE pitch." CHRS(27);"P"; "This line is PICA pitch (normal)." When you run this program you should get this: This line is ELITE pitch. This line is PICA pitch (normal). Line 20 turns on elite pitch with (ESC) “M”.
_:_. - 46 Demonstration Notice that automatically of EXPANDED EXPANDED turns off at printing. mode the end of a line. Expanded printset with CHR$(14) is automatically cancelled at the end of the line. This is convenient in many applications, such as for one line titles. Note that you didn’t need to put an (ESC) in front of the CHR$(14), although (ESC) CHR$(14) works just the same. You can also cancel one line expanded print before a carriage return with CHR$(20), as done in line 50.
I? / 47 :’ n Condensed print Each of the print pitches also can be condensed to its normal width. This is called condensed print. Try this program to see how it works: 10 20 30 40 50 60 ’ Demo LPRINT LPRINT LPRINT LPRINT LPRINT of condensed pitch "Demonstration of "; CHR$(15); "CONDENSED"; CHR$(lS); w printing." Demonstration of CONDENSED printing. Condensed print set with CHR$(15) stays on until you turn it off with CHR$( 18).
48 100 110 120 130 140 150 160 170 180 190 200 210 220 230 LPRINT CHR$(27);"P"; LPRINT "This line is NORMAL PICA pitch." LPRINT CHRS(27);"Wl"; LPRINT CHR$(15); LPRINT CHRS(27);"M"; LPRINT "This line is EXPANDED CONDENSED ELITE." LPRINT CHR$(27);"P"; LPRINT "This line is EXPANDED CONDENSED PICA." LPRINT CHR$(lS); LPRINT CHRS(27);"M"; LPRINT "This is EXPANDED ELITE." LPRINT CHRS(27);"P"; LPRINT "This is EXPANDED PICA.
49 Table 5-9 Proportional commands Function Control code Proportional ON Proportional OFF (ESC)“p”l (ESC)“p”O Try this program to see how the proportional 10 20 30 40 SO ’ Demo LPRINT LPRINT LPRI NT LPRINT of proportional printing CHR$(27) ; “~1”; “This line is PROPORTIONALprinting.” CHR$(27) ; “~0” ; “This line is NORMALPICA print.ing.” When you run this program This This spacing works. you should get this: line is PROPORTIONAL printing. line is NORMAL PICA printing.
50 Here, the value of n defines the print style to be selected. The value of n can range from 0 to 255, which is the range of values that can be stored in one eight-bit byte. If you look at each bit in this byte, you’ll find that each one represents a printing style variation. Adding the binary values of the selected bits gives the value of n for a particular combination of print styles. Table 5-10 shows the decimal values of the bits in the Master Print byte.
51 For example, suppose you turn on both Proportional and Condensed modes. Since these cannot combine the printer must make a choice; in this case, the printer chooses Proportional. Summary notes 1) Pica is the default pitch and is active when Elite is turned off. 2) When two modes conflict, the one of lesser priority is cancelled. For example, Proportional and Condensed can not be printed at the same time, printing is Proportional. 3) Underline, and Expanded modes combine with any print modes.
- MEMO
- CHAPTER 6 FORMATTING TEXT Subjects we’ll cover in Chapter 6 include* The carriage return and line feed; l The amount of space between lines; l Moving to the next page; l The number of lines on a printed page; l Horizontal and vertical tabs; l Setting marginsleft, right, and bottom. Chapter 5 showed us all the basic techniques of using the printer. Now we’re ready for the more advanced ones. We’ll concentrate on changing the appearance of the page to suit our needs.
54 print head to the left margin, ready to start a new line. Now to add a little confusion-most (but not all) versions of BASIC add a line feed (CHR$(lO)) to every carriage return (CHR$(13)) that they send. If your version of BASIC doesn’t do this, then you should turn DIP switch 2-6 off so that your printer will add the line feed for you. When you have DIP switch 2-6 off the printer will do the same thing when it receives a carriage return as it does when it receives a line feed.
THIS THIS THIS THIS THIS LINE LINE LINE LINE LINE SPACING SPACING SPACING SPACING SPACING IS IS IS IS IS SET SET SET SET SET TO TO TO TO TO 9 10 11 12 14 THIS LINE SPACING IS SET TO 15 THIS LINE SPACING IS SET TO 16 THIS LINE SPACING IS SET TO 17 THIS LINE SPACING IS SET TO 18 THIS LINE SPACING IS SET TO 19 THIS LINE SPACING IS SET TO 20 THIS LINE SPACING IS SET TO l/6 INCH. Line 40 defines and changes the line spacing.
56 When you are using your printer with the DIP switch 2-2 off, the (ESC)“A”CHR$( n ) works to change the line spacing without (ESC)“2”. So in this case, change the following lines as shown below: 40 LPRINT CHR$(27);"A";CHR$(I); 80 LPRINT CHR$(27);"2" The results are the same as previous one. You may wonder why they picked l/60 of an inch as the increment for the line spacing command. There’s a good reason: the dots that the printer makes are l/l80 inch apart.
Table 6-2 Line spacing commands Control code Function (ESC)“O” Set line spacing to l/8 inch (ESC)“l” Set line sDacinz to 7160 inch Setlinemacinn to l/6inchoruse0W”A” defiiitiod(ESC )“2” 1 Set or define line spacingto n/60 inch I (ESC)“ One-time line feed of n/180 inch (ESC)“J"CHR$(n) -reverse line feed of n/180 inch 1 ( ESC)“ n Moving down the page without a carriage return So far, all the commands that move the paper also move the print head to the left margin. And normally this is what you want.
58 The (ESC)“J”CHR$(lOO) in line 50 changes the spacing to 100/180 inches for one line only without moving the printhead. The rest of the lines printed with the normal line spacing. Notice that both line 30 and line 50 end with semicolons. This prevents the normal line feed from occurring. The (ESC)“j”CHR$(n) command works the same way except that the paper moves in the opposite direction.
59 ,____ iv------- -------0, 01 OI 1 LINE LINE I - NUMBER 1. NUMBER 2. -- ------ I - ---- I LINE ; LINE I 0 I OI ------_-__ NUMBER 3. NUMBER 4. I The form feed (CHR$(12)) in line 50 caused the printer to move to the top of a new page before printing the last two lines. n Changing the page length You may have some computer forms that you wish to use with this printer that are not 11 inches high. That’s no problem, because you can tell your printer how high the forms are that you are using.
This program should print “PAY TO THE ORDER OF:” twice, and they should be 7 inches apart. Line 20 sets the form length to 7 inches. After line 30 prints, line 40 sends a form feed advance the paper to the top of the next form. Line 50 then prints its message. After you have run this program, turn off the printer and adjust the top of form position. When you turn the printer back on the page length will reset to its normal setting (usually 11 inches).
50 FOR I=1 TO 150 60 LPRINT "THIS IS LINE";1 70 NEXT I 90 LPRINT CHR$(lZ); ' Form feed 100 END When you run this program it will print 150 lines right down the page and across the perforations. When it’s done line 90 sends a form feed to advance to the top of the next page. Look at the lines that have printed near the perforations. Separate the sheets and see if any of the lines have been torn in half. These are the problems that the bottom margin will solve. Now add the following lines to your program.
62 THIS IS LINE 2 THIS IS LINE 4 THIS IS LINE 6 0 0: 0 I THIS THIS THIS THIS I THIS 1 THIS ; THIS IS IS IS IS IS IS IS LINE LINE LINE LINE LINE LINE LINE 54 5.
SETTING LEFT AND RIGHT MARGINS The left and right margins of this\printer work just like a typewriter - once they are set all the printing is done between them.
64 on, or you can set margin values equal to the default values. This means that you should set a left margin of 0 and right margin of 136 in pica pitch. If you change the pitch of your printing after you set your margins, the margins will not change. They stay at the same place on the page. So if you set the margins to give you 65 columns of printing when you are using pica type, then you change to elite type you will have room for more than 65 columns of elite printing between the margins.
, . 65 15 LPRINT CHR$(27);“D”;CHR$(7);CHR$(l4);CHR$(21); CHRS(O); (ESC)“D” is the command to begin setting horizontal tabs. It must be followed by characters representing the positions that you want the tabs set. In our program we are setting tabs in columns 7, 14, and 21. The CHR$(O) at the end ends the string of tabs. In fact, any character that is not greater than the previous one will stop setting tabs.
66 Table 6-7 One-time horzontal tabs Function Control One-time horizontal tab of n spaces (ESC) “f” 0 CHR$(n) (ESC) “$” CHR$(nl) CHR$(nZ) (ESC) “\” CHR$(nl) CHR$(nZ: Absolute horizontal tab Relative horizontal tab cde The first command in Table 6-7 moves the print head n columns to the right. It has the same effect as sending n spaces to the printer. The absolute horizontal tab command moves the print head to a specified position on the page.
67 Table 6-8 Units of motion for the relative horizontal tab command Print style Unit of motion Draftcharacters LQ characters LQ proportional characters l/120-inch l/MO-inch l/360-inch Try thisprogram to see how this works.
68 set at line 20, a vertical tab (or ) will whether you start from line 5 or line 19. The vertical tab is not set at the power-on a CHR$(ll), which is the ASCII code for have set up tabs advance the paper one line. to see how this works. 10 40 50 60 70 ’ Demo LPRINT LPRINT LPRINT LPRINT move you to line 20 default. If you send < VT > , before we Enter this program of vertical tabs CHR$( 11) ;“FIRST TAB.” CHR$(ll);“SECOND TAB.” CHR$(11) ; “THIRD TAB. *’ CHR$(ll);“FOURTH TAB.
69 Add one more line to the program feature of vertical tabs. to demonstrate one more 80 LPRINT CHR$(ll):"FIFTH TAB." Now when you run the program the first page looks just like before, but line 80 sends one more than there are tabs. This doesn’t confuse your printer - it advances the paper to the next tab position which happens to be the first tab position on the next page. That’s nice, isn’t it? There’s a one-time vertical tab command that works just like the one-time horizontal tab command.
70 Vertical Function Table 6-9 tab commands Control code Advance paper tonext tabpositionCHR$(ll) (ESC)“B”CHR$(nl) Setvertical tabsatnl,n.2, etc. CHR$(nZ).....CHR$(O) Setvertical tabseveryn lines (ESC) “e”1 CHR$(n) One-time vertical tab (ESC) “f’1 CHR$(n) W Vertical tab channels Vertical tab channels are especially helpful in two situations. The first occurs when you are writing a program to accompany a preprinted form that can accommodate various types of responces.
71 120 130 140 150 160 LPRINT “2ND TAB OF CHANNEL’* ;I LPRINT CHR$(12); NEXT I LPRINT CHR$(27) ;“@” END When you run this program TOP OF 1ST TAB ZND TAB FORM OF OF CHANNEL CHANNEL TOP OF 1ST TAB you should get like this. FORH TOP OF FORH 1ST TAB OF CHANNEL 3 ZND TAB OF CHANNEL 3 1 OF CHANNEL 2 1 2ND I TAB OF CHANNEL 2 I In this program we set tabs at 10 and 20 in channel 1 in line 20.
72 MEMO
CHAPTER 7 SPECIAL FEATURES THE PRINTER OF Subjects we’ll cover in Chapter 7 include* Printer’s bell; l Master reset; l Uni-directional printing; l International character sets; l Printing BIG characters; l The optional sheet feeder; l Reading a hex dump. In the previous chapters we have learned about several groups of control codes. In this chapter we will look at more control codes.
mind an operator to change the paper or to make another adjustment to the printer. You can try this by typing: LPRINT CHR$(7) n Resetting the printer Up to now when we wanted to reset the printer to the power on condition we have had to either turn the printer off and then on again, or to send the specific codes that reset the particular features. There is an easier way.
. 75 Table 7-1 Some miscellaneous commands Function Cotitrol code Soundbell CHRW) Masterreset (ESC) “@” --’ --lR$(19) IOffline I CH ICHI@x17) IOn line (ESC) “8” Paper-out detector off (ESC) “9” Paper-out detector on move mint head back one snace 1 CHI W8) . CHR$(127) Delete last character sent CHR$(24) Canceltextinprint buffer ’ .pSC)“i”1 I(E 1Immediate-mint on I(ESC) “i”f 1 1Immediate-mint off Addn dotspaces between characters 1(ESC) CHR$(32)CHR$(n) 1(ESC >“V” CHR$(n) CHR$(ml)...
76 I 90 LPRINT CHR$(24); 100 LPRINT "DOES NOT WORK" Here is what this program will print: BACKSPACE DOES NM DELETE DOES WORK DOES NOT WORK WORK The backspace codes in line 30 move the printhead a total of three spaces to the left so that the first part of line 40 will overprint the word “NOT”. The delete codes in line 60 “erase” the three letters in the word “NOT” so that it doesn’t even print. In line 90, CHR$(24) deletes the words in line 80.
77 riage return code.) To end this program and print the contents of the buffer, press RETURN alone. Now add this line: 10 LPRINT CHR$(27);"il"; And RUN the program. Your printer responds to your typing immediately. When you are finished, press RETURN alone. n Adjusting the width of space between characters This printer provides a command that adjusts the space between all the characters that it prints when the DIP switch 2-2 is set off.
78 This command can be used to produce micro-justification, which is a method of justifying lines by increasing the space between each character. n Repeat characters This printer has a command that automatically repeats characters for you. Try this program to see how it works. ' Demo LPRINT LPRINT LPRINT LPRINT 60 END 10 20 30 40 50 of character repeat CHR$(27);"V";CHR$(4); "This line shows Repeat characters." CHR$(27);"V";CHR$(O); "And this is not.
, L Try this program direction makes. to see the difference that printing in one printing 10 ’ Uni-directional 20 LPRINT CHR$(27);“A”;CHR$(6); 30 LPRINT CHR$(27) ;“2”; 40 FOR I=1 TO 10 50 LPRINT ” I ” 60 NEXT I 70 LPRINT :LPRINT 80 LPRINT CHR$(27) ;“Ul”; 90 FOR I=1 TO 10 100 LPRINT “I ” 110 NEXT I 120 LPRINT CHR$(12);CHR$(27);“@” Here is what you will get. The top line is printed bi-directionally, and the bottom is printed uni-directionally.
8n power on condition. You can also set the printer to print in one direction for one line only by using the (ESC) “(” command. This command immediately moves the printhead to the left margin and then prints the remainder of the line from left to right. H The seven bit dilemma Certain computers (but not the IBM-PC fortunately!) don’t have the capability to send eight bits on their parallel interface. They can only send seven bits.
10 LPRINTCHR$(27);"0"; 20 LPRINTCHR$(27);"6"; 30 FOR J=3 TO 6 40 LPRINT '* ";J;CHR$(J);CHR$(9); 50 NEXT J 60 LPRINT '* 21 ";CHR$(21) 70 LPRINT 80 FOR J=128 TO 254 STEP 5 90 FOR I=J TO J+4 95 IF I>254THEN 110 100 LPRINT I;CHR$(I);CHR$(9); 110 NEXT I 120 LPRINT :LPRINT 130 NEXT J Figure 7-l shows what this program will print.
82 3v 4+ 5+ 64 21 § 128 5; 129 ii 130 6 131 6 132 g 133 A 134 a 135 c 136 6 137 ti 138 & 139 i; 140 i 141 1 142 A 143 A 144 E 145 ae 146 E 147 6 148 ii 149 b 150 G 151 ii 152 y 153 ij 154 ii 155 c 156 f 157 v 158 pt 159 f 160 B 161 i 162 6 163 13 164 A 165 N 166 B 167 Q 168 i 169 c 170 7 171 + 172 + 173 i 174 175 >> 177 1 178 1 179 1 180 1 183 1 184 185 jl 188 3 189 J, a 1 176 III 181 j 190 d 186 I
83 If you have a 7-bit interface, add the following lines to the program given above: 15 LPRINTCHR$(27);">"; 95 LPRINTCHR$(27);"=" In this program line 10 selects character set #2 so that all the graphics characters can be used (including the “club” symbol). Then lines 20-80 print the 5 of clubs figure. Line 90 cancels character set #2 (which is the same as selecting character set #l).
84 The characters that change are shown beneath their ASCII code in Table 7-6. Table 7-6 International character sets - n Printing BIG characters You can even enlarge your character ing headings or special effects. There can use. Everything following any of shown below, until the cancel code is sets for attention-grabbare two commands you them will be enlarged as entered.
90 LPRINT “THIS IS “; 100 LPRINTCHR$(27);“h”;CHR$(2); 110 LPRINT “QUAD”; 120 LPRINTCHR$(27);“h”;CHR$(O) ; 130 LPRINT ” SIZED PRINTING.” 140 LPRINT CHR$(27);“-0” When you runthis program, you will getlike this: -DOUBLE THIS IS SIZED PRINTING. QUAD SIZED PRINTING . As youcansee, when thebigcharacter command isused, the baseline foreachcharacter doesnotalign.
86 THIS IS THIS IS DOUBLE SIZED QUAI) PRINTING. SIZED PRINTING . n g-pin graphics emulation mode As you had learned in Chapter 2, this printer has a unique 9pin graphics emulation mode. You can select this mode with a control code - (ESC)“g”. After you’ve entered into the g-pin graphics emulation mode, following commands work in the same manner for the g-pin printers, as shown below: (ESC)“A” n - Sets or defines line spacing to n/72 inch. (ESC)“3” n - Sets line spacing to n/216 inch.
87 When the automatic sheet feeder is installed, you must set the DIP switch 2-4 on to detect the paper-out condition. In addition, following functions are ignored when the automatic sheet feeder is installed: Setting of the page length Top and bottom margins Vertical tab settings The five-character commands automatic sheet feeder control codes sheet feeder is mounted on the printer On the other hand, the automatic sheet the printer, those five characters characters. Caution: . . (e.g.
Most BASICS, however, are not quite that straight forward. For example, the IBM-PC prints like the following. Notice that your printer is receiving decimal code 13 (hex OD) is coming with hex OA, which is really decimal 10. In addition, your printer does not receive decimal code 26 (hex 1A). Your printer prints hex numbers 16 per line, with printing the characters on the right side. If it receives less than 16, it sits in a holding pattern, awaiting more data.
CHAPTER 8 CREATING YOUR OWN CHARACTERS Subjects we’ll cover in Chapter 8 include* Designing your own characters; l Printing your own characters; l Print mode and the download characters. In the previous chapters of this manual you’ve learned how to control the printer to give dozens of different typefaces. By using various combinations of pitches, character weights, and font selections, you can create nearly any effect you want to in text.
- 90 Figure 8-1 shows an enlarged schematic view of the front of the printhead, showing the ends of the wires and their relationship to the draft characters. As you can see, the capital letters use the top eighteen wires of the printhead, and the descenders (such as the lower case “p” shown) use the bottom eighteen pins. As the printhead moves across the page (in either direction - that’s what is meant by bi-directional printing) it prints one column of dots at a time.
91 But there is another area of memory in this printer reserved for user-defined characters. These are characters that you can design and download into the printer. When download characters are defined they are stored in RAM(random access memory), which allows you to define or modify them at any time. Each of these draft characters, whether it is from the standard ROM or in download RAM, is constructed on a grid which is five “boxes” by twenty-four “boxes” high.
92 the same way. Make up some grids (photocopy Figure 8-3 if you wish) and get ready to be creative! (Just in case you are not feeling creative, and to make our explanations a little clearer, we’ll be using a picture of an automobile as an example of a draft download character. You can see how we’ve laid it out in Figure 8-4. Later in this chapter we’ll use this character to create a small graph.
123458789 128 64 32 18 1st 8 byte 4 2 1 I 2nd Left space: 18 We Right apace: 8 128 1st: 84 2nd: 3rd: 32 3rd byte ASCII Data code: 128 32 84 4 2 1 4th: 18 8 I 5th: 8th: 4 7th: 2 8th: 1 1 Figure 8-4. 9th: We’vedesigned anautomobile character. WRONG! 128 84 1st 32 1 18 a byte 4 2 1 1 Dtia ASCII code: 128 32 84 4 2 1 Left space: 18 2nd Right space: 8 Me 1st: 128 2nd: 84 3rd: 32 3rd byte 4th: 18 1 5th: 8 8th: 7th: 8th: 9th: .. A- 1.igure8-s. -. .
94 dots, the printhead would have to slow down and back up to print both dots-not very efficient! To avoid this inefficiency, this printer will not allow you to define a character like Figure 8-5. (Actually, you can define it, but when it prints, your printer will leave out the overlapping dots, so that it would print like Figure 8-4.) n Rule 2: Each row is divided into three bytes Now it’s time to give our creative side a break and get down to some basic arithmetic.
95 which we’ll get to shortly. 123456769 126 d3zEl 64 32 16 1st 6 byte 4 2 1 126 64 32 2nd 16 bvte 6 ASCII code: Left *pace: 66 I Right space: 2 4 2 1 r 126 64 32 3rd byte 16 6 4 2 1 Figure 8-7. Add thevalues ofthedotsineachcolumn andwrite thesum ofeachcolumnatthebottom. n Assigning a valueofcharacter space Besides being able to specify the actual width of the character, this printer allows you to specify the position in the standard grid where the character will print.
., 96 create proportional width characters that print at draft speed. When defining draft characters, the number of printed columns (ml) cannot exceed 9, and the sum of m0 + ml + m2 can not exceed 12. n Assigning a value to your character We’ve done a pretty through job of designing and describing a user-defined character. But this printer has room for 128 download characters - how does it knows which standard character we want to print: every character is assigned a unique number.
for user-defined characters, but a caution is in order. Characters with ASCII values below 32 are usually reserved as control codes by both your computer and your printer. While these characters can be replaced by user-defined characters, it should be avoided because of the effect on the normal control codes. In our example, we’ll assign the car a value of 60, which is the code for the character “(” in the ASCII characters.
! 98 You’ll probably recognize dl d2 .. . . dx from the top of our layout grid. That’s right, each column is described by three bytes. Now we’ve got everything we need to download one character to the printer.
99 When you run this program, it looks like nothing happens. That’s OK. We’ll see why in just a moment. Save this program. We’ll need it again shortly. PRINTING DOWNLOAD CHARACTERS You’ve now defined and sent two characters to your printer. But how do you know that? If you try printing those characters now you don’t get a car and telephone. Instead you get.. ( =. That’s because the download characters are stored in a different part of the printer’s memory.
50 LPRINT 60 FOR I=160 TO 254 70 LPRINT CHR$(I); 80 NEXT I 90 LPRINT 100 LPRINT CHR$(27) ;“;%O”;CHR$(O) 110 END Nope! Just two characters in the download set. This is inconvenient for a couple of reasons. First, every time you wanted to use a download character you would have to switch back and forth between character sets. Knowing that you wouldn’t want to do that, your printer won’t even allow it.
I To demonstrate how to use these characters, let’s use this character set to print a small graph.
‘..
103 Note that we didn’t hnvc to re-enter the download characters, since they were already sent to the printer with the first program. They will stay with the printer until you download new characters to replace them or turn the printer off. Even the (ESC) “@” command, which initializes the printer, does not destroy the contents of download RAM. n How to print the characters in control code area As explained earlier, you can define characters with ASCII values below 32.
104 THE PRINT MODE AND THE DOWNLOAD CHARACTERS In the example program above, before we defined the new characters, we selected the Draft print mode. By doing this, we caused user-defined characters to print as draft characters because user-defined characters assume the mode that is in effect at the time they are defined. The modes that affect user-defined characters are draft, and letter quality printing. (The (ESC) “x” n command selects between draft (n = 0) and letter quality (n= l).
105 together horizontally than draft style dot columns (the horizontal dot spacing is l/MO-inch when printing LQ characters - as opposed to l/120-inch for draft characters). Unlike draft characters, there are no restrictions on which dots can print. This, coupled with the closer dot spacing, allows you to design characters with higher resolution. The drawback is speed. Normal letter quality characters print more slowly than draft characters; the same is true of LQ download characters.
. 106 MEMO . .: ,,.. “. .,.. -. .1.. (r .,.