|Re: A method to print directly from the serial port of HP-49G |
Message #4 Posted by James M. Prange on 15 July 2002, 8:25 p.m.,
in response to message #3 by Hiroshi Ito
I've printed to the serial port of an Epson impact dot-matrix printer from the 49G. It worked pretty well, as long as I had the printer input buffer enabled. The reserved variable PRTPAR sets the line width and end-of-line characters. Of course, a wide-carriage dot matrix impact printer isn't what I'd consider "suitable" for a calculator printer.
Be aware that flow control is no longer available for the print or serial I/O commands on the 49G. On the 48 series, software flow control (XON/XOFF) was available, but the developers of the 49G seem to think that it's not worth having, so your printer will have to be able to keep up with the input as fast as the 49G can send it; make sure it has an input buffer large enough to handle whatever you intend to send it.
There are entries (SysRPL or using the SYSEVAL command) for converting characters 10, "\", and 128-255 to the HP Kermit style "backslash" character translations; KVISLF if you want character 10 translated to CRLF or KVIS if you want character 10 left as is; otherwise these entries respect the translation mode as set in IOPAR. These are for character string objects only. This may be useful if you don't care to install a special font set in your printer. If I'm not mistaken, *some* of the 49G print commands translate "NUL" (character 0), """, and "\" to "\00", "\"" and "\\" respectively.
Another possibility is to transfer the object to be printed to a 48 series calculator and print it to an 82240 printer by IR from there. For object types that are new to the 49G, you'll have to convert to something the 48 recognizes as a valid object type, such as a string or GROB. This goes for preventing exact integers from being converted to reals too. The entries DECOMP$ or EDITDECOMP$ may be useful for converting to a string with line breaks in suitable places for the 82240 printers. DECOMP$ gives you a string formatted as you'd see it on the stack, and EDITDECOMP$ gives you a stirng formatted as you'd see it in the command line editor. The UserRPL command \->STR will convert any object to a string, but doesn't "wrap" the string to fit the display/printer width. The UserRPL: command \->GROB is another possibility, but I haven't experimented with it much.
Good luck, and let us know if you find a suitable hand-held sized printer.