Page 1
NX-10 USER’S MANUAL NOT INTENDED FOR SALE PN 80820128...
Page 2
All efforts have been made to ensure the accuracy of the contents of this manual at the time of going to press. However, should any errors be detected, STAR would be greatly appreciate being informed of them. l The above notwithstanding, this manual. Topyright 1986 Star Micronics Co., Ltd. Communications Commission Interference Statement energy and if not installed Lvith the manufacturer’s...
Page 3
Table of Contents Setting Up Your Printer Chapter Where shall we put it? What have we here? Removing the printer cover Removing the packing tube Installing the ribbon cartridge Getting to Know Your Printer Chapter Controls and parts of the printer Parts of the printer Controls and indicators Extra functions...
Page 4
Chapter Basic Printing Some basics of BASIC A new language! First steps ASCII codes and the CHR$ function Control codes The escape codes A note on command Some special kinds of text Near Letter Quality characters Italic printing Underlining Superscripts Changing the print pitch Expanded Condensed...
Special Features of the Printer Chapter Now hear this Resetting Putting your printer to sleep Printing the bottom of the sheet Backspace, Printing zeroes Immediate-print Adjusting characters Uni-directional The seven bit dilemma Block graphics characters symbols International Printing Printing The optional sheet feeder The macro control code Reading a hex dump Chapter...
Page 6
Chapter Dot Graphics Comparing characters Using the dot graphics commands Specifying Specifying Combining Printing a design or logo Plotting with your printer How the program works High resolution Compatibility More graphics programming Redefining g-pin graphics mode Chapter Caring for Your Printer Cleaning the printer Replacing the ribbon Replacing the print head...
Appendix D Function Codes Commands Font style controls Font pitch controls Special print modes Controlling Line feed and reverse line feed Form feed and related commands Top/bottom Controlling Download character Dot graphics commands Macro instruction Other commands Appendix E Command Summary in Numeric Order Appendix F Technical Specifications...
SETTING UP YOUR Subjects we’ll cover in Chapter 1 include- . Choosing a suitable place for your printer; Unpacking your new printer; Setting it up. WHERE SHALL WE PUT IT? Before you do anything you’ll be using your printer. near your computer. longer, healthier lives if they like their surroundings.
WHAT HAVE WE HERE? Now let’s take a look at what’s in the carton. Open it up and check each item in the box against Figure l-l. There should be four items. ‘igure l- 1. to make sure you have all four items: 1) printer, Check paper guide, ribbon cartridge, and...
Page 10
Removing the printer cover is easy. Lift up the back of the cover to disengage the rest of the way. To replace it, just slide the tabs in at the front and lower it into place. Figure 1-2 shows the proper posi- tion and movement .gure 1-2.
Page 11
Figure 1-3. Remove the protective Up to this point, we’ve been clearing the decks for action, so to speak. Only one more thing left to do before we can start printing - install the ribbon cartridge. Installing the ribbon cartridge This printer uses a neat, easy-to-change you don’t have to spend a lot of time threading a ribbon.
Page 12
Warning: The print head gets hot during operation, let it cool off before you touch it. Figure 1-4. Press the cartridge into place until the holdmg springs snap into place. 3. Using the guide holders as a fulcrum with the ribbon fac- ing away from you, as shown in Figure 1-4, lightly press the cartridge down until the two holder springs snap shut to hold the cartridge...
Page 13
Print head Figure 1-5. 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.
CHAPTER GETTING TO KNOW YOUR PRINTER Subjects we’ll cover in Chapter 2 include - Parts of the printer - to use them; Paper selection and loading; Adjustment; Connecting your printer to the computer; Extra functions with the control panel. CONTROLS AND PARTS OF THE PRINTER H Parts of the printer First, we’ll go over the parts of the printer.
Page 15
Tractor feed unit ’ I nterf ’ Power switch Power cord Figure 2- 1. Front and rear views of the printer TRACTOR FEED UNIT - The drive gear and sprockets the tractor feed unit move sprocket-feed paper through printer.
Page 16
PLATEN - This is the rubber cylinder that carries paper to the print head. INTERFACE CONNECTOR - On the back of the printer, this connector is used to connect your computer Controls and indicators Now let’s take a tour around the controls, starting with the control panel on the right.
n Extra functions There are eleven specified on the control panel. You can use six of them by press- ing a key (or keys) when you turnon the power; five others are activated by pressing two control keys at once. For details, please refer to the end of this chapter.
Page 18
you’ll be using often. This lever controls the pressure paper against the platen. It has four settings: g - The top setting is used when you want to load paper in the printer. c - The second setting is for normal single sheets. fi - The third is for sprocket-feed - The bott om one is used when you want to release the paper completely...
Page 19
OK? Let’s start. 1. Move the sprockets on the tractor feed unit all the way to the ends. 2. Slide the sheet guide all the way to the right. 3. With the ribs of the paper guide toward you and the sliding adjuster at the bottom left, insert the guide into the slot at the back of the printer cover.
Page 20
. . . Figure 2-5. l’rop up the paper guide by inserting me guise stana in the notches provided for it. ‘igure 2-6. You can insert a sheet of paper by using the release lever.
Page 21
9. Now set the release lever to the auto-feed position. automatically. 10. 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 Straighten the paper and adjust it for the margins you want.
Page 22
5. Flip the clamp levers backward. sprocket units to move freely right and left so you can align them with the holes in the paper. 6. Feed the end of the paper into the slot next to the platen cover plate. 7.
ADJUSTING THE PRINT HEAD The distance between the print head and the platen must-be adjusted to accommodate make this adjustment, under the printer cover and immediately lever (Figure 2-9). Pulling the adjustment widen the gap; pushing it away from you will narrow the gap. Figure 2-9.
Page 24
1. Make sure both your computer off. 2. Connect one end of the interface cable to the connector socket at the right rear of the printer as shown in Figure 2-10. 3. Connect the other end of the cable to your computer described in the computer Figure 2-10.
Page 25
n Self-tests Your printer has two built-in programs lines of letters, numbers, that everything’s in good working order. Self-test 1 is the long version, and self-test 2 is the short one. You can use either one to show the characters stallation of the ribbon and paper, and to check the adjustment of the head-to-platen Best of all, you don’t have to wait another minute-you...
Page 26
n Hex dump Can you guess what a “hex dump” is? No, it’s not where witches throw away useless spells. A hex dump is an advanced ability of your printer that you can use, in certain cases, to find a problem with your system.
Page 27
1. Plug in the printer (don’t turn it on yet). 2. While holding both the Mode and Bold keys, turn on the power switch. **: Hold down Figure 2-13. You can set many the control panel keys while in the Off Line mode. n Setting print start position When you want to align the print start position, you can set it by the micro-feed...
Page 28
Mode key - Left margin set Paper Feed key - Right margin set 3. While holding the two keys, the print head moves across the page step-by-step. 4. When the print head goes to the position where you want to set margin, release acknowledges the margin with the sound of beep.
BASIC PRINTING Subjects we’ll cover in Chapter 3 include- * Listing BASIC programs on the printer; How a program prints things; Control codes, escape codes, and command syn- tax; Near letter quality (NLQ) characters; Fixed and proportional character spacing; Special printing - Printing in italics, Underlining, Superscripts and subscripts,...
Page 31
language, perhaps recalling Others are unnerved Well don’t be! In the first place, BASIC may well be the easiest language vocabulary, a simple but precise grammar, unlike those of English - usually different from each other only in minor detail. Without programming, collection of chips and wire - why should we think of it as something...
Page 32
output to the screen. Other computers, notably the Commodore to open the printer as a numbered that device. For example, you might type the following to print “Hello!” or to list a program OPEN4,4 OPEN4,4 CMD4 CMD4 PRINT "Hello! 'I LIST CLOSE 4 CLOSE4...
Page 33
would enter LPRINT sound, we would LPRINT character by entering printer. We can also use hex ASCII codes. Although decimal ASCII codes in this manual, you should understand least what a hex code is. “Hex” is short for hexadecimal refers to a base-16 number (the numbers we use in everyday life are base 10).
Page 34
line feed -the -its UJ’) -its ASCII 10 ASCII &HOA -its -the CHR$(lO) CTRL- J -the Of course, most of the time we don’t need to bother with these. Our computers press the “A” key we want to print the letter “A” - they take care of all the intermediate Appendix B is a table that shows the various names for each...
Page 35
This command that turns on expanded printing. (ESC), as we mentioned earlier, is the escape code (which is ASCII code 27). A letter or number in quotes (such as the “W” above) means that the character should be sent to the printer (without the quotes). In our example, you should send a capital W following escape code.
But for the final printout, how. of NLQ character 1 Demo 20 LPRINT CHR$(27);"xl"; 30 LPRINT "This line shows NEAR LETTER QUALITY! 40 LPRINT CHR$(27);"xO"; "This line shows standard print." 50 LPRINT In this program, “~“1 command. printer back to draft printing with an (ESC) “~“0. When you run the program you should get this: This line...
Page 37
f Demo of italic and :; LPRINT CHR$(27)*"4"* LPRINT "This li;e ii LPRINT CHR$( LPRINT "This line is Here is what you should get: In this program, line 20 turns italic on with (ESC) “4”, and line 40 turns italic off with (ESC) “5”. W Underlining Not only can your printer print all styles of printing in both roman and italic, but it can underline...
Page 38
In this program underline “ -“l, and then off in line 40 with (ESC) “-“O. There’s a new little wrinkle in this program, end of the first three lines told BASIC that those lines were to be continued. Therefore, and line feed at the end of those lines. We just did this to il- lustrate that all these control codes can be used in the middle of a line.
Here line 30 turns on superscripts ed off in line 50 with (ESC) “T”. Then between printing text, subscripts are turned on in line 70 with (ESC) “S’l, and finally off in line 90. Again, everything semicolons. CHANGING THE PRINT PITCH In “printer talk,”...
Page 40
Line 20 turns on elite pitch with (ESC) “M”. Line 30 prints a line at 12 characters the printer to pica pitch and line 50 prints a line in pica pitch. W Expanded print Each of the print pitches can be enlarged to twice its normal width.
Page 41
Now the results look like this: When you turn on expanded on until you turn it off with (ESC) “W”0. Expanded print commands Expanded print commands n Condensed print Each of the print pitches also can be condensed width. This is called condensed how it works: 10 f Demo of condensed 20 LPRINT "Demonstration...
Page 42
Condensed print commands Function Condensed ON Condensed OFF By combining expanded two pitches, this printer available. Enter this program print and condensed of various print pitches ' Demo LPRINT CHR$(15); CHR$( LPRINT "This line is CONDENSED ELITE pitch." LPRINT CHR$(27);"P"; LPRINT "This line is CONDENSED PICA pitch."...
Page 43
This CONDENSED ELITE pitch, line is This CONDENSED PICA line is NORMRL This line l-l-1 :i, vii :I. :i n e :i, 5; 111 IX? Pi u I,,., P 1: c:: (4 fl:, i t c3 t-l n This line is EXPANDED This line l-h i .!si i?z...
Page 44
When you run this program you should get this: This line NORMAL ELITE This line F’ROF’ORTIONAL “r1.7j.:~ :/.j.I-\e j.!ii; r~~I::;(:)~::~(::)~~1-~Ol\lnj... T l-1 i 5; 1. :i. r1 e NC:) R PI Ci L.. F’ I: CA Line 20 selects the elite pitch and line 40 turns on the propor- tional printing with (ESC)“p”l.
Try them now with this little program: f boldface 2': ~PEE EHR$(~~) ;"G"; "This iine is BOLDFACE LPRINT LPRINT CHR$(27);"E"; LPRINT "This line is BOLDFACE EMPHASIZED." LPRINT CHR$(27);"H"; "This line is EMPHASIZED LPRINT 80 LPRINT CHR$(~~);"F"; 90 LPRINT "This line is normal printing." 100 END Run this program.
more efficiently. You have at your disposal a unique command choose any valid combination the Master Print mode command. (ESC) “!” n 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.
Page 47
To better understand that each mode except pica (pica is the default) has a separate switch that can turned on and off via software. Once the switch is on, it stays on until turned off. When two modes that conflict are turned on at the same time, the printer must choose which one to use.
CHAPTER FORMATTING TEXT Subjects we’ll cover in Chapter 4 include- * The carriage return and line feed; The amount of space between lines; Moving to the next page; The number of lines on a printed page; Horizontal and vertical tabs; Setting margins- left, right, top and bottom;...
Page 49
Line feed is more complicated. a CHR$(lO) it both advances the paper one line and returns the print head to the left margin, ready to start a new line. Now to add a little confusion-most BASIC add a line feed (CHR$(lO)) to every carriage (CHR$(13)) that they send.
Page 50
( Demo of line spacing FOR I=1 TO 25 IF 1=13 THEN 60 LPRINT CHR$(27);"A";CHR$(I); LPRINT "THIS LINE SPACING NEXT I LPRINT "LINE SPACING (NORMAL) .I! 80 LPRINT CHR$(27);"2" 90 END This is what you will get: ‘f .J!! ,’ : ..,.
Page 51
Line 40 changes the line spacing. The command CHR$(n) changes the line spacing to n/72 of an inch. The loop that is started in line 20 increases the value of n (the variable I in this program) each time it is executed. creases as the program loop when I= 13, since BASIC won’t let us send CHR$(13) without adding an unwanted...
Page 52
The program works just the same as before, but the line spac- ing are just one-third what they were. This is because (ESC CHR$(n) sets the line spacing to n/216 inch. Table 4-2 shows all the line spacing several “shortcut” commands Line spacing n Moving down the page without a carriage return...
Page 53
10 ' Demo of' one-time line feeds 20 LPRINT "LINE NUMBER 1." ;; LPRINT "LINE NUMBER ' One-time line feed 50 LPRINT CHR$(27>;"J";CHR$(loO); 60 LPRINT "LINE NUMBER 3." 70 LPRINT "LINE NUMBER 80 END Here is what your printer will produce: i-:1: IW I\Il.JMEE:FI I.
PAGE CONTROL Now that we have seen how to control line spacing, we can go on to page control - positioning the printing on the page and ad- justing the paper length. n Form feed The simplest forms control code is the form feed. Form feed (or <...
Page 55
ed, for example, to print text in a multi-column mat; print the first column, then reverse form feed back to.the top of the page to start the second column. The code for reverse form feed is easy to remember: 1 Function Advance paper to top of next Reverse paper to top of current page...
advance the paper to the top of the next form. Line 50 then prints its message. After you have run this program, just the top of form position. When you turn the printer back on the page length will reset to its normal setting (usually 11 in- ches).
Page 57
10 ' Demo of top and bottom margins 60 LPRINT CHR$(12); FOR I=1 TO LPRINT "THIS IS LINE";1 90 NEXT I 110 LPRINT CHR$(12) 120 END When you run this program it will print 150 lines right down the page and across the perforations. sends a form feed to advance to the top of the next page.
Page 58
THIS LINE THIS ILINE THIS LINE THIS ILINE THIS LINE THIS ILINE THIS LINE THIS LINE THIS LINE ; THIS LINE I THIS LINE LINE ’ rHIS LINE ; THIS , THIS LINE I THIS LINE ITHIS LINE THIS LINE THIS LINE THIS...
SETTING LEFT AND RIGHT MARGINS The left and right margins typewriter - once they are set all the printing is done between them. The commands to set the margins are given in the follow- ing table: Left and right margin commands Try setting the margins with this program: 10 ' Demo of margins GOSUB...
When you want to reset the margins to the default values, you have two choices. You can either turn the printer off and back 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 80 in pica pitch.
Page 61
LPRINT CHR$(27);"D";CHR$(7);CHR$(l4);CHR$(21); CHR$(O) (ESC)“D” is the command must be followed by characters you want the tabs set. In our program we are setting tabs in col- umns 7, 14, and 21. The CHR$(O) at the end ends the string of tabs.
Page 62
The aboslute horizontal tab command moves the print head to a specified position on the page. The position that you want the print head to move to (meaured specified by the values of formula nl + n2 256. Try this program to see how this works. 1 Demo of absolute 20 FOR I=60 TO 70 STEP 2 30 LPRINT I;'+++++';...
Page 63
80 LPRINT 90 END W Vertical tabs Vertical tabs have the same kinds of uses that horizontal tabs do - they just work in the other direction. Horizontal tabs allow you to reach a specific column on the page no matter where you start from.
Page 65
Add one more line to the program to demonstrate feature of vertical tabs. LPRINT CHR$(ll);"FIFTH TAB." Now when you run the program the first page looks just like before, but line 80 sends one more <VT> This doesn’t confuse your printer - it advances the paper to the tab position which happens to be the first tab position on next the next page.
Page 66
10 1 Demo of vertical 20 LPRINT CHR$(27>;"b';CHR$(l>;CHR$(lO);CHR$(2O); CHR$(O) ; 30 CLHPRHl~oT)CHR$(27);"b";CHR$(2);CHR$(15);CHR$(25); 40 ~~~~~~)CHR$(27);"b";CHR$(3);CHR$(l7);CHR$(28); 65: FOR 1 Use I=1 vertical 70 LPRINT "TOP OF FORM" 80 LPRINT CHR$(27);"/";CHR$(I); 90 LPRINT CHR$(ll); 100 LPRINT "1ST TAB OF CHANNEL";1 110 LPRINT CHR$(ll); 120 LPRINT "2ND TAB OF CHANNEL";1 130 LPRINT CHR$(12);...
Page 67
In this program we set tabs at 10 and 20 in channel 1 in line 20. In line 30 we set tabs 15 and 25 in channel 2, and in line 40 we set tabs 17 and 28 in channel 3. Because the channels are stored, you must make the printer to recall one before you use it, so we used (ESC)“I”CHR$(nU) line 80.
Page 68
SPECIAL FEATURES THE PRINTER Subjects we’ll cover in Chapter 5 include- * Printer’s bell; Master reset; Uni-directional printing; International character sets; Printing BIG characters; The optional sheet feeder; Macro instruction; Reading a hex dump. In the previous groups of control codes. In this chapter we will look at more con- trol codes.
Page 69
sound the bell for a quarter of a second. This can be used to re- mind an operator to change the paper or to make another adjust- ment to the printer. You can try this by typing: LPRINT CHR$(7) 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...
Page 70
This will allow you to print to the end of the stop printer. sheet, and even beyond if you are not careful. The codes to con- trol the paper-out detector, have just learned are in the following table. Some miscellaneous Function Sound bell 1 Master reset...
Page 71
LPRINT "WORK" LPRINT "CANCEL LINE"; LPRINT CHR$( 90 LPRINT "DOES NOT WORK" Here is what this program will print: The backspace codes in line 20 move the printhead three spaces to the left so that the first part of line 30 will over- print the word “NOT”.
Page 72
You can turn immediate-print before looking at it, let’s review the normal operation print buffer. Enter this program. : INPUT " TYPE A CHARACTER 20 A$="" IF A$="" THEN 50 40 LPRINT A$; : GOT0 20 : LPRINT CHR$(27);"@" 50 LPRINT Now type several RETURN...
Page 73
line This This line This line This line This line added This line Normal This command can be used to produce which is a method of justifying tween each character. n Uni-derectional printing printing is a big word that means printing in Uni-directional one direction only.
Page 74
Here is what you will get. The top line is printed bi-directional- ly, and the bottom is printed uni-directionally. look hard because there isn’t much difference. Let’s analyze the program. 7/72 of an inch so that the characters that we print will touch top to bottom.
Page 75
Function Turn the eighth bit ON Turn the eighth bit OFF ~ec~~~~;t~ bit “as is” from ( ESC > ,,#,, n Block graphics characters Besides the upper and lower case letters and symbols that we are by now familiar with, your printer has a whole different set of characters that are for special uses.
Page 77
Figure 5-l shows what this program will print. If your chart doesn’t 1001 like this because it has regular letters and numbers instead of the special symbols, then your computer seven bits. You can get the correct printout 160 to this: 160 LPRINT I;CHR$(27);">";CHR$(I);CHR$(27);"=";...
Page 78
If you have a 7-bit interface, add the following lines to the pro- gram given above: 15 LPRINT CHR$(27);">"; 95 LPRINT CHR$(27);"=" In this program line 10 selects character set #2 so that all the graphics characters bol). Then lines 20-80 cancels character set #2 (which...
Page 79
International character set commands I Countrv The characters that change are shown beneath their ASCII code in Table 5-5. International character sets Country ~35~36~64~91~92~93~94~96~123~124~125~12 I#lsl@lcl\lll*l’lcl:l,l~ U.S.A IFrance l#l$lsl~l~lul^l’l~lal~lR Germany al~lrl~lil~l~l~l~l~l- England .I. G Demark type I #$@E~L-zi;;- #rl~At5AUBZ~Bi.i Sweden Italy n Printing characters When you refer the Appendix are printed in the control code area.
Page 80
command to “normalize” the high-order control codes is (ESC) “6”. Try this program with the DIP switch 1-6 on. 10 ’ Demo of characters area 20 LPRINT CHR$(27);"6"; FOR I=128 TO i59 40 LPRINT CHR$(I); NEXT I 60 LPRINT CHR$(27);"7" When you run this program you’ll get like this: That’s where the italic international stored.
Page 81
130 NEXT I 140 LPRINT CHR$(144);CHR$(145); 150 FOR I=149 TO 159 160 LPRINT CiSS(I); 170 NEXT I 180 LPRINT CH?.$(27);"10" 190 END When you run this program you should get like this: Control code area co lmmands Function Printable code area expansion Control code area expansion kkct undefined codes as characters (Cancel undefined codes as characters...
Page 83
When you run this program, n The optional sheet feeder The automatic sheet feeder is a handy option that feeds single cut sheets automatically. that done on computer “ears” off each sheet as you must with fan-fold paper. The automatic sheet feeder feeds a new sheet automatically every time the printer receives or generates time you wish, you can turn the auto-feed unit on and off by...
Page 84
which refers to an instruction mal instructions. In computer (which are similar to subroutines) time and effort. Your printer’s macro can save you a lot of time and effort also. Here is how the printer’s macro works. You define macro by telling the printer what normal control codes are to be included in the macro.
Page 85
tional pitch, condensed phasized, and the underlining. and the subscripts. line 60 sets the left-aligned macro definition. This printer will remember the power is turned off or until a new macro is defined. A macro can hold up to 16 bytes (characters) of information. we defined contains thirteen.
Page 86
If your system passes the codes directly to the printer without changing them, you will get like this. (You can print out the last remaining line in the print buffer by putting the printer off line with the On Line key.) a:,,:, 01 02 I:)? If.1...
Page 87
dumps the characters To debug a program quickly, just use the hex dump capabili- ty. Appendix B will help you translate equivalents. to the paper. the hex codes to ASCII...
CREATING YOUR OWN CHARACTERS Subjects we’ll cover in Chapter 6 include - Designing and printing your own characters; Designing proportional characters ; Designing your own characters with NLQ. In the previous chapters of this manual you’ve learned how to control the printer to give dozens of different typefaces. ing various combinations selections, you can create nearly any effect you want to in text.
see, the capital letters use the top seven wires of the printhead, and the descenders bottom seven pins. As the printhead either direction - that’s what is meant by bi-directional ing) it prints one column of dots at a time. Each time a dot is sup- posed to print an electromagnet wire to strike the ribbon (making this printer an im- appropriate...
character sets, and the NLQ characters. But there is another area of memory in this printer reserved for user-defzked characters. design download characters are defined they are stored in RAM (random access memory), which allows you to define or modify them at any time.
Page 91
download character. You can see how we’ve laid it out in Figure 6-5. Later in this chapter we’ll use this character small graph.) m,m,m,m.m,m,m,m,m,m,,m,, Total Tigure 6-4. Use this grid (or one similar to it) to define your owr draft characters. You’ll notice that Figure around the grid.
Page 92
One bit in the download character definition command is to be treated as a descender time. For now, if your character uses the top eight dots, write in a one next to the word “Descender” the bottom eight dots, write in a zero. In our example, want to the bottom of the flask to line up with the baseline of the other characters, so it will...
Page 93
m m, m, m, m. m. m m, m. m Tolal Figure 6-6. cots cannot overlap; “half columns” will be ignored when the character W Add up each column of dots to give our creative side a break and get down to it’s time some basic arithmetic.
Page 94
So add up the values of the dots in each column using this system. In Figure 6-8 we’ve shown our grid with the sums of the columns filled in across the bottom (see if these agree with your answers!). Across the top of the grid you’ve probably noticed the cryptic labeling of each column: ml, m2, m3, etc.
Page 95
also access the character from a BASIC program with the CHR$ function. There are no rules or restrictions means you can use whatever perhaps seldom-used characters. In our example, we’ll assign the flask a value of 60, which is the code for the character A rather arbitrary selection, but this printer doesn’t care! Our chart would hardly be complete chemist’s flask, so in Figure 6-9 we’ve made completed grids for...
Page 96
n Download character You’ve read through characters and we haven’t even told you the command yet! Now the wait is over. This is the most complex command in your printer repertoire knowledge to implement (ESC)“&“CHR$(O) nl n2 m0 ml m.2 m3 m4 m5 m6 m7 m8 m9 ml0 ml1 Like the other printer’s commands, (CHR$(27)).
Page 97
Descender Starting date print column Figure 6-10. The attribute You’ll probably recognize layout grid. That’s right, each column is described by one byte. Now we’ve got everything to the printer. The complete command for our flask character is shown below: CHR$(27);CHR$(38);CHR$(O);CHR$(GO);CHR$(6O);CHR$(l39) ;CHR$(2);CHR$(5);CHR$(8);CHR$(241);CHR$(O);CHR$(O) ;CHR$(241);CHR$@);CHR$(5);CHR$(2);CHR$(O)
Page 98
PRINTING DOWNLOAD You’ve now defined and sent three characters But how do you know that? If you try printing those characters now you don’t get a flask, car and gun. Instead you get . . ( = ). That’s because the download characters are stored in a different part of the printer’s character RAM instead of standard character...
Page 99
Nope! Just three characters in the download set. This is incon- venient for a couple use a download character forth between character to do that, your printer won’t even allow it. So we have made it an easy task to use mostly standard special characters thrown ASCII...
Page 100
70 NEXT M 80 NEXT N 90 LPRINT 100 DATA 139, 110 DATA 139,124, 120 DA% 139: 46: 160, 130 L%NT"~H~~~27;~"D"-cHR$(ll)CHR$(0) 140 LPRINT CHR$(27)f"h";CHR$(l);' U.S. EXPORTS" 150 LPRINT " 160 LPRINT cHR$(27>;"h";c~~$(o); 170 LPRINT CHR$(27);"~l";CHR$(O); 180 LPRINT "AUTOS";CHR$(9); 190 FOR I=.4 TO 9.3 STEP 200 LPRINT CHR$(61);...
Page 101
Note that we didn’t have to re-enter the download characters, since they were already sent to the printer with the first pro- gram. They will stay with the printer until you download new characters to replace them or turn the printer (ESC) “a”...
Page 102
character width is five dots (so you could not, for instance, specify a starting column of 6 and an ending column of 8, even though those are both within the acceptable advertantly give an incorrect width value, however, your printer is forgiving: it will automatically eleven dot columns.
Page 103
Because the NLQ characters tically and 11 dots horizontally, ferent grid than the one you used for draft characters. some grids (photocopy Figure 6-12 if you wish) and get ready to be creative! TOtd Figure 6-12. Use this grid (or one similar to it) to define your own NLQ characters.
Page 104
Figure 6- 13. Add the values of the dots in each box and line col- umn and write the sum of each column at the bottom. Now enter the following numbers for the NLQ flask character. own, change the DATA $osition.
Page 105
140 DATA 139, 46, 16, o, 48, 150 DATA 92, 32, When you want to print the defined character, you must select the NLQ mode first, then select the download characters. don’t select the NLQ mode, the download printed even you selected the download character To demonstrate how to use the NLQ download let’s use this character...
Page 106
240 LPRINT CHR$(61); NEXT I LPRINT 270 LPRINT "CHEMICALS";CHR$(g); 280 FOR I=.4 TO 290 LPRINT CHR$(60) NEXT I 310 LPRINT 320 LPRINT "GUNS";CHR$(g); 330 FOR I=.4 TO 1.4 STEP 340 LPRINT CHR$(62); NEXT I 360 LPRINT 370 LPRINT CHR$(g);"+--"; SCALE$=~--+--~~ 390 FOR I=2 TO 8 STEP 2 400 LPRINT SCALE$;...
DOT GRAPHICS Subjects we’ll cover in Chapter 7 include- . This printer’s bit image graphics capabilities; Printing a pre-defined shape; Plotting a calcurated shape; High-resolution graphics. In Chapter 6 you were introduced graphics; you were able to actually define characters In this chapter you’ll learn to use the same principles your printer print whole pages of dot graphics! We’ll show you how to use dot graphics to create “super download characters”.
Page 109
So when do you use graphics and when do you use download characters? Practically can do with download characters, grammer could actually download characters defined characters. But why do it the hard way? There several instances when dot graphics is clearly the best way to ap- proach the problem: l If the graphics image to be printed is wider than 11 dots or higher than 8 dots.
Page 110
largest number we can send in one byte (that’s what the BASIC CHR$( ) function sends: one byte) is 255. And with the normal density graphics it’s possible to have a graphics image as wide as 480 dots. So to figure out how many columns of graphics data to expect, your printer multiplies of nl to the product.
Page 111
Figure 7- 1. Starting with the most significant bit at the top, each pin of the print head is assigned a value which is a power of two. A short program should demonstrate graphics command. The program below gave us this printout: ___““““--...”...
Page 112
mathematical function (a sine wave) to create a design. Later in this chapter we’ll mathematical concepts (such as sine and pi) demonstrated are not important; you don’t have to be a math whiz to use this printer’s graphics. n Combining text and graphics It’s also possible to mix text and graphics in one line.
Page 113
PRINTING A DESIGN OR LOGO Since you control the firing of every pin, you can print nearly anything with your printer that can draw (and probably better, if you’re like most computer “computer art” or drawing maps. Or, as we’ll show you here, you can use dot graphics to print your logo at the top of each let- ter you print.
Page 114
In the program below, we’ve taken the logo graphics informa- tion and put it into BASIC DATA statements. itself is short and simple. The loop starting at line 100 reads the data statements into a string array variable called LOGO$. In line 170 we change the line spacing to 8/72 inch so that the lines of graphics data will connect vertically.
Page 115
' Row 2 DATA DATA DATA 31, 31, 15, DATA DATA 420 DATA DATA 24;;24;: DATA ' Row 3 DATA DATA 192,224,224,224,224,240,255,255,255,255 DATA 255,127, 490 DATA 255,255,193,128,128,128,128,lg2,224,24o 500 DATA 252,255,255,255,127, 63, 31, DATA 254,252,248,224,128, DATA DATA 540 DATA 192,224,224,224,224,240,255,255,255,255 yA;;,2;5,"7, z5-i 0,248,248,240,224,224,112,112, 56, 56 570 DATA...
Page 116
20 LINE.8$=CHR$(27)+CHR$(65)+CHR$(8)+CHR$(27)+ CHR$(5Oj 40 LINE.l2$=CHR$(27>+CHR$(65)+CHR$(l2)tCHR$(27)t CHEI$(50) PLOTTING WITH YOUR PRINTER This section of the manual gets into more serious BASIC pro- gramming just because it’s required in order to have the com- puter act as a plotter driver. Don’t be intimidated; beyond the scope of this manual to teach BASIC, if you try the examples and take it slowly you should be doing some fancy plot- ting of your own before you know it.
Page 117
LX=~O 90 LXFAC=72/LX 1 Plot curve GOSUB 1 Send bit image map to printer LPRINT CHR$(27);"A";CHR$(6); FOR ROW%=0 TO MAXROW% A$="" LPRINT CHR$(27) ;"*";CHR$(O);CHR$(MAXCOL%); CHR$(O) ; FOR COL%=l TO MAXCOL% A$=A$+CHR$(BIT%(COL%,ROW%)) NEXT COL% LPRINT A$;" It NEXT ROW% LPRINT CHR$(27>;"A";CHR$(l2); ) Subroutine X2,Y2 XL=X2-Xl...
Page 118
RANG=ANG%*6 X2=RAD"COS(iANG)tlO 680 GOSUB 250 NEXT ANG% 700 RETURN If you are using with the IBM mode (DIP switch 1-6 off), change the following lines to the program given above. 140 LPRINT CHR$(27>;"A";CHR$(6);CHR$(27);"2" 230 LPRINT CHR$(27);"A";CHR$(l2);CHR$(27);"2'+ n How the program works In the program above, we’ve created an array called BIT%, which is dimensioned...
Page 119
to calculate starting and ending points for a line (in our circle the “lines” are very short - points are the same). The coordinates line are assigned to variables Xl and Y 1. The line ends at point X2, Y2. When these subroutine call is made to line 250.
’ ) Subroutine x1=0 : Yl=lo GOSUB 250 x1=10 : Y~=O GOSUB 250 X1=0 : Yl=lO FOR X2=0 TO 20 STEP .2 Y2=lO-g"SIN(3.ltil59~X2/10) GOSUB 250 NEXT X2 RETURN HIGH RESOLUTION GRAPHICS Up until now all of the dot graphics printing we have done has been with your printer’s you some pretty sharp...
Page 121
Dot graphics commands Function Normal densitv (60 dots/inch) Double densit; (120 dotdinch~ \_-_ --_- ._.. -.., ,/double weed Doubledensity.---.--. 1 Quadrunle densitv (240 dots/inch)/ (ESC) ---- CRT graphics (86 dots/inch) Plotter graphics (72 dots/inch) CRT graphics type II (90 dots/inch) syntax for all of the commands The command just as you have learned it for the (ESC)“*“CHR$(O)
Page 122
Double density graphics Double density/double speed...
Page 125
So if quadruple density looks so great, why not use it all the time? Let’s try an experiment just how the different this chapter, change line 50 to try each of the different modes. Just change the “0” to “l”, “2”, “3”, etc. in turn. Your printouts should look something =----., .---;...
Page 126
puting time as double density, it prints at the same speed as nor- mal density graphics. Amazing, you say? Well, it is - until you know the secret. Every other column of dots is ignored, so the output is actually the same as normal density graphics. The ad- vantage is that you can write and debug your programs at dou- ble speed, then change to double density graphics for terrific out- put.
Page 127
graphics densities. These commands, 7-3, can be used interchangeably “*” command. Like the commands with, these new commands are followed by two bytes to specify the number of graphics data bytes to print and then the data. MORE GRAPHICS PROGRAMMING At the end of this chapter, we’ll discuss two modes that the printer offers to help you solve potential graphics problems.
Page 128
g-pin graphics mode In the early part of this chapter, we said that the bottom pin of the print head is not normally That’s because most computers peripheral devices using eight data lines. When the peripheral is a printer, each data line corresponds head.
Need help?
Do you have a question about the NX-10 and is the answer not in the manual?
Questions and answers