Using the LQ-1500 Commands with BASIC

Most versions of BASIC use the LPRINT command and the CHR$(n) function to send codes to the printer. In the CHR!$(n) function the value n is the number of the code that you want to send to the printer. For example, to set a right margin at column 60, the LQ-1500 command is:

<ESC> “Q” 60

In BASIC it looks like this:

LPRINT CHR$(27) “Q” CHR$(60);

Control Codes by Function

Vertical Spacing Commands

<LF>

<ESC> “J” n <ESC> “0” <ESC> “2” <ESC> “3” n <ESC> “A” n

<FF>

<ESC> “C” n

<ESC> “C” <NUL> n <ESC> “N” n <ESC> “O”

<VT>

<ESC> “B” nl n2 n3.

<ESC> “/ ” c

<ESC> “b” c nl n2 n3

Produces a line feed.

 

 

Advances the paper n/180 inches (0

n $255).

Sets the line spacing to 1/8 inch.

 

 

Sets the line spacing to 1/6 inch.

 

 

Sets the line spacing to n/180 inch (0 n

 

255).

Sets the line spacing n/60 inches (0

n 85).

Produces a form feed.

 

 

Sets the length of the page to n lines (1

n

127).

Sets the page length to n inches (1

 

22).

Sets a bottom margin of n lines (1

 

127).

Sets the bottom margin to 0 lines.

 

 

Produces a vertical tab.

 

 

<NUL>

 

 

 

Sets

up

to 16 vertical tabs on

lines

nl, n2, n3, etc.

( l

n

2 5 4 ) .

 

 

Selects a vertical tab channel (0

c s

7).

<NUL>

Sets up to 16 vertical tabs on lines n1, n-2, n3, etc. of vertical

tab channel c (0

c

7)(1

n

254).

Horizontal Spacing

Commands

 

 

 

 

 

<CR>

Produces a carriage return.

 

 

 

 

<ESC> “Q” n

Sets a right margin at n columns (1

n

255).

 

 

<ESC> "I" n

Sets the left margin at n columns (0

n

160).

 

 

<HT>

Produces a horizontal tab.

 

 

 

 

<ESC> “D” nl n2 n3 ... <NUL>

 

 

 

 

 

 

Sets up to 32 horizontal tabs at character positions n1. n2, n3,

 

etc. (1

n 137).

 

 

 

 

<ESC> <SP> n

Increases the space between characters by n dots (0

n

127).

<ESC> "$" nl n2

Moves the print head to an absolute horizontal position.

<ESC> ” \ ” nl n2

Moves the print head a specified distance from the last charac-

 

ter

printed.

 

 

 

 

Print Style Commands

 

 

 

 

 

 

<ESC> "x" n

Selects between the draft mode (n=0) and the

letter-quality

 

mode (n=l).

 

 

 

 

<ESC> "I" n

Selects multiple printing styles (Master Select command)

 

(0

n

255).

 

 

 

 

<ESC> "M”

Selects elite pitch.

 

 

 

 

<ESC> "P"

Cancels elite pitch.

 

 

 

 

<ESC> "p" n

Turns proportional printing ON (n = 1) or proportional

print-

 

ing OFF (n=0).