Star Micronics NB-15 user manual

Page 36

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 lit- tle later we will see what it takes to use some of your printer’s advanced features with commercial software.

nFirst, some terminology

Your printer knows what to print because it knows how to in- terpret the codes that the computer sends to it. These codes are numbers that the computer sends to your printer. Both the com- puter and the printer know the meaning of these codes because they are a set of standard codes used by almost all microcom- puters. This set of codes is the American Standard Code for Infor- mation Interchange, which is usually referred to as ASCII (pro- nounced ask-key). There are ASCII codes for all the letters of the alphabet, both lower case and capital, the numbers from 0 to 9, most punctuation marks, and some (but not all) of the printer’s functions.

ASCII codes are referred to in several different ways, de- pending on the way they are used. Sometimes these codes are treated as regular numbers. For example, the letter “A” is represented by the number 65 in ASCII. Appendix B shows all of the ASCII codes.

In BASIC, ASCII codes are used in the CHR$ function. This function is used to print the character that is represented by the number in the CHR$( ) function. The BASIC statement PRINT CHR$(65) will print an “A” on the terminal.

In some other programming languages, ASCII codes are refer- red to by their hex value. “Hex” is short for hexadecimal which is a base-16 number system (our usual numbers are base-lo).

Since hex needs 16 digits, it uses the numbers 0 through 9 and then it uses the letters A through F for digits. The ASCII code for the letter “A” is 41 in hex.

Of course, most of the time we don’t even need to think about this code system. Our computers are smart enough to know that when we press the “A” key on our keyboard we want to print the letter “A”. The computer takes care of all the rest.

But there are a number of ASCII codes that don’t have keys on the keyboard. The most important of these codes are the codes that ASCII values below 32. These codes control many of this printer’s functions. Even though there aren’t keys for these codes, most keyboards can send these codes. It’s done by holding down the “control” key (many times marked CTRL) and

Image 36
Contents USER’S MANUAli Tatement Special Message to the New Owner Table of Contents Chapter Controlling with Basic CHR$Chapter Special Features of the Printer Functions of the Connector Signals Appendix G Serial Interface Specifications TRS-80 BasicSetting UP Your Printer Page Tion and movement for both removing and replacing the cover Page Print head Printer Slide the I/F board into the slot Page Getting to Know Your Printer Page Page Page Selecting and Loading Paper ‘igure 2-4. Raise the paper guide for loading single sheets You can insert a sheet of paper by using the release lever To align paper that is not in straight Sprocket cover You can raise While trrnirrgon the power Self-test DIP switch 2-2 on Efgh!jklmnopqr¶tuvwxyz~ ?lSS&‘ TOF During normal operation Connecting the Printer Page Memo Using Commercial Software Page Ascii Using Your Printer with Word Processors Page Memo Controlling With Basic PR#O ListNEW Lprint Testing RUN ESC W Lprint CHR$27WCHR$l Lprint CHR$27WCHR$49 Lprint CHRS27Wl Memo Printing Text Lprint CHR$27 xl ESC OFF ESC Lprint UndelinedLprint Overlined Boldface on Escso When you run this program you should get this Demonstration Condensed Here’s what you should get from this program OFF Elite mint Summary notes Memo Formatting Text This is what you will get This Line Spacing is SET to Run the program again. Now the results will look like this Here is what your printer will produce Line Number Lprint CHRS12IOI ESCNCHR$n Lprint this is LINE1 Next This is Line Return TWO Three Four ONE This command sets the horizontal tab to every eight columns Next Try thisprogram tosee how this works Lprint CHR$11 First TAB Lprint CHR$llFIFTH TAB CHR$O Lprint 2ND TAB of CHANNEL’ Memo Special Features Printer Lprint CHR$7 ESCVCHR$O Here is what this program will print Lprint CHR$27il Printing direction commands Function Control code Next Lprint Lprint Eighth bit controls Next J 129 LPRINTCHR$27 LPRINTCHR$27= Lprintlprint Double This is Double Sized Printing Next Lprint Lprint CHR$IPage Creating Your OWN Characters Print Matrix Defining Your OWN Characters Usethisgridoronesimilartoittodefineyourown draftcharacters Wrong 128 Assigningavalueofcharacterspace Characterdesignsforthetwographsymbols Page Read MM LPRINTCHR$MM Next M Next N Lprint LPRINTCHR$I Next Lprint Lprint CHR$I NextLprint LPRINTGERMANYCHR$9 Lprintscales Data 1, 9, 2, 31,253,64, 32, 1,128,80 Read MM Lprint CHR$MM Next MMO+ml +m2 105 106