New Code 128 Syntax To Support Function Characters August 16, 2000

Bp1,p2,p3,p4,p5,p6,p7,p8,{Fn|TD|TT|"DATA"}.

p1 Horizontal start position (X) in dots
p2 Vertical start position (Y) in dots
p3 Rotation
p4 '1' (automatic codeset selection), '1A' (codeset A), '1B' (codeset B), or '1C' (codeset C). The latter three options are new.
p5 Module width in dots (2-10)
p6 (ignored)
p7 Bar code height in dots
p8 Print human readable code: 'B' = yes; 'N' = no
Fn Insert a function character (FNC ). Legal values for n are 1, 2, 3 and 4. This option is new.
TD Insert the current date
TT Insert the current time
DATA Same as before, except that extended ASCII characters (128-255) are now legal.

Multiple Fns, TTs, TDs and "DATA" strings can be concatenated, allowing FNCs to be inserted anywhere in the symbol.

Example:

"Function 1:"F1"; Function 2:"F2"; Function 3:"F3"; Function 4:"F4

Will encode the following characters:

Function 1: FNC1; Function 2: FNC2; Function 3: FNC3; Function 4: FNC4

FNC2, FNC3, and FNC4 are illegal in Code Set C (p4 = 1C) and will result in a syntax error.

Please refer to the Code 128 standard for a description of function characters FNC1 through FNC3.

"Standard" Code 128 can encode all 128 standard ASCII characters (0-127). Function character FNC4 provides a means of also encoding extended ASCII characters (128-255). It directs the reader to add 128 to the value of each affected character before transmitting it.

Two consecutive FNC4s toggle between standard and extended ASCII mode for all succeeding data characters (until the end of the symbol, or until another pair of FNC4s is encountered). This is referred to as latching into extended ASCII mode or latching into standard ASCII mode.

A single FNC4 toggles between standard and extended ASCII mode for only a single following data character. This is referred to as shifting into extended ASCII mode or shifting into standard ASCII mode.

Both code sets A and B are needed to represent the entire extended ASCII character set, just as both sets are needed to represent the standard ASCII character set.

The initial ASCII mode for a Code 128 symbol is standard.

FNC4s can be inserted manually, if necessary or desired, by following the syntax described above. The printer will, however, insert them automatically if extended ASCII characters are encountered in the DATA. It will do so in the most efficient manner possible:

Thus, the preferred way to encode extended ASCII characters is to simply embed them in the DATA and let the printer manage the encoding task. For best results, the code set should also not be specified (i.e., p4 = 1). FNC4s should be manually inserted only in systems where extended ASCII characters cannot be transmitted to the printer.

Note that it is illegal to mix automatic and manual modes within the data for a single symbol; i.e., an extended ASCII character encountered in the data after a FNC4 will be considered a syntax error. Likewise, a FNC4 after an extended ASCII character will also be considered a syntax error.

The above-described Code 128 syntax was first implemented in the following printers in the firmware versions listed:

Printer Model Min. Firmware Version Required
2348 4.00.09
2684 3.21.23
2722 4.00.16
2742 4.01.11
2746 4.00.03
2748 All versions
2824 All versions
2844 All versions
3642 3.16.04
3742 All versions
Orion 4.01.11
P2222 4.00.15

EPL2 working example:

N
B50,10,0,1A,2,2,100,N,F1"1234567"F4"ABCD"
A10,120,0,3,1,1,N,"CODE 128 SUBSET A, FNC1 1234567 FNC4 ABCD"
B50,170,0,1B,2,2,100,N,F4"987"F2"abc"F1"XYZ"F3"123"
A10,280,0,3,1,1,N,"CODE 128 SUBSET B, FNC4 987 FNC2 abc FNC1 XYZ FNC3 123"
P1,1