Printer Configuration

A printer is defined in the PRO/5 configuration file using the ALIAS command as follows:

alias bbxname realname comment modes

Parameter Description
alias Identifies the following information as an alias (i.e., bbxname is an alias for realname.
bbxname Refers to the name of the printer for PRO/5 to use. In order for this device to be considered a printer, the first character of the name must be either an "L" or a "P." Traditionally, printers are named in the sequence 'LP', 'P0'..'P9'. For TCP/IP and UDP sockets, the bbxname must begin with "N".
realname

Refers to the name of the operating system device to be used as the printing device, such as "/dev/lp" and "/dev/rlp" for the UNIX operating system, "/dev/lpt1" and "/dev/com1" for MS-DOS systems.

If you are installing on a network, you can use the network spool device name for realname.

If you are on the UNIX operating system, the normal printer may modify the output character stream, and you may have to use the "raw" form of the device. In addition, a "pipe" may be used to send the printer output to a spooler command such as "lp" or "lpr." See the device section of your UNIX operating system documentation to determine how to access the "raw" printing device.

For TCP/IP and UDP sockets, use "tcp" or "udp", respectively.

comment

A text description of the printer, such as "Laser Printer" or "Helen's Printer." The information in the comment field is never used by PRO/5. An application program may use this information, e.g., a program may provide a list of available printers, by "comment field" to the user, via the TSK() function.

WARNING:

You must be careful with spaces in the comment field. Since spaces are used to separate the different fields of the ALIAS line, a space embedded in the comment field can cause problems. If a comment field contains spaces, then the comment field MUST be enclosed in quotation marks (i.e., "Laser Jet").

Listed below are the "comment fields" of the printer definitions already included in the PRO/5 installation printer installation. (See the READ.ME file on the PRO/5 distribution media. There may have been additional printers added to this list.)

  • Star 10x/15x

  • HP Laser Jet

  • HP Think Jet

  • TI 855/865

  • Okidata 82/92

  • Okidata 84

  • Epson 100s

  • BusinessLand BL 45

  • NEC 5500 series

  • Diablo 620,630

  • Comrex 420

  • IBM Matrix

  • Brother HR-15/25/35

  • Spirit 80

  • Okidata 83A/93

  • Epson 80s

  • Toshiba 1351

  • NEC 7700 series

  • NEC P2 series

modes

Tells PRO/5 how to control a particular printer. If your printer is one of the printers listed above (or compatible with one of these printers), select this printer during the installation. If your printer is not on this list, select "undefined" and the install procedure will then prompt you for some of the information about your printer.

Any combination of modes may be given, separated by commas with no embedded spaces.

Mode Description
BS Printer supports ASCII backspace. This is where the printer prints the most recent character and the print head is positioned such that the next character received will overprint the most recently printed character. Typically supported on serial printers.
BS=hexstring Use hexstring instead of ASCII backspace. hexstring should perform the same function as an ASCII backspace, above.
COPIES=int If the system device supports a specification of the number of copies to be printed, this would define the default number of copies to be printed. This is typically overridden using the MODE= option on the OPEN of the printer. This option may be used on the spooled output from PRO/5 (e.g., with the UNIX operating system spool commands "lp" or "lpr" or the 'nspool' device for a Novell Network), if the system spool command supports it.
CP=hexstring Sequence for compressed print sent with 'CP' mnemonic.
CPCOLS=int Number of printable columns while in compressed print mode. The default is 80 and the maximum is 255. Prior to PRO/5 1.05, the operating system default was used for the default.
CPLINES=int Number of printable lines while in compressed print mode.
FORM=int If the system device supports a specification of the form number to use in printing, this defines the default form to use. This is typically overridden using the MODE= option on the OPEN of the printer. This option may be used on the spooled output of PRO/5 if the spool commands, support it. (See example of COPIES= above.)
CR

Printer supports ASCII carriage return. A CR should cause the printer to print all characters in its buffer and to position the print head to the first column on the paper.

To begin a new print line on the printer, PRO/5 normally sends a linefeed only. Many printers automatically perform a carriage return along with the linefeed. If the printer does not automatically perform a carriage return, set this mode.

CR=hexstring Use hexstring instead of ASCII CR. This is for printers that do not support the normal definition of a CR. The sequence should cause the printer to perform the operations defined in CR, above.
EOL=string

Overrides end-of-record errors on print devices.

EOL Mode Description
ERROR

Restores the default behavior.

By default, attempting to print a string with a length greater than the defined number of columns will result in a !ERROR=1, TCB(10)=2 message. Despite the error, the text will print, but will not be wrapped.

WRAP Wraps the overflow text to the next line.
TRUNC Truncates the text exceeding the number of columns.

Note:

If an application explicitly tries to print in a column that exceeds the defined number of columns and uses EOL=WRAP or EOL=TRUNC, then the position specifier is discarded. For example, PRINT (LP)@(82) would be treated as PRINT (LP).

EPON=hexstring If the mnemonic 'EP' (expanded print) is used, then the current line is sent to the printer with the EPON hexstring.
EPOFF=hexstring If the mnemonic 'EP' (expanded print) is used, then the current line is sent to the printer with the EPOFF hexstring.
EPCOLS=int Width of each character printed in expanded print mode.
EPLINES=int Height of each character printed in expanded print mode. If EPLINES is 2, PRO/5 will count each line printed in 'EP' mode as two lines.
FF=hexstring Use hexstring instead of ASCII formfeed. If an ASCII formfeed will not position the paper to the top of form position, this sequence should be defined. If not defined, PRO/5 will send the ASCII formfeed character.
LF=hexstring Use hexstring instead of ASCII linefeed. A linefeed should print the current line and advance the paper one line. If CR is not supported, the printer should consider the next print position the first column on the line. If this option is not used, PRO/5 will use an ASCII linefeed character.
PTON=hexstring Send hexstring to printer on first OPEN. This is intended to initialize the printer to a known state. However, no data is sent to the printer until the program actually sends something. Then PTON and SP are sent.
PTOFF=hexstring Send hexstring to printer on last CLOSE. This is intended to reset the printer to a state expected by the host system.
SLON=hexstring

SLON hexstring defines the codes required to divert output to the printer.

Although this mode and SLOFF are defined for printers, they are really functions of terminals or workstations. Printer performance may suffer somewhat by using this option.

SLOFF=hexstring

SLOFF hexstring defines the codes required to resume output to the terminal or workstation screen.

Although this mode and SLON are defined for printers, they are really functions of terminals or workstations. Printer performance may suffer somewhat by using this option.

SP=hexstring Sequence for the standard print 'SP' mnemonic. This is intended to reset the printer from the 'CP' or 'EP' mnemonics and is sent to the printer on the first OPEN of a channel to the printer.
SPCOLS=int Number of printable columns while in the standard print mode. The default is 80 and the maximum is 255. Prior to PRO/5 1.05, the operating system default was used for the default
SPLINES=int Number of printable lines while in the standard print mode.
WAIT=int Wait for int seconds before reporting printer timeouts. The range for int is from 0 to 255. If int is set to 0, wait forever (this disables printer timeouts).

The modes that have most commonly caused problems are the CR, carriage return, and LF, linefeed, modes. PRO/5 considers a "carriage return action" to be an action that moves the print head back to the left side of the paper without advancing the paper. PRO/5 considers a "linefeed action" to be an action which advances the paper but does not move the print mechanism. In order to begin printing on a new line of the paper, both a carriage return and a linefeed must be performed. Note that there is a standard linefeed character (hex 0A) and a standard carriage return character (hex 0D). Different printers react differently to these characters.

Many printers have switches on them that can change this behavior. It is best to leave the printer alone and make PRO/5 adjust to the printer.

Local Printing

Local or slave printers are attached to an auxiliary port on the back of a terminal or workstation and are controlled by the SLON= and SLOFF= modes. Since output to the terminal or workstation usually goes to the display screen, PRO/5 must notify the terminal or workstation when output is intended for the printer instead.

Example 1

The following identifies a printer called L1 in BBx, located at /dev/lp1, that supports ASCII carriage return, sets the printable columns to 80, and supports ASCII backspace:

ALIAS L1 /dev/lp1 "Letter Quality" cr,spcols=80,bs

Example 2

The following identifies a printer called L1 in BBx, located at /dev/lp1, and sets the hex 0D character as the linefeed character:

ALIAS L1 /dev/lp1 "Letter Quality" LF=0D

Example 3

The following identifies the setting for a Wyse 60 terminal attached to a serial port of a computer called /dev/tty2a:

ALIAS T3 /dev/tty2a term

Example 4

The following identifies the settings for Wyse 60 in Example 3 were attached to a local printer. It will print to the auxiliary port when it receives a hexadecimal 1B6423, and it will end printing to the auxiliary port when it receives a hexadecimal 14:

ALIAS P3 /dev/tty2a "Jan's Ptr" CR,SLON=1B6423,SLOFF=14