Programming6–2
Control Code Functions
The following information is listed for each code function (where applicable and possible).
ASCII Mnemonic – The standard American Standard Code for Information Interchange (ASCII)
name for the control code.
Hex Code – The code’
s numeric equivalent in hexadecimal.
Decimal Code – The code’s numeric equivalent in decimal.
Purpose – The function(s) of the control code.
Comment – A description of exceptions or limitations to normal use.
A sample
Expression written in BASIC programming language is provided for
some control codes
when
a specific syntax is required to complete the program statement (i.e.,: Bit
Image modes, Down
-
load
a Language, Horizontal T
ab Set, V
ertical T
ab Set). The programs in this chapter were run on an
IBM
Personal Computer using Microsoft GW–BASIC version 3.22.
Special Function Control Code – Control Code Header
A
Special Function Control Code
(SFCC) is used to extend the control code protocol. The SFCC is the
control code introducer (or header); it is the first input in the sequence of parameters. The
general
con
-
trol
code sequence is:
(SFCC)(parameter 1)(parameter 2)...(parameter n)
P–Series
codes
can use SOH,
ETX, ESC, ^ (“hat”) or ~ (“tilde”) as control code introducers. For ex
-
ample,
you can enable bold print in the P–Series protocol using any of the following control code intro
-
ducers:
ASCII: Hex:
BASIC:
CHR$(1);“G”;
01 47SOH G
ETX G
ESC G
^ G
~ G
03 47
1B 47
5E 47
7E 47
CHR$(3);“G”;
CHR$(27);“G”;
CHR$(94);“G”;
CHR$(126);“G”;
Serial
Matrix codes
use
only
ESC as the control code introducer
. For example, to enable bold print in
the
Serial Matrix printer protocol, use the Serial Matrix SFCC and the bold print control code character
G
as follows:
ASCII: Hex:
BASIC:
CHR$(27);“G”;
1B 47
ESC G
The
SFCC is selected from the control panel. T
o select the SFCC for your application, refer to the Ap
-
plication Compatibility diagrams in the Configuration chapter.
Most
programming examples in this chapter have been
created using the ESC control code introducer
.