Peripherals

There have been a number of problems related to printer code response involving several Model I/III software packages. I will try to explain here the sources of the problems, the resulting errors and possible corrective actions which might be taken.

The printer drivers which are a part of Model I ROM were tailored to fit the only printer available at the time (LP I), and the Model III drivers were fashioned after the Model I drivers to maintain com-patability and assure support for Model I products. That first printer was a very dumb printer and had a rather unusual response to certain codes. Because of this, the ROM printer driver intercepts certain codes normally passed on to the printer and substitutes others designed to achieve the desired response.

The early Radio Shack printer did not have a built-in "top of form" (advance to next page) function. Therefore, the only way to advance to the top of the next page was to issue the proper number of line feed commands to the printer. To date, Radio Shack software does not support any automatic TOF action by a printer.

In order to achieve proper response, both the TOP OF FORM command, CHR$(12) and the vertical tab CHR$(11) are intercepted. The computer compares the number of lines already printed on the current page with the maximum number of lines to print on that page (plus one), and a suitable number of linefeeds are sent instead of the CHR$(11) or CHR$(12). In both the Model I and the Model III, the maximum lines per page is set to 67 at power-up. Note that this value is the maximum number of lines for 11 inch paper (66) PLUS one.

All R/S printers, upon receipt of a Carriage Return (CR or CHR$(13)), not only issue a return to the beginning of the current line but also advance to a NEW LINE (LF). In addition, early models (LP I, II, IV, and some versions of LP III (26-1156A)) ignore any CR issued if there is no text in the print buffer. Thus, the printer ignores all but the first in an unbroken series of CR codes. For this reason, those confangled early printers refuse to respond to a null string, (i.e. —just LPRINT). Since the printer already issues a LF when a CR is received it seems to assume that in a string of line feeds (issued to reach Top of Form for instance) the last LF is a mistake and ignores it.

Product Line Manager's News

Actually, what really occurs is that no action is taken upon receipt of the line terminator (The last CHR$(13) in a string of CHR$(13)s).

The code for "line feed" is decimal 10 (CHR$(10)). This is supposed to cause the printer to advance one line without changing the position of the carriage. However, the BASIC Interpreter intercepts the "10" (LF) in the expression CHR$(10) and REPLACES IT with a CR (CHR$(13)). (Some RS printers issue a CR as well as a LF when they receive a 10.) IN ADDITION, the "NULL" code CHR$(0) is simply ignored; it is not passed to the printer at all.

This should tell you that if you have a printer which happens to respond "correctly" to the CHR$( 10), or reacts to all CR codes it receives, you are in trouble!

Clear as mud? There's more to come!

Our first printers only had seven data lines active; the eighth bit (Most Significant Bit) was simply not connected. In order to slip a code " 10" past the watchful eye of the BASIC interpreter, some intrepid programmer discovered that CHR$( 138) looked like a code" 10" to the printer because the missing eighth bit was the difference between the binary forms of 10 and 138.

This was great until a printer came along which used that eighth bit for something. Real trouble! To correct this, we have undertaken the task of establishing codes which can be implemented on all our new printers. Our new standards, now being finalized, reflect a straightforward approach (more about these in future issues). This means, however, that software written for the earlier machines might not print the way they were designed.

ENTER LPC/CMD

LPC is a system (machine language) program which modifies the ROM printer driver in Model I/III. It is designed to allow the system to emulate the response of the first generation printers on a printer having the new revised code response. In other words, LPC throws away all but one CR in a series of carriage returns (ignores LPRINT statements which do not have any text) and converts 138's to 10's.

LPC might be necessary with some software when using these current ("new") printers and/or any future RADIO SHACK printer product:

Line Printer III (26-1156)

Line Printer V (26-1165)

VII (26-1167) All Daisy Wheel Printers

When do you need LPC? Well, if you run your application and you keep adding a line every time you do a Top of Form then you need it (you are having "Top of Form trouble"); or if you lose line feeds (you are having problems with CHR$(138)).

At this writing to say exactly which Model I/III programs need the driver is like trying to hit a moving target. Many times it has been possible to fix the problem before release of a new version. In many cases, both "fixed" and original versions exist in the field and there may not be an easy way to know which is which. This list of Model I/III software which requires LPC/CMD is current at this time. It might (will!) change: 26-1504 Level II Payroll 26-1506 Cassette Portfolio 26-1507 Standard and Poor's

STOCKPAK® 26-1552 General Ledger 26-1553 Inventory Control 26-1556 Disk Payroll 26-1557 Concrete Take-Off 26-1558 Mailing List 26-1559 Manufacturing Inventory Control

26-1560 Fixed Asset Accounting 26-1562 Profile 26-1571 Real Estate Vol. 1 26-1572 Real Estate Vol. II. 26-1573 Real Estate Vol. Ill 26-1574 Real Estate Vol. IV 26-1603 Budget Management

If you have these programs, and you are having the problems we are describing, use LPC/CMD. If the problems do not appear, LPC is not needed.

MOD I to MOD III conversions which you do yourself may also need LPC. These conversions are those which you might do to move an existing program (yours or ours) from Mod I to Mod III.

