Star Micronics SG-10 User Manual
Star Micronics SG-10 User Manual

Star Micronics SG-10 User Manual

Star micronics printer user's manual
Table of Contents

Advertisement

SG -1 O/l 5
USER'S MANUAL
NOT INTENDED FOR SALE

Advertisement

Table of Contents
loading

Summary of Contents for Star Micronics SG-10

  • Page 1 SG -1 O/l 5 USER’S MANUAL NOT INTENDED FOR SALE...
  • Page 2 Trademark Acknowledgement SG15: SGlO, Star Mfg. Co., Ltd. grfstar: Star Micronics Apple, Apple II, Apple II + , Apple IIe, Applesoft: Commodore C-6& Commodore Business Machines, Inc. Compaq: Compaq Computer corporation CP/M: Digital Research EasyWriter: Information Unlimited Software, Inc.
  • Page 3 In this manual there are plenty of example programs to de- monstrate and show off all of SG-10/15’s features. SG- 10/l 5 users have IBM Personal Computers (or the equivalent) all the example programs the IBM. But throughout will find hints on how to make SG-lo/15 work with their com- puter.
  • Page 4: Table Of Contents

    Table of Contents Setting Up SG-lo/15 Chapter 1 Where Shall We Put It? What Have We Here? Removing the printer cover Removing packing and shipping screws Installing the platen knob Removing the tractor unit Attaching the paper separator and paper guide Installing the ink ribbon Getting to Know Your SG-lo/15 Chapter 2...
  • Page 5 Underlining Superscripts Changing the Print Pitch Expanded print Making SG-lo/15 Print Darker Mixing Modes Summary Line Spacing and Forms Control Chapter 6 Starting New Lines Changing Line Spacing Moving down the page without a carriage mturn Forms Controls Form feed Changing the Page Length Top and Bottom Margins Summary...
  • Page 6 Erasing Download Delining Proportional Connecting Summary Printing With Dot Graphics Chapter 10 Comparing Characters Using the Dot Graphics Commands Specifying the number of columns of dots Specifying the graphics data Combining Printing a Design or Logo Plotting With SG-lo/15 How the program works High Resolution If You Have Problems With BASIC Summary...
  • Page 7 The Parallel Interface Appendix H Functions Appendix I Serial Interface Specifications Configuring SC- lo/ 15’s Serial Protocols Serial busy protocols XON/XOFF ACK protocol Connecting With Computer Appendix J Connecting BASIC programming Listing programs Connecting Applesoft BASIC Listing programs Connecting TRS-80 BASIC Listing programs Connecting other CP/M computers...
  • Page 8 Table of Tables Table 5-l Near letter quality commands Table 5-2 Italic commands Table 5-3 Underline commands Table 5-4 Superscript Table 5-5 Print pitch commands Table 5-6 Expanded print commands Table 5-7 Print emphasis commands Table 5-8 Master select and the 256 ASCII codes Table 6-l Line feed commands Table 6-2 Line spacing commands Table 6-3 Form length commands...
  • Page 9 CHAPTER 1 SETTING UP SC-lo/l5 In this chapter, we’ll show you how to unpack SG-lo/15 printer, set it up in the right location, and get it ready for you to load it with paper and start printing. But first . . . WHERE SHALL WE PUT IT? Before you do anything else, give some thought to where you’ll...
  • Page 10 Figure Inside the carton you should have received: 1) SG-lo/15 l-l. printer, 2) paper separator, 3) paper guide, 4) platen knob, 5) spare fuse, 6) ink ribbon, and 7) this user’s manual. Let’s move on the next step . . . H Removing the printer cover What is cover for, really? Primarily, for two reasons: one, to keep dust and dirt away from the delicate “innards,”...
  • Page 11: Installing The Platen Knob

    Remove the printer cover by lifting carefully. Figure 1-2. n Removing packing and shipping screws There are two (on an SG- 10) or three (on an SG- 15) shipping screws on the bottom chassis securely to the external frame during shipping. To get at these, carefully place the printer upside down on a soft surface like a foam cushion.
  • Page 12 Shipping screw _-^-_^_ l-3. SC;-10 has two screws which secure the chassis during shipping; Figure SG-15 has three. They should rlgure l-4. Kemove the spiral SG-10/15’s print head. be removed before use. tube on the carriage stay that protects :.”...
  • Page 13: Removing The Tractor Unit

    the knob a few turns to see that it’s turning the platen easily and smoothly. n Removing the tractor unit The tractor unit, shown in Figure 1-5, comes mounted on the printer during shipment. It is used only with sprocket-feed paper. When other papers are used, such as single sheets, the unit should be removed, in the following manner: Remove the printer cover (if attached).
  • Page 14: Attaching The Paper Separator And Paper Guide

    and guide, which are designed expressly to guide continuous paper (sprocket-feed) through the printer. n Attaching the paper separator and paper guide First, identify the paper separator (the large metal rack), shown in Figure l-6. Insert one protruding the diagram, then gently bend the other protruding snaps into the opposite hole.
  • Page 15 several figures shown here; they’ll tell you all you really need to know. Nevertheless, if you feel better following written instructions, read on . . . After looking carefully at the Figure 1-7, begin by turning the power c$L and removing the printer cover. Then slide the print head gently to the center of the printer.
  • Page 16 The eyelet should Figure 1-8. changeover lever. Prin; head Figure l-9. You may want to use a ballpoint guide towards the platen and work the ribbon Finally, se’ the other spool snugly on the opposite spool holder; then turn tile spools by hand four or five turns in each direction to verify that everything is properly set and ready to roll.
  • Page 17: Getting To Know Your Sg

    Self-test - printout of available characters COMPONENTS First, the components. packed you printer. Now we’ll give you a brief explanation what they do. (For details on your initial set-up of SG-10/15, with all components in place, see Chapter 1.) PRINTER COVER - This function is to protect the ribbon and print head from dust and dirt, and also to reduce the sound level.
  • Page 18 Front and rear views of SG-10. Figure 2-l. TRACTOR - This unit feeds sprocket-feed gear and sprocket units. It is very easy to remove or to install the tractor unit onto the printer. PLATEN - This is the rubber cylinder that carries paper to the print head.
  • Page 19 Figure 2-2. Front and rear views of SG-15. INTERFACE CONNECTOR - Around on the back, this is the place where you connect your computer to SG- lo/ 15, so that they are able to communicate Now let’s take a tour around the controls, control panel board, located at the right front.
  • Page 20 READY PAPER ON LINE lo/ 15’s controls. Figure 2-3. SG- ON LINE BUTTON- Lets you change the printer status between “off line,” and “on line”. When it’s on line, the printer can receive data from the computer. signal to the computer When you turn the power switch on, you are automatically line.
  • Page 21 See the appendix for a complete explanation. PAPER SELECTION That’s it for components look at is the variety of papers available for SG-10/15, and how to load them, ready to print. single sheets - whether multi-part...
  • Page 22: Loading Single Sheets

    The paper release lever has two settings: “F” for friction feed Figure 24. and “T” for tractor feed. H Loading single sheets Paper width must always be between 8 and 10 inches (8 and 15 inches for the SG-15), and paper thickness between .07 mm and .lO mm.
  • Page 23: Loading Sprocket-Feed Paper

    6. Press the ON LINE button until the ON LINE light goes off. 7. Press the L.F. button to roll the paper in until it appears on the front side of the platen, about where you want the first line to start printing. NOTE: To straighten paper (if it’s in crooked): Move the release lever to “T”...
  • Page 24 To use this kind of paper, you’ll need to install the tractor unit, with its two “sprocket” wheels to carry the paper along. To install the tractor, identify the two “snap levers” shown in Figure 2-6. At the same time, identify nickel-plated bars over which the hoooked edge of the tractor frame fits.
  • Page 25 Open the tractor covers to expose the sprocket teeth. Figure 2-7. 4. Place the stack of fan-fold paper behind the printer. 5. Open the tractor covers, atop the right and left sprocket units, as shown in Figure 2-7. 6. Flip the clamp sprocket units to move freely right and left, so you can align them with the holes in the paper.
  • Page 26: Bottom Feeding Sg

    W Bottom feeding SG-15 The SG- 15 can be loaded with sprocket paper in two different ways-either from the back, as with SG-10,or through a slot in the bottom. To load SG- 15 from the back, follow the steps shown in the previous section.
  • Page 27 13. Now we’re ready to roll - replace the printer cover, and turn on the power switch. Speedy printing! can be loaded Figure 2-9. SG-15 bottom, as shown here. levers forward. This allows the two position is reached. This position perforation like from the back SG-10 or from the with...
  • Page 28: Adjusting The Gap

    ADJUSTING THE GAP The gap is the space between the print head and the platen. Adjusting the gap is simply adjusting the printer to accommodate different thicknesses of paper. To make this adjustment, under the printer cover, immediately shown in Figure 2-10. Pulling the adjustment will widen the gap;...
  • Page 29 “warm-up” that permits you to check your installation and paper, and the adjustment Best of all, you don’t have to wait another minute - you can print the self-test without computer! It’s as simple as 1, 2, 3... 1. Plug the printer’s power cord into an electrical outlet. 2.
  • Page 31: Getting Started With Sg

    GETTING STARTED WITH SG-lo/15 You have assembled and tested your printer, and seen a quick sample of SG-10/15’s capabilities in the self-test. Now it’s time to do what you bought SG-IO/15 to do: print information your computer. But first you need to connect Figure 3-l shows where the cables connect, but there’s more that...
  • Page 32 Some printer lists are not very clear, and* may not include anything that you think describes SG-10/15, If you can’t decide which description best fits SG- lo/15 we recommend narrow the list to two or three choices (you can quickly eliminate all the daisywheel printer types) and then experiment.
  • Page 33 ). There are ASCII codes for all the letters of the alphabet, both lower case and capital, the numbers punctuation marks, and some (but not all) of SG-10/15’s func- tions. ASCII codes are referred to in several different ways, depending on the way they are used.
  • Page 34: Using Sg-Lo/15 With Supercalc

    “send setup codes to printer”. of its name programs Perhaps the most often used command provides output to the SG-10’s print 80 characters per line type. This is how we tell SG- IO/l 5 with that is S(etup). SG-15 can...
  • Page 35: Using Sg-Io/15 With Word Processors

    SuperCalc because SG- lo/ 15 will stay in compressed print until it’s turned off or reset. You might also wish to use some of SG-10/15’s other features with SuperCalc. Find the code for the feature you wish to use in Appendix D and use the same procedure given here.
  • Page 36: Using This Book Without Learning Basic

    When you want to end the italic, you need to enter Escape 5. Use the same procedure: enter control-O, You can use many of SG-10/15’s features this way. Find the codes that you need in Appendix D, and then if necessary, use...
  • Page 37: Controlling Sg10/15 With Basic

    But remember that it’s not the only way to com- municate with SG-10/15, as we have already seen. Subjects covered in this chapter include: Listing BASIC programs on the printer...
  • Page 38 ways, and hope that between this and your computer’s manual you will be able to stay with us. First on our list is Microsoft BASIC’s way of communicating with the printer. They just add an “L” to the beginning of the LIST and PRINT commands, making them LLIST and LPRINT.
  • Page 39: Establishing Communications

    LLIST it (or however your computer does it). We’ve crossed the first major hurdle-learning Now we are ready to jump into the world of programming SG-10/15. But first, there are a few fundamentals to cover. W Establishing communications We’ve learned something printer.
  • Page 40: Control Codes

    Let’s try an easy one right now: 10 LPRINT CHR$(7) Where did that noise come from? That’s SG-10/15’s bell. We will learn more about it in Chapter 8. We just wanted to illustrate a code that causes SG-lo/15 to perform a function.
  • Page 41 10 is changed like this: 10 LPRINT CHR$(27) "E"; That’s just another form of the same ASCII code, and it’s all the same to SG-10/15. Here’s < ESC > is used so often, assign it to a variable. In a long program, typing ESC$ is much easier than typing CHR$(27) each ”...
  • Page 42 This is the command we mentioned earlier, is the way we will indicate the escape code, which is ASCII code 27. A letter or number enclosed in quote marks (such as the “W” above) means that character should be sent to the printer (without the quote marks).
  • Page 43 IBM mode and STAR mode. That’s it for the basics. You are ready to learn how to use the many features of SG-10/15. if you wish. and vertical for- You’ll find that many...
  • Page 45: Printing Text With Sg

    All our examples will be given in Microsoft by the IBM Personal Computer, need to know BASIC to use SG-10/I 5’s features. Just use the same ASCII codes as we do in our examples. You have already printed a few lines on your SG- 1 O/ 15 printer.
  • Page 46: Italic Printing

    10 'Demo near letter quality character set. 20 LPRINT CHR$(27) "B" CHR$(4) 34) LPRINT "This line shows NEAR LETTER QUALITY!" 40 LPRINT CHRS(27) "B" CHR$(5) 50 LPRINT "This line shows standard print." In this program, line 20 selects NLQ characters <...
  • Page 47: Table 5-3 Underline Commands

    l@ 'Demo italic and roman. 20 LPRINT CHR$(27) "4" 39) LPRINT "This line is in ITALIC characters." 4@ LPRINT CHR$(27) "5" 50 LPRINT "This line is in ROMAN (normal) characters." Here is what you should get: This program is easy; line 20 turns italic on with < ESC > “4”, and line 40 turns it off with <...
  • Page 48: Table 5-4 Superscript And Subscript Commands

    ued.Therefore, BASIC didn’t send a carriage return and line feed at the end of those lines. We just did this to illustrate that all these control codes can be used in the middle of a line. It’s easy italicize to underline or n Superscripts and subscripts SG-lo/15 can print in two different heights of characters.
  • Page 49 “S” CHR$( l), and finally off in line 90. Again, everything prints on one line because of the semicolons. CHANGING In “printer talk,” character width is called pitch. SG-lo/15 prints 10 characters per inch. This is called pica pitch because it’s the same spacing as a standard pica typewriter. SG- lo/ 15 can also print 12 characters per inch.
  • Page 50 You can not set elite pitch with a single code. n Expanded print Each of SG-10/15’s four print pitches can be enlarged to twice its normal width. This is called expanded print.Try this program to see how it works: 19 'Demo expanded mode.
  • Page 51: Table 5-6 Expanded Print Commands

    Expanded print set with CHR$(14) is automatically at the end of the line. This is convenient in many applications, such as for one line titles. < ESC > in front of the CHR$( 14), although works just the same. You can also cancel one line expanded print before a carriage return with CHR$(20), as done in line 50.
  • Page 52 By combining expanded print with the four pitches, SG-lo/15 has eight different character widths available. Enter this program to see how the print pitches and expanded print can be combined: 18 'Demo pitches in combination with expanded mode. 241 LPRINT CHR$(27) "W" CHR$(l) ; 'Permanent expanded mode on.
  • Page 53: Table 5-7 Print Emphasis Commands

    the characters twice, but they use slightly different methods to darken the characters. The following table shows the control codes for getting into and out of double-strike Print emphasis commands Function Double-strike ON Double-strike OFF Emphasized ON Emphasized OFF Try them now with this little program: 10 'Demo double-strike 20 LPRINT CHR$(27) "G"...
  • Page 54 80 turns emphasized off, so that SG-lo/15 printing. Look closely at the different lines of printing. double-strike printing each character has been printed twice, and they are moved down just slightly the second time they are printed. In emphasized printing, they are moved slightly to the right the second time SG- lo/ 15 prints.
  • Page 55: Table 5-8 Master Select And The 256 Ascii Codes

    Master Select and the 256 ASCII Codes Pitch Normal 2, 6% Pica 66, 128, 130, 192, 194 Elite 5, Elite takes 11, precedence 65, over 71, Emphasized. 79, 129, 131, 133, 135, 137, 139, 141, 143, 193, 195, 197, 199, 201, 203, 205, 207 Condensed 68, Emphasized...
  • Page 56 SUMMARY Control code < ESC > “B” CHR$(4) < ESC > “B” CHR$(S) < ESC > “4” < ESC > “5” < ESC > “4” < ESC > “5” < ESC > “I” 1 < ESC > “I” 0 <ESC> “-”...
  • Page 57: Line Spacing And Forms Control

    LINE SPACING AND FORMS CONTROL We have learned how to print in many different ways, but so far we haven’t looked at how to position the printing on the page. In this chapter we will learn how to: Change the vertical spacing Change the length of the page Set top and bottom margins STARTING...
  • Page 58: Changing Line Spacing

    will add the line feed for you. When you have DIP switch 2-3 off the printer will do the same thing when it receives a carriage return as it does when it receives a line feed. If you find that your printer double spaces when it should single space, then you probably need to turn DIP switch 2-3 on.
  • Page 59 This is what you will get: line +aciniJ This spacing This line This line spacing spacing This 1 ine spacing This 1inEt spacing Thic line This line spacing This line spacing spat i ng This 1 ine E.pacing This. line This line spacing...
  • Page 60 You may wonder why they picked l/72 of an inch as the in- crement for the line spacing command. the dots that the printer makes are l/72 inch apart. So this means that you can vary the line spacing in increments dot-unless you want finer spacing, like one half dot spacing (STAR mode) or one third dot spacing (IBM mode).
  • Page 61: Moving Down The Page Without A Carriage Mturn

    The program works just the same as before, but the line spacing are just half (STAR mode) or one-third (IBM mode) what they were. This is because < ESC > “3” CHR$(n) sets the line spacing to n/144 inch in the STAR mode, or n/216 inch in the IBM mode. Table 6-2 shows all the line spacing commands, several “shortcut”...
  • Page 62 without moving the printhead lowing commands do just that. The < ESC > “J” CHR$(n) command make one line feed of n/144 inch (STAR mode), or n/216 inch (IBM mode), but does not change the setting of the line spacing. Try this program to see how it works: 10 'Demo one-time line feeds.
  • Page 63: Forms Controls

    ., / :..., ./, ii 3::: / ,,.,!, / j: ,..! t:: : i :: i”) i,,!. iyl i-j c+i: ij i._.. :i. r-: E .L Y The new line 50 moves the paper up 3 lines, but the printhead doesn’t move.
  • Page 64: Changing The Page Length Top And Bottom Margins

    The form feed (CHR$(J2)) move to the top of a new page before printing the last two lines. A note to TRS-80 users: CHR$(12) is a problem code for the TRS-80. To send a form feed command add 128 to it making it CHR$(140). use CHR$(12) in these programs.
  • Page 65: Table 6-4 Top And Bottom Margin Commands

    TOP AND BOTTOM Many programs that use a printer don’t keep track of where they are printing on the page. This causes a problem when you get to the bottom of a page because these programs just keep on printing, right over the perforation. to read, especially if a line happens to fall right on the perforation.
  • Page 66 When you run this program it will print 150 lines right down the page and across the perforations. a form feed to advance the paper to the top of the next page. Look at the lines that have printed near the perforations. the sheets and see if any of the lines have been torn in half.
  • Page 67 Always send a form feed after setting the top margin, or it will not work on the first page printed. only takes effect after a form feed. Line 14 sets the top margin, line 12 sets the bottom and line 55 clears both margins when we are done. SUMMARY Control code CHR$( 10)
  • Page 69: Formatting Your Output

    In this chapter we will discover how to use: Horizontal tabs Vertical tabs Left and right margins USING When you turn SG-10/15 on there are horizontal tomatically just send a CHR$(9) to SG-IO/15 and the print head will move to the next tab position. for horizontal tab.
  • Page 70: A One-Shot Tab Command

    This is fine if the computer and the printer have the same tab settings, but it doesn’t allow us to use our own tab settings on SG-10/15. We can “outsmart” adding 128 to the ASCII value that we use. Instead of using CHR$(9), use CHR$( 137) for a tab command.
  • Page 71: Setting Left And Right Margins

    The commands to set the margins are given in the following table: Left and right margin commands Note: If your computer CHR$(lOS) for “1”. setting SG-10/15’s margins with this program for STAR mode: 'Demo margins. GOSUB 70 30 LPRINT CHR$(27) "M"...
  • Page 72: Using Vertical Tabs

    This means that you should set a left margin of 0 and a right margin of 80 on SG-10 or 136 on SG-15 If you change the pitch of your printing margins, the margins will not change.
  • Page 73 Now, let’s set some vertical tabs of our own. Add these lines to the program: 12 LPRINT CHR$(27) "P" CHR$(lfl) ; 14 LPRINT CHR$(2@) CHR$(4@) CHR$(@) CHR$('d) ; < ESC > “P” is the command to set vertical tabs for the STAR mode.
  • Page 74: A One-Shot Vertical Tab Command

    This doesn’t confuse SG- lo/ 15-it advances the paper to the next tab position which happens to be the first tab position next page. That’s nice, isn’t it? n A one-shot vertical tab command There’s a one-time vertical tab command the one-time CHR$(n), and it causes the paper to advance n lines.
  • Page 75: Special Features Of The Sg10/15

    In this chapter we will look at more control codes. These codes don’t lit neatly into any of the groupings that we have studied, but they add a lot of capability to SG-10/15. So here goes. Commands covered in this chapter include:...
  • Page 76 CHR$(7) Apple’s bell; the code will not be sent to will sound SG-10/15. You can try this by typing: LPRINT CHR$(7); There are two other codes that affect the bell. One disables the bell, so that SG-IO/l5 will ignore a CHR$(7), and the other turns the bell back on.
  • Page 77: Printing To The Bottom Of The Sheet

    for the code to go on-line again. SG- 10/l 5 off-line; CHR$( 17) returns SG- lo/ 15 to on-line status. n Printing to the bottom of the sheet Sometimes when you are using individual sheets of paper you may want to print near the bottom detector usually stops SG-lo/15 when you are about 2 % inches from the bottom of the sheet.
  • Page 78: Backspace, Delete, And Cancel Text

    Sometimes, you want to print “zero” with slash to distinguish between “0” and “0”. Your SG-lo/15 “pl” as you wish. so that you Each time it moves the printhead (it’s erased from SG-10/15’s can print either “0” or a total of...
  • Page 79: Unidirectional Printing

    H Unidirectional printing Unidirectional printing is a big word that means printing in one direction only. SG- lo/ 15 normally prints when the printhead is moving in both directions. But once in a while you may have an application where you are more concerned vertical lines align than with how fast it prints.
  • Page 80: The Seven Bit Dilemma

    again. Finally line 110 sends a form feed to advance the paper to the top of a new page, and then uses the master reset to restore SG-lo/15 to the power-on condition. You can also set SG-IO/l5 to print in one direction for one line only by using the command immediately moves the printhead...
  • Page 81: Block Graphics Characters And Special Symbols

    H Block graphics characters and special symbols Besides the upper and lower case letters and symbols that we are by now familiar with, SC-lo/15 characters that are for special uses. These characters include block graphics characters for drawing forms and graphs, and special symbols for mathematical, The following program will print out all of the graphics characters available in STAR mode.
  • Page 82 2c39 T .--,q Li .9 Figure 8-2. “it:1 1 I221 I ’...
  • Page 83 1 7 4 2r:,4 25 4 :;::: 2<:,7 L...
  • Page 84: International Character Sets

    18 LPRINT CHR$(27) "@" 20 LPRINT CHR$(27) "6" FOR J = 3 TO 6 4Q LPRINT " " J CHR$(J) " NEXT 60 LPRINT " 21 " CHR$(21) 70 LPRINT 80 FOR J = 128 TO 254 STEP 10 90 FOR I = J TO J + 9 95 IF I >...
  • Page 85: The Macro Control Code

    Here is how SG-10/15’s macro works. You define your macro by telling SG- 10/l 5 what normal control codes are to be included I,._..
  • Page 86: Table 8-7 Macro Instruction

    Macro instruction commands Function Define macro Use macro 18 LPRINT CHRS(27) "+'I; ' START DEFINITION OF MACRO LPRINT CHR$(18); LPRINT CHR$(27) "Wfl"; ' EXPANDED OFF LPRINT CHR$(27) "F"; 50 LPRINT CHR$(27) "H"; 60 LPRINT CHR$(27) 70 LPRINT CHR$(27) "T"; LPRINT CHR$(30); As the comments in the program listing show this will define a macro that will reset all the print style functions.
  • Page 87 In this chapter we have learned many different commands that have many different uses. In the next chapter we will make up for this diversity-the whole chapter only covers three commands! But they are some of the most powerful that SG-lo/15 They give you the ability to create your own characters.
  • Page 89: Creating Your Own Characters

    CHAPTER 9 CREATING YOUR OWN CHARACTERS In this chapter we’ll cover: Designing and printing your own characters Designing proportional characters In the previous four chapters of this manual you’ve learned how to control the SG-lo/15 printer to give you dozens of dif- ferent typefaces.
  • Page 90: The Print Matrix

    (in either impact l o.e 0.0. 0.0. eo.0 that the SG-10/15 prints are memory). This includes all of the the block graphics character sets, the NLQ characters printer). stored in the and special...
  • Page 91: Defining Your Own Characters

    But there is another area of memory in the SG-lo/15 reserved user-defined characters. These are characters that you design download into SG-10/15. defined they are stored in allows you to define or modify them at any time. Each of these characters, character ROM or in download which is six “boxes”...
  • Page 92 Figure 9-5. Later in this chapter we’ll use this character to create a small graph.) You’ll notice that Figure 9-4 includes a lot of information around the grid. Don’t be intimidated; as we come to it in our discussion of defining and actually printing download characters.
  • Page 93: Rule 2: Dots Cannot Overlap

    character uses the top eight dots, write in a one next to the word “Descender” on the layout grid; if it uses the bottom eight dots, write in a zero. In our example, we’ll want the bottom of the flask to line up with the baseline of the other characters, so it will be a descender.
  • Page 94 m, m, m, m. m, m6 m, m, m, m,, m,, btal Dots cannot overlap; those in immediately adjacent “half Figure 9-6. columns” will be ignored when the character is printed. W Add up each column of dots Now it’s time to give our creative side a break and get down to some basic arithmetic.
  • Page 95: Assigning A Value To Your Character

    value. Some examples will make this clearer. As shown in Figure 9-7, if we add the numbers for the dots that print in a column, the sum will be a number in the range of 0 to 255. Each number from O-255 represents a unique combination So add up the values of the dots in each column using this system.
  • Page 96 can define any positions except the defined control code positions. This means that once a character is defined and assigned a value (and the download character character on the printer the same way you would any standard character. You can send the character with the same ASCII value (for instance, if you had assigned your character a code of 66, it would print each time you sent a character “B”...
  • Page 97: Download Character Definition Command

    Our chart would hardly be complete with just a picture of a chemist’s flask, so in Figure 9-9 we’ve made completed grids for some other symbols: an automobile mix of characters!). The information (except for proportional take up shortly). n Download character definition command You’ve read through a long explanation of download characters and we haven’t even told you the command syntax yet! Now the...
  • Page 98 We’ll be discussing proportional in this chapter; for now, we’ll leave it at 11. The descender data was discussed earlier: to use the top eight pins, this bit should be 1; to use the bottom eight pins this bit should be 0. Figure 9-10 shows the bits of the attribute our flask character.
  • Page 99: Printing Download Characters

    10 LPRINT CHR$(27) CHR$(162); FOR N = 160 TO 162 FOR M = 0 TO 11 READ MM LPRINT CHR$(MM); NEXT M NEXT N 80 LPRINT 90 DATA 139,2,5,8,241,0,0,241,8,5,2,0 100 DATA 139,124,0,66,4,64,36,16,2,16,12,0 110 DATA 139,46,16,2,60,0,48,8,48,0,48,0 When you run this program, That’s OK.
  • Page 100 Voila! It should have printed out the three characters we de- fined. Your printout should look like this: (If it doesn’t, check the last program we ran for errors, then rerun it.) Let’s find out if there are any other characters in the download RAM.
  • Page 101 149) LPRINT ESC$ "$1"; 150 LPRINT "Autos" 160 FOR I=.4 TO 9.3 NEXT 170 LPRINT 180 LPRINT "Chemicals" 190 FOR I=.4 TO 8.7 NEXT 200 LPRINT 214) LPRINT "Guns" TB$; 220 FOR I=.4 TO 1.4 NEXT 230 LPRINT 240 LPRINT ESC$ "$0"; 254) LPRINT TB$ CHR$(246) SCALES = CHR$(24l)+CHR$(241)+CHR$(248)+CHR$(24l)KHR$(241)
  • Page 102 ERASING DOWNLOAD After you have defined a set of characters phabet, perhaps) you may want to go back to using mostly standard characters with a few new user-defined characters mixed Rather than turning SG-lo/15 current settings, including a command which will restore the default command copies all the characters from the standard character ROM into download...
  • Page 103 These download characters are defined as proportional Figure 9-12. characters. attribute byte, As you know, the first bit of specify whether the character is a descender or ‘not. The next three bits are used to specify the starting print column (acceptable values are 0 to 7).
  • Page 104 10 FOR N=l TO 4 24) READ Nl 34) LPRINT CHR$(27) FOR M=0 TO 11 READ MM 60 LPRINT CHR$(MM); NEXT M NEXT N 90 LPRINT " Mississippi" 100 LPRINT 110 LPRINT "Standard spacing" 120 LPRINT 130 LPRINT 144) LPRINT CHR$(27) 158 LPRINT CHR$(27) 160 LPRINT "Download spacing"...
  • Page 105 One thing to remember about defining proportional a character cannot be wider than the specified width. That seems obvious enough! For example, if you specify a width of 6 for a character (starting in column seventh through eleventh columns of dots (if you specified any) will not print.
  • Page 106 In the program that follows, we’ve used this technique Each digit is actually made up of four some large numbers. characters-two horizontally course, that you must define and print four characters for each finished digit. We assigned the upper left quadrant to ASCII codes from 160 to 169, the upper right quadrant codes 170 to 179, and so on.
  • Page 107 130 READ MS 140 PRINT 111, CHR$(MS); 150 NEXT S 160 NEXT I 170 ' 180 ASCII = 160 CHARACTERS 190 FOR NUM = 0 TO 9 200 NUMERAL.TOP$(NLJM) = CHR$(ASCII + 1) 210 NUMERAL.BOT$(NUM) = CHR$(ASCII + 3) 220 ASCII = ASCII 230 NEXT NUM 240 BLANKS = CHR$(200)
  • Page 108 500 DATA 11, 0, 0, 0, 0, 0, 0, 32, 64, 32, 64, 32 510 DATA 11, 68, 42, 68, 58, 68, 50, 68, 34, 64, 2, 520 DATA 11, 8, 0, 12, 0, 28, 2, 12, 2, 4, 2, 4 530 DATA 11, 2, 4, 2, 12, 144, 108, 144, 104, 144, 96, 128 540 'FOUR...
  • Page 109 810 DATA 11, 192, 0, 192, 0, 194, 32, 222, 32, 94, 32, 30 820 DATA 11, 12, 0, 28, 0, 142, 0, 198, 0, 198, 0, 830 DATA 11, 0, 206, 0, 156, 0, 248, 0, 240, 840 'SPACE 850 DATA 11, 8, 0, 0, 0, 8, 8, 0, 8, 8, 8, 8 SUMMARY Control code...
  • Page 111 Subjects covered in this chapter include: SG-10/15’s Printing a pre-defined shape Plotting a calculated shape High resolution graphics In Chapter graphics; you were able to actually define characters dot by dot. In this chapter you’ll learn to use the same principles to make SG-lo/15 print whole pages of dot graphics! We’ll show you how...
  • Page 112 Just like many of the other codes you have learned, the com- mand starts with an escape sequence (< ESC > “K” in this case). But unlike SG-10/15’s other codes there can be any number of graphics data bytes following the command. That’s where nl and n2 come in;...
  • Page 113: Table 10-L Calculating Nl And N2

    480 dots on SG-10 or 816 dots on SG-15. graphics data to expect, SG- lo/15 multiplies n2 by 256 and adds the value of nl. If you divide the number of columns by 256,...
  • Page 114 (not used) Figure 10-l. Starting with the most significant of the print head is assigned a value which is a power of two. Note that for 7-bit computers, the top pin cannot be used. A short program should demonstrate graphics command. The program below gave us this printout: 10 ‘Demo dot graphics.
  • Page 115 n Combining text and graphics It’s also possible to mix text and graphics in one line. This can be useful for labeling charts or graphs, or even inserting fancy graphics in text. Try adding these lines to our program: 45 PRINT #l,"WOW!" ; 85 PRINT #l,"This is great!"...
  • Page 116 paper. And it may be helpful to write the dot values (128, 64, 32, etc.) down the left side of each row. Then after you’ve filled in the “dots” that you want to print, it’s time to get out the old calculator again! Just as you did with download characters, add up the values of each column of dots;...
  • Page 117 60 GRAPHICS = CHR$(27)+CHR$(75) 70 DIM LOG0$(4) 80 WIDTH "LPTl:",255 90 ' READ DATA 100 FOR ROW = 1 TO 4 110 FOR COLUMN = 1 TO 100 120 READ P 130 LOGO$(ROW) = LOGO$(ROW) + CHR$(P) 140 NEXT COLUMN 150 NEXT ROW 160 ' PRINT LOGO 170 LPRINT LINE.8$;...
  • Page 118 500 DATA 252,255,255,255,127,63,31,7,7,31 510 DATA 254,252,248,224,128,0,@,3,7,7 520 DATA 7,3,0,0,0,0,0,0,0,0 530 DATA Q,31,31,3,129,128,192,192,192,192 540 DATA 192,224,224,224,224,240,255,255,255,255 550 DATA 255,~27,0,0,0,0,0,0,0,0 560 'ROW4 570 DATA 0,248,248,240,224,224,112,112,56,56 580 DATA 56,56,56,120,12@,24(iI,240,224,224,192 590 DATA 128,0,0,0,0,0,192,224,240,240 600 DATA 24@,248,248,248,120,120,56,56,56,56 610 DATA 48,112,224,224,224,224,240,248,248,248 620 DATA 120,120,56,56,56,56,120,240,224,224 630 DATA 192,128,0,0,0,0,0,0,0,0 640 DATA 0,:48,248,24~,224,224,112,112,56,56 650 DATA 56,56,56,120,12!Zi,240,24fJ,224,224,192 660 DATA 12~,0,0,0,0,0,0,0,0,0...
  • Page 119 and SG-IO/15 plotting the output, you can come up with some terrific business graphs, charts, and mathematical The best way to do this is to set up an array in memory. This is your “graph paper.” The first thing to do is to determine how big you want your output to be;...
  • Page 120 270 ' :ine to draw a line from Xl,Yl 280 'Subrout 290 ' 300 XL = X2 - Xl 310 NX = ABS(XL*LXFAC) : NY = ABS(YL*LYFAC) 320 IF NX < NY THEN NX = NY 330 NS% = INT(NX+l) 340 DX = XL/NS% 350 FOR 1% = 1 TO NS% 360 Xl = Xl + DX...
  • Page 121 you need to change are the values in line 40. The array MASK% contains the values of the dots. (In order to make this program run on the most computers, we’re using only six pins for graphics. With many computers, lines 90 and 100 we’ve defined some other variables you’ll be interested in: LX, LXFAC, LY, and LYFAC are used as scaling factors.
  • Page 122 at a time. The variable A$ is used to build a string of all the columns of BIT% in a given row. As you can see, by taking the program analyzing it, graphics programming If you want to try some other plots, try these (replace lines after 600 with the lines below).
  • Page 123 RESOLUTION Up until now all of the dot graphics printing we have done has been with SG-10/15’s normal density mode. This can give you some pretty sharp images at great speed. Sometimes though, you may want to create an image with even higher resolution.
  • Page 124: Table 10-2 Dot Graphics Commands

    Table 10-2 Dot graphics commands If your computer does not support lowercase characters, use Note: and CHR$(122) for “g”, “y”, and “z”, re- CHR$(103), CHR$(121), spectively.
  • Page 125 Double density graphics /...‘I . ..- ‘. “. ..;.“:c..~:. ‘..:.. ,.i” ” .p&.~:“” . . /: >, ,.:. )..L>..:.. ,!~., ,,,, ,“... ),., ,” ;’ .;:,.. . ‘L’i .’ y.;., ,::.,.;: :.,;;y .“. ,: _, :j;: .:.;,, , ..‘.
  • Page 126 So if quadruple density looks so great, why not use it all the time? Let’s try an experiment just how the different density modes work. Using the “logo” program in this chapter, change line 60 to try each of the different modes.
  • Page 127 Star’s engineers have given programmers program development graphics. Although this mode requires just as much memory and computing time as double density, it prints at the same speed as normal 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.
  • Page 128 < ESC > “Z” nl n2 ml m2... Print quadruple density graphics (for < ESC > “g” n0 nl n2 ml m2... < ESC > “*” n0 nl n2 ml m2... IBM mode) Master graphics selection (for STAR mode) Master graphics selection (for IBM mode)

This manual is also suitable for:

Sg-15

Table of Contents