
Using SQ-2000 Commands with BASIC
Master Select Codes
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 SQ-2000 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>
produces a line feed.
<ESC> ”J” n
Advances the paper n/180 inch
<ESC> “0”
Sets the line spacing to *1/8 inch.
<ESC> “2”
Sets the line spacing to l/6 inch.
<ESC> “3” n
Sets the line spacing to l/180 inch (0 n 255).
<ESC> “A” n
Sets the line spacing to n/60 inches (0 n 85).
<FF>
Produces a form feed.
<ESC> “C” n
Sets the length of the page to n lines
<ESC> “C” <NUL> n
Sets the page length to n inches
<ESC> “N“ n
Sets a bottom margin of n lines
<ESC> “O”
Sets the bottom margin to 0 lines.
<VT>
Produces a vertical tab.
<ESC> “B” n1 n2 n3 ___ <NUL>
Sets up to 16 vertical tabs on lines n1, n2, n3, etc.
<ESC> “/” c
Selects a vertical tab channel
<ESC> “b” c n1 n2 n3 ... <NUL>
Sets up to 16 vertical tabs on lines n1, n2, n3, etc. of
vertical tab channel c
Horizontal Spacing Commands
<CR>
Produces a carriage return.
<ESC> “Q” n
Sets a right margin at n columns
<ESC> “1” n
Sets the left margin at n columns
<HT>
Produces a horizontal tab.
<ESC> “D”n1 n2 n3... <NUL>
SW1-2
Not used
-
-
OFF
SW1-3
Automatic line
LF added
LF needed
OFF
feed
by printer
from computer
SW1-4
Control ROM
See Appendix D
OFF
selection
<ESC> <SP> n
<ESC> “$” n1 n2
<ESC> “\” n1 n2
Sets up to 32 horizontal tabs at character positions n1,
n2, n3, etc.
Increases the space between characters by n dots
Moves the print head to an absolute horizontal position.
Moves the print head a specified distance from the last
character printed.
Print Style Commands
<ESC>
“x”
n
Selects between draft mode (n=0) and letter quality mode.
<ESC> “!” n
Selects multiple printing styles (Master Select command).
<ESC> “M”
Selects elite pitch.
<ESC> “P”
Cancels elite pitch.
<ESC> “p” n
Turns proportional printing ON (n=1) or proportional
printing OFF (n=0).
<so>
<ESC> <SO>
Selects one-line expanded width print.
Selects one-line expanded width print.
<DC4>
<ESC> “W” n
<SI>
<ESC> <SI>
<DC2>
<ESC> “E”
<ESC> “F”
<ESC> “4”
<ESC> “5”
<ESC> ”--” n
<ESC> “S” n
<ESC> “T”
Cancels one-line expanded print.
Turns expanded width print ON (n=1) or turns
expanded width print OFF (n=0).
Selects compressed width print.
Selects compressed width print.
Cancels compressed width print.
Selects emphasized print.
Cancels emphasized print.
Selects italic print.
Cancels italic print.
Turns underlining ON
(n=1)
or turns underlining
OFF (n=0).
Selects superscripts (n=0) or selects subscripts (n=l).
Cancels superscripts and subscripts.
Character Set Commands
<ESC> “%” n
Selects the user-defined character set (n=1) or cancels
the user-defined character set (n=0).
<ESC> “&” <NUL> n1 n2 data
Defines user-defined characters
<ESC> “.” <NUL> <NUL> <NUL>
Copies ROM character set to user-defined character set.
<ESC> “R” n
Selects international character set
Graphics Commands
<ESC> “K” n1 n2
data
Prints single-density dot graphics.
<ESC> “L” n1
n2 data
Prints double-density dot graphics.
<ESC> “Y” n1 n2 data
Prints high-speed double-density dot graphics.
<ESC> “Z“ n1 n2 data
Prints quadruple-density dot graphics.
<ESC> “*” s n1 n2 data
prints selected-density dot graphics.
<ESC> “?” s n
Assigns graphics densities.
Miscellaneous Commands
<CAN>
Cancels the current line.
<DEL>
Deletes the preceding character.
<DC3>
Turns printer to off-line state.
<DC1>
Turns printer to on-line state.
<ESC> “V” n data <ESC> “V” <NUL>
<ESC> “>”
<ESC> “=”
<ESC> “#”
<BEL>
<BS>
<ESC> “@”
<ESC> “<”
<ESC> “U” n
Repeats
data,
n times
Sets the eighth data bit to 1.
Sets the eighth data bit to 0.
Cancels control of
the
eighth
data
bit.
Sounds the buzzer.
Produces a backspace.
Resets the printer.
Causes the next line to be printed left-to-right.
Selects unidirectional printing (n=1) or bidirectional
printing (n=0).
Each print style is assigned a value to be used with the Master Select com-
mand. The Master Select command consists of <ESC> ’!” followed by a single
ASCII code. To create a Master Select code, add the values of the print styles you
want to combine.
The values of the print styles are as follows:
Elite
1
Proportional
2
Compressed
4
Emphasized
8
Expanded
32
Italic 64
Underlined
128
For example, if you want to find the code for elite emphasized italic print you
would add these values:
Elite
1
Emphasized
8
Italic
64
Master Select code
73
The Master Select Command you would use would look like this:
<ESC> “!” “I”
(I is ASCII 73)
DIP Switch Settings
Interface DIP switch Panel 1
Switch Function ON (up) OFF (down) Factory setting
SW1-1 2K-byte buffer Disabled Enabled
OFF
Interface DIP switch Panel 2
Switch
Function
ON (up)
OFF (down)
Factory setting
2-1
ON
International character selection
2-2
(See Table D-4)
ON
2-3
ON
2-4
Form length
12"
11”
OFF
2-5 1" skip-over Enabled Disabled
I
OFF
perforation
2-6 Buzzer
2-7 Print quality
Disabled Enabled OFF
LQ*
Draft** OFF
2-8
SLCT IN signal Fixed Not fixed
ON
* Letter quality
** Draft quality