LPC is a very shy beast. Once loaded (usually by an AUTO command on your application disk) it burrows into the system and pulls the sand over it's head and disappears. That is, when you load LPC, it checks the computer, moves itself to just below the top of memory, and then resets the Top of Memory pointers in the

(Continued on Page 17)

Peripherals (From Page 16)

odel I to just below itself. When this process is complete, the computer does not know that the program is there! Since the program "disappears," if you attempt to load a second copy of LPC because you forgot the first copy was there, LPC will load a second copy, just below the first one (remember, LPC changed the Top of Memory pointers)! Do this often enough and you will run out of memory.

LPC/CMD for Model I Disk systems is available free from your RADIO SHACK dealer. Order number 700-2007. For Model III Disk users, LPC/CMD is included with TRSDOS 1.2 and will be included with all future Model III TRSDOS releases.

To help you avoid the problems we have been discussing in your own programs, here are a few tips from our application programmers which should eliminate the need for LPC:

1. At the beginning of the program insert the following statement to preset the line count:

POKE 1G425 >1

2. To do a TOF, follow this procedure:

LPRINT CHR$(12)5:P0KE 1G425, 1

(Please note that the semi-colon (;) jllowrng the CHR$(12) is extremely important)

3. Do NOT use CHR$(138). If you have used CHR$(138), change it to CHR$(32). CHR$(32) is the code for a blank or space. (If you know that your program will be used ONLY with a "new" printer, you can use LPRINT by itself.) These steps will give you a CR/LF. There is currently no way to send a character 10 to an eight bit printer from BASIC.

Our application programmers assure us that these procedures will work with both Models I and III, all ROM versions and all "known" printers.

There are a few more loose ends which need to be addressed. A glance at some Radio Shack printer manuals will reveal an attempt to provide CR/LF response to CHR$(138). This can of worms should not have been opened and such response is no longer supported.

Because the operating system in MODEL II is in RAM it has been a little easier to address the code response problems there. Normally the Model II BASIC Interpreter completely ignores the CHR$(10). Also, TRSDOS 2.0 has a transparent mode to allow all codes written in JASIC to reach the printer (remember Model II BASIC ignores code 10, so you cannot send a 10 to the printer, even with the transparent mode on). A similar

"transparent" driver is being prepared for Model I/III so that the full capabilities of our new graphic printers can be utilized. More about that in a future article.

Is it all clear now? Let me stir it all up again. There is a way, in the case of several R/S printers, to eliminate some of these problems without changing software or installing drivers. Some "new" R/S printers are designed so that they can easily be changed by your service representative. These changes cause the printer hardware to emulate the early machines; these newer printers can be set to allow or dissallow the automatic line feed as well as set or reset the "buffer empty response—throw away a LF" syndrome. The automatic New line is still a necessary response for Radio Shack software. The second option is of value only in cases where only the older software are going to be used. If you use it, newer software could have problems.

To help make things a little clearer, look at the chart, which shows how our different printers react, and whether their response is changeable.

Note that if the printer response is changeable, the chart shows the way the printer is shipped from the warehouse.

These changes are documented in our Service Manuals. You should let the R/S service center adjust the machine as your warranties are voided when the machine is opened by unauthorized personnel. The ability to make these changes will be a feature of all future Radio Shack Dot Matrix printers as long as there is a perceived need. I'll grant you the value of the ability to defeat the automatic LF but pray for the day we can wave goodby to that "buffer empty" ordeal.

I know that some of this may be confusing. It has been giving the folks here in Ft. Worth a fine time, but we "bit the bullet" and are going with a standard for future products. A little confusion and inconvenience now will buy us a proper standard to work with in the future.

Printer Code

Next month I will have juicy details of our new Plug N Power Controller. And in an upcoming issue (maybe next month) I hope to feature a chart outlining the code response of all our printers, our new printer code response standards, as well as more complete information on the Model I, II, and III printer drivers.

View 7th (From Page 2)

Since the heart of the system is a general purpose office computer, it can also perform important office functions. The Bucks will be utilizing the system in such areas as season ticketholder mailing list, and word processing while another club will be utilizing it for general ledger and payroll.

The Sport Stats SS100 Basketball Scoring System took two years to develop working with several NBA teams. Sport Stats has just completed six months of extensive field testing of the system with the help of the Milwaukee Bucks and is now offering the SS100 for sale to NBA, college and high school teams.

The "Sport Stats SS100 Basketball Scoring System" has been used at each of the Bucks home games this season. Two other NBA teams, the Golden State Warriors and the Phoenix Suns, also have the system installed in their arenas. Eventually, it is hoped that computer stats will be universally accepted on a league-wide basis, helping the NBA step into the computer age.

If any of you know of other applications that would be of interest to our readers please send them in. I would like to hear more about the man who has a multi-thousand mailing list on a Model I —on cassettes.

Until next month.

Until next month.

Chart

Printer Code

Option 1

Option 2 If buffer empty

Changeable ?

CHR$(13) is CR/LF

CHR$(13) CR only

CR ignored

All codes executed

LP I

X

X

No

LP II

X

X

No

Early

LP III

X

X

No

Later

LP IIIA

X

X

Yes

LP IV

X

X

No

LP V

X

X

Yes

LP VI

X

X

Yes

LP VII

X

X

No

WP 50

X

X

No

DWII

X

X

No

0 0

Post a comment