CITIZEN PD-22 Reference Guide

Command Reference
MODEL : PD-22
Revison 1.00 2007/12/5
Citizen Systems Japan Co., Ltd
1
REV Date Details
1.0 10/12/2004 Original version (tentative version)
1.1 5/24/2005
- ESC~SI: Low baud rate support for serial interface
- ESC~SI: Added the ‘Image generation speed’ setting.
2

Contents

Revision list..................................................................................................................................................... 2
Contents...........................................................................................................................................................3
Setting the top of form (TOF) /ESC~B ...........................................................................................................7
Setting power OFF time/ESC~O..................................................................................................................... 8
Registering the bit map data/ESC~b ...............................................................................................................9
Printing the bit map data /ESC~b.................................................................................................................. 10
Setting in PAGE MODE/ESC~L................................................................................................................... 11
Page feed (only for PAGE MODE marker detection) /ESC FF .................................................................... 14
Setting printing paper/FS H...........................................................................................................................15
Setting print density/ FS I..............................................................................................................................16
Printer operating status report command / FS G ...........................................................................................17
Printing the compressed bit image/ ESC~G.................................................................................................. 18
Specifying the coordinate of printing position/ESC~X................................................................................. 21
Setting the printing position of barcode character/GS H............................................................................... 22
Setting/Cancelling the turning of barcode/GS r ............................................................................................22
Setting the height of barcode/GS h................................................................................................................23
Setting the width of barcode/ GS w...............................................................................................................23
Selecting the type of l barcode/ GS k............................................................................................................24
Selecting printing mode/ ESC~U.................................................................................................................. 27
Printer power OFF/ ESC~p ...........................................................................................................................28
Selecting the code page/ ESC~P ...................................................................................................................29
Selecting Windows character/ ESC~s ........................................................................................................... 30
Printing the sequential character/ ESC~¥...................................................................................................... 31
Printing the character/ESC~^........................................................................................................................ 32
Enabling/disabling the black mark function/ ESC~E....................................................................................33
Setting the marker detection level/ESC~e.....................................................................................................34
Printer operating status report command 2/ ESC~Y..................................................................................... 36
Starting registering the printer command and flash memory/ ESC~CS........................................................ 37
Calling from printer command and flash memory/ ESC~CL........................................................................ 38
Reading the factory setting/ ESC~SF............................................................................................................ 39
Reading the default setting value/ ESC~SL .................................................................................................. 40
Writing the printer’s internal setting to flash memory / ESC~SS ................................................................. 41
Setting the inside of printer/ESC~SI............................................................................................................. 42
Returning to printing/ CR..............................................................................................................................48
Line feed/LF.................................................................................................................................................. 49
Page feed/FF.................................................................................................................................................. 50
Forward paper feeding/ ESC J ......................................................................................................................51
Setting page length by line/ ESC C............................................................................................................... 52
Setting page length by inch unit/ESC C NUL............................................................................................... 52
Setting perforated line skip/ESC N ............................................................................................................... 53
Cancelling perforated line skip/ESC O ......................................................................................................... 53
Setting the right margin/ESC Q..................................................................................................................... 54
Setting the left margin/ ESC I .......................................................................................................................55
Setting the 1/8-inch line feed rate/ESC 0...................................................................................................... 56
Setting the 1/6-inch line feed rate/ESC 2...................................................................................................... 56
Setting the n/60-inch line feed rate/ESC A ...................................................................................................57
Setting the n/180-inch line feed rate/ESC 3.................................................................................................. 57
Setting the n/360-inch line feed rate/ESC +.................................................................................................. 57
Specifying horizontal tab positions/ESC D................................................................................................... 58
3
Execution of horizontal tab/HT..................................................................................................................... 59
Setting vertical tab positions/ESC B .............................................................................................................60
Execution of vertical tab/VT......................................................................................................................... 60
Specifying the absolute position/ESC $........................................................................................................ 61
Specifying the relative position/ESC ¥ ......................................................................................................... 62
Setting the VFU tab /ESC b ..........................................................................................................................63
Specifying the VFU channel/ESC /............................................................................................................... 63
Back space/BS............................................................................................................................................... 64
Selecting the character code table/ESC t....................................................................................................... 65
Selecting the international character set/ESC R............................................................................................ 66
Specifying/Cancelling proportional font/ESC p............................................................................................ 67
Specifying the character equivalent to 10CPI/ESC P....................................................................................68
Specifying the character equivalent to 12CPI/ ESC M ................................................................................. 68
Specifying the character equivalent to 15CPI/ESC g.................................................................................... 68
Specifying super/subscript/ESC S................................................................................................................. 69
Cancelling super/subscript/ESC T.................................................................................................................69
Specifying italic/ESC 4 ................................................................................................................................. 70
Cancelling italic/ESC 5................................................................................................................................. 70
Specifying reduced printing/SI......................................................................................................................71
Specifying reduced printing/ESC SI ............................................................................................................. 71
Cancelling reduced printing/DC 2.................................................................................................................71
Specifying double-width expansion with automatic cancel/SO.................................................................... 72
Specifying double-width expansion with automatic cancel/ESC SO............................................................ 72
Cancelling double-width expansion with automatic cancel/DC4..................................................................72
Specifying/cancelling double width large characters/ESC W ....................................................................... 73
Specifying/cancelling double height large characters/ESC w ....................................................................... 73
Specifying emphasis printing/ESC E ............................................................................................................74
Cancelling emphasis printing/ESC F ............................................................................................................ 74
Specifying double strike printing/ESC G......................................................................................................75
Cancelling double strike printing/ESC H...................................................................................................... 75
Specifying/Cancelling underline/ESC − ....................................................................................................... 76
Collectively specifying a printing mode/ ESC!............................................................................................. 77
Selecting the font style/ESC k....................................................................................................................... 78
Selecting character style/ ESC q ................................................................................................................... 79
Setting the spacing of characters/ESC SP..................................................................................................... 80
Aligning the characters/ESC a ......................................................................................................................81
Specifying the download character set/ESC % .............................................................................................82
Copying character set/ESC : .........................................................................................................................83
Defining the download characters/ESC & ....................................................................................................84
Selecting the bit image mode/ESC *............................................................................................................. 86
Setting bit image repeat/ESC * ..................................................................................................................... 88
8-dot single density bit image/ESC K........................................................................................................... 89
8-dot double density bit image/ESC L.......................................................................................................... 89
8-dot double speed/density bit image/ESC Y................................................................................................ 90
8-dot quadruple density bit image/ESC Z..................................................................................................... 90
Changing the bit image mode/ESC ? ............................................................................................................91
Initializing the printer/ESC @....................................................................................................................... 92
Cancelling high order side control code/ESC 6 ............................................................................................93
Setting high order side control code/ESC 7 .................................................................................................. 94
Cancelling data/CAN .................................................................................................................................... 95
4
Deleting one character/DEL.......................................................................................................................... 95
Appendix b: Black Mark Specification......................................................................................................... 96
5
Citizen original command
6
Setting the top of form (TOF) /ESC~B[ASCII] ESC ~ B m n1
n2 [Decimal] 27 7E 66 m n1 n2 [Hexadecimal] 1B 126 42 m n1 n2
[Parameter] m = 1, 3 m = 255: Checking the setting rate [Description]
For setting, only binary data are acceptable. m = 1: Setting the normal form feed
3. Setting the form feed at marker detection
Sets the feed rate for auto feeding. The feed rate for normal operation and marker detection can be set.
Calculation unit for n1, n2 is dot (1 dot=1/8mm). Setting value: “n1+(n2×256)dot”.
The set values are stored in the flash memory and remain effective even after the power is off.
Do not use this command together with other print commands because it writes data into the flash memory.
When setting a feed rate for marker detection, be sure to set a value greater than the mark width (ESC~e).
After data are stored in the flash memory, the printer power is automatically turned OFF. The set values become
effective when the power is turned ON again.
Default value for form feed is set at 95 in normal operation and 194 in black mark detection.
Setting check
Setting can be checked by specifying m=255. ESC ~ 255 0: Prints the setting ESC ~ 255 1: Returns the setting (only when the cable interface is used).
(Print result)
VTOP : 95 VTOP (EYEMARK): 194
(Return result) [Hexadecimal packet]
FB ?? ?? ?? ??
*1 *2 *3
*1: Return start code *2: Form feed setting rate in normal operation (word length) *3: Form feed setting in black mark detection (word length)
* The form feed setting for normal operation is used when auto feed operation is set to enable in the internal
setting of the printer. The form feed setting for marker detection is used when black mark operation is set to enable in the internal setting of the printer. Refer to the section on internal settings of printer.
7

Setting power OFF time/ESC~O

[ASCII] ESC ~ O n [Decimal] 27 126 79 n [Hexadecimal] 1B 7E 4F n
[Parameter] n=0, 1, 3, 5, 10, 15 (the setting is available for binary only)
[Description]
Specifies the auto power OFF time. If no data is received or operated during a set period of time after the last receive of data or the last operation of the FEED button, the printer power will be automatically turned off.
For the setting, 1 to 15 minutes can be set. If you wish to set Power OFF setting as invalid, set the time to 0 minute.
Default setting is the time set as low power time in the internal setting of the printer.
The set values are stored and kept in the flash memory.
Do not use this command together with other print commands because it writes data into the flash memory.
After data are stored in the flash memory, the printer power is automatically turned OFF. The set values
become effective when the power is turned ON again.
Setting value Time
0 Power supply is not turned OFF
1 1 minute
3 3 minutes
5 5 minutes
10 10 minutes
15 15 minutes
The setting value other than above is ignored.
During a print wait state (ie. when unprinted data are remaining in the printer due to an error, etc.), the printer power will
not be automatically turned OFF.
8

Registering the bit map data/ESC~b

[ASCII] ESC ~ b FFh n1 n2 d1 d2 d3 … dn 0 0 [Decimal] 27 126 98 255 n1 n2 d1 d2 d3 … dn 0 0 [Hexadecimal] 1B 7E 62 FF n1 n2 d1 d2 d3 … dn 0 0
[Description]
Stores Windows bitmap data into the flash memory. The structure of bitmap data is the same as that of BMP file data. Refer to Windows-related references for more details about BMP files.
The structure of parameters is as follows.
{n1, n2, d1, d2, d3 … dn} ……… (1)
‘d1, d2 … dn’ is the same as the data structure of BMP files. n1, n2 specify the BMP file size. n1 specifies the remainder of BMP file size divided by 256. n2 specifies the quotient of BMP file size divided by 256. Sends the BMP file data after sending n1, n2.
Several BMP file data can be written at a time into the flash memory by repeating the parameter sequence (1). BMP file data are assigned with a number accordingly in sequence from 0, based on which printing of BMP data is executed. This sequence is completed by specifying 0 in n1 and n2 (no BMP file data).
A registration area up to 64KB (64 × 1024 = 65536 bytes) is available.
BMP file data registered in the flash memory before this command is sent will be all deleted.
Data writing to the flash memory is available only a limited number of times. Avoid registering BMP files on a regular
basis.
Do not use this command together with other print commands because it writes data into the flash memory.
Restriction in BMP file
BMP files support only two-color materials.
It does not support color pallets.
9

Printing the bit map data /ESC~b

[ASCII] ESC ~ b n [Decimal] 27 126 98 n [Hexadecimal] 1B 7E 62 n
[Parameter] 0 ≤ n ≤ 254 (the setting is available for binary only)
[Description]
Prints out BMP file data registered in the flash memory.
Specify the number of the BMP data to be printed in the parameter ‘n’.
When an unregistered number is specified, the command will be ignored.
BMP images are printed in a printable area. When an image lies across right side areas, the image will not
be fully printed.
10

Setting in PAGE MODE/ESC~L

[ASCII] ESC ~ L n1 n2 d1 d2 d3 [Decimal] 27 126 76 n1 n2 d1 d2 d3 [Hexadecimal] 1B 7E 4C n1 n2 d1 d2 d3
[Parameter] (Parameter is available for binary only) n1: Specify 1 for line printing mode (normal mode). Specify 3 for page printing mode or line print page-length setting
mode. n2: Specify 0. d1: Specify 0 for portrait line printing mode (normal mode). Specify 1 for landscape page printing mode. Specify 2 for
portrait page printing mode. Page length can be set with d2 and d3 parameters after specifying 3 (specifying n1 = 3) to
call up line printing mode. d2, d3: Specify this parameter for switching to page printing mode or when 3 is specified in d1. Specify print width (actual
paper length) in dots. One dot is 1/203 inch. Divide the value by 256, and specify the remainder in d2 and the quotation in d3. Up to 2374 dots can be specified. When d1 = 3, up to 4466 dots can be specified.
[Description]
Portrait line printing mode (normal print mode - The printer is in this mode at power-ON.)
Data are printed horizontally with the paper feed direction pointing upwards. A Feed command actually feeds a paper. Upon receiving of a Terminate command (such as CR, LF), the printer starts printing immediately.
Landscape page printing mode Data are printed vertically with the paper feed direction pointing upwards. A Feed command does not actually feed a paper, but moves the printing position horizontally. Actual printing starts when page feed (FF, ESC FF) is selected. The page format is maintained even after form feed.
Portrait page printing mode Data are printed horizontally with the paper feed direction pointing upwards. A Feed command does not actually feed a paper, but moves the printing position vertically. Actual printing starts when page feed (FF, ESC FF) is selected. The page format is maintained even after form feed.
Specifying the page length in line printing mode Page length can be specified with line printing mode. Normally page length is specified with ESC C command in ESC/P mode. With this command, however, page length can be set in dots.
When page printing mode is specified, previous line print data that remain unprinted will be all printed. On the other hand, when line printing mode is specified, previous page print data that remain unprinted will be all deleted.
We recommend initializing the printer with ESC @ when switching to page printing mode or line printing mode.
<Restriction in page printing mode> The maximum logical paper length is 384 dots in landscape page printing mode. Maximum printing width is 8 inches (1624 dots/203 dpi).
The maximum logical paper length in portrait page printing mode is the value specified in d2 and d3
parameters. Printing width is 384 dots.
11
r
Logical pape
length: 1624
dots max
Print width: 384 dots
Print width:
1624 dots max
Logical paper length: 384 dots
The CE-PR emulation has FF n instruction, however, the page feed operation is definitely implemented
regardless of n parameter in page print mode.
In the page mode, the vertical reversing print (ESC T) of CE-PR emulation cannot be used.
At power-ON, page printing mode is canceled and the printer is switched to line printing mode.
Printing density cannot be set by line in page printing mode. Sets the printing density for the entire page.
In page mode, decoded data and the page format are maintained until a Form Feed command (FF, ESC FF)
is received. However, if page printing mode setting is executed again before a form feed, all previous data will be lost.
ESC @ Initialize command clears data decoded internally on the memory. Page printing mode itself cannot be initialized.
In page printing mode, barcodes that lie across logical papers lengths are not printed.
12
In page printing mode, when a print data is specified at a position that exceeds a logical paper length, the data is decoded after automatic form feed.
In page printing mode, when ANK double-height character printing (ESC w) is executed at the head of a page, the double height characters cannot be fully printed, with their top area missed. In such a case, leave a one-line space before printing double height characters.
To return from page printing mode to line printing mode, turn off the power and then turn it on again, or specify line printing mode separately.
<Restriction on page length in line printing mode>
Page length can be specified up to 22 inch (22×203=4466 dots)
<Setting the Line Printing Mode>
Default is line printing mode. The following shows an example of program (BASIC) for switching from page printing
mode to line printing mode.
LPRINT CHR$(&H1B); “~L”; CHR$(1); CHR$(0); CHR$(0);
Line printing: dl = 0
Fixed at 0
Line printing mode: n1 = 1
<Setting the Page Printing Mode>
The following shows a program for setting paper length to 8 inches in landscape mode.
LPRINT CHR$(&H1B); “~L”; CHR$(3); CHR$(0); CHR$(1); CHR$(88); CHR$(6);
Landscape printing: dl = 1
Fixed at 0
Page printing mode: n1 = 3
Next, convert the paper length to be set into dots.
In this case, the paper length is set to 8 inches. Therefore:
8 inches × 203 dpi = 1624 dots
Next, obtain parameters d2 and d3 from the number of dots.
Divide 1624 dots, the number of dots of paper length, by 256.
1624 / 256 = 6 …… 88
Specify 88, the remainder of 1624 dots divided by 256, in d2.
Specify 6, the quotient of 1624 dots divided by 256, in d3.
13

Page feed (only for PAGE MODE marker detection) /ESC FF

[ASCII] ESC FF [Decimal] 27 12 [Hexadecimal] 1B OC
[Description]
Executes page feed while in page printing mode.
The difference with FF page feed in ESC/P Emulation command is that, in ESC FF, form feed will not be
executed when print data is unavailable in the printer.
When the black mark operation is set to enable, this command starts marker detection along with page feed.
14

Setting printing paper/FS H

[ASCII] FS H n [Decimal] 28 72 n [Hexadecimal] 1C 48 n
[Parameter] n=1, 2, 3 or “1”, “2”, “3”
[Description] Switches the paper type.
n = 1: Regular paper (the setting value at power-on) n = 2: 2 sheets of carbon paper
Printing paper can be set by line unit.
Setting besides the parameter range will be ignored.
The initial value (regular paper, 2 sheets of carbon paper) at power-on (default) represents the paper that is
set as the print paper type in the internal setting of the printer.
Setting values in the paper setting return to default when an Initialize command is executed or printing mode is changed.
15

Setting print density/ FS I

[ASCII] FS I n [Decimal] 28 73 n [Hexadecimal] 1C 49 n
[Parameter] n = 0, 1, 2, 3, 4 or “1”, “2”, “3”, “4”
[Description]
Specifying the printing density.
n=30h -2 (light) n=31h -1 n=32h 0 (Normal) n=33h +1 n=34h +2 (dark)
Settings other than the above will be ignored.
Can be set by line unit (except in page printing mode).
The initial value at power-on (default) is the value that is set as print density in the internal setting of the printer.
Print density setting values return to default when an Initialize command is executed or print mode is changed.
16

Printer operating status report command / FS G

[ASCII] FS G [Decimal] 28 71 [Hexadecimal] 1C 47
[Description]
When using the command, set the printer operating status return control to enable in the internal setting of the printer.
This command prints the printer operation status.
Data to be returned are 2 bytes and are FBh + content (30h to 3Fh).
Settings
Paper-in 0
Paper-out 1 9
Battery normal 0
Battery needs recharging 1
printer head temperature
normal
printer head temperature
abnormal
Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
0 0 1 1
0
O
1
Printing cannot be continued when printer head temperature becomes abnormal. Stop printing and leave the printer for a while, or turn off the power and turn it on again after a while.
When the data in the receiving buffer becomes full, communication will be temporarily halted. In case of an error such as paper-out, no printing will be executed. Therefore, the receiving buffer of the printer becomes full in a short time, which may lead to a temporary communication halt. In such case, the printer may not be able to receive this command from the host and the return function may not work properly.
When using this command, do not send the command and print data at the same time. Whenever possible, execute each command separately.
*
In PD22 since received data in the buffer will not be processed under offline status such as paper out, the printer monitors and returns the printer operating status report command at data receive level. Therefore, when the printer status return control is set to enable in the internal setting of the printer, and if data, such as a bit image, contains a character sequence which is the same as the printer operating status report command, the printer may identify the data as this command and return the data. Since character sequences identified as the printer operating status report command are directly sent to the receive data analysis part, these data will not be lost.
During infrared communication, printer status is returned within the infrared connection at the time of receive of the printer operating status report command. When the connection with the other station is disconnected, printer status return data will be cleared.
17

Printing the compressed bit image/ ESC~G

[ASCII] ESC ~ G data [Decimal] 27 126 71 data [Hexadecimal] 1B 7E 47 data
[Data format] There are following 4 types of data.
String image data
Repeat image data
EOL (End Of Line)
EOD (End Of Data)
(1) String image data
String image data prints the desired bit map data.
Format: c, d1, d2, d3, d4 … dn
‘c’ indicates data length and that the data in the following format is string data. Specify an image data with subsequent ‘dn’. Data length can be specified from 1 to 127.
  7 6 5 4 3 2 1 0
C
Data length
O: String image
‘dn’ is 1-byte bitmap data and specifies a bitmap image in the raster direction.
□ □ □ □ □ □ □ □
Left← →Right
An example is shown below.
Data
05h 12h 34h 56h 78h 9Ah
Print result □□□■□□■□□□■■□■□□□■□■□■■□□■■■■□□□■□□■■□■□
dn 7 6 5 4 3 2 1 0
18
(2) Repeat image data
Repeat image data repeats printing of the same bitmap data on a 1-byte basis.
Format c d
‘c’ indicates that the data in the following data format is repeat data and specifies the number of repetition of the data. Specify an image data with the following ‘d’ value.
7 6 5 4 3 2 1 0
 Number of repetition
1: Repeat image
The number of repetition can be specified from 1 to 127. ‘d’ is 1-byte bitmap data and specifies a bitmap image in the raster direction.
□ □ □ □ □ □ □ □
Left← →Right
An example is shown below. Data
Print result □□□■□□■□□□□■□□■□□□□■□□■□□□□■□□■□□□□■□□■□ 1 2 1 2 1 2 1 2 1 2
(3) EOL
EOL terminates a 1-dot sequence and executes printing and feeding of the 1-dot sequence. Data are 00h.
(4) EOD
EOD terminates printing of a compressed bit image. Data are 80h.
Compressed bit image sample program (BASIC) A sample of printing program is shown below.
WIDTH LPRINT 255 W = 48
85h 12h
dn 7 6 5 4 3 2 1 0
19
LPRINT CHR$(27); "~G"; LPRINT CHR$(&H80 + W); CHR$(&HFF); CHR$(0); ' FOR L = 1 TO 100 LPRINT CHR$(1); CHR$(&H80); LPRINT CHR$(W - 2 + &H80); CHR$(0); LPRINT CHR$(1); CHR$(&H1); LPRINT CHR$(0); 'EOL NEXT L ' LPRINT CHR$(&H80 + W); CHR$(&HFF); CHR$(0); LPRINT CHR$(&H80); 'EOD END
20

Specifying the coordinate of printing position/ESC~X

[ASCII] ESC ~ X y1 y2 x1 x2 [Decimal] 27 126 88 y1 y2 x1 x2 [Hexadecimal] 1B 7E 58 y1 y2 x1 x2
[Parameter] Specifies the y1, y2Y coordinates. Specifies in y1 the remainder of Y-coordinate value divided by 256. Specifies in y2 the quotient of Y-coordinate value divided by 256.
Specifies the x1, x2X coordinates. Specifies in x1 the remainder of X-coordinate value divided by 256. Specifies in x2 the quotient of X-coordinate value divided by 256.
[Description]
Specifies the printing position with X, Y coordinates in landscape printing and portrait page printing mode.
Unit for coordinate is 1/203.
Cannot be used in normal printing mode (portrait line printing)
With ESC~X, printing data can be overlapped.
Position exceeding the right-left margin cannot be specified.
Y
X
X
Y
21

Setting the printing position of barcode character/GS H

[ASCII] GS H n [Decimal] 29 72 n [Hexadecimal] 1 48 n
[Parameter] n = 0, 1, 2, 3 or “0”, “1”, “2”, “3”
[Description]
Selects the printing position of barcode character when printing the barcode
“n” means as follows:
n printing position
0, 30h Cannot print
1, 31h Upper area of barcode
2, 32h Lower area of barcode
3, 33h Upper and lower area of barcode
The initial value is n=0
Changing the font size will not change the size of barcode character
Returns to default value with initializing command.

Setting/Cancelling the turning of barcode/GS r

[ASCII] GS r n [Decimal] 29 114 n [Hexadecimal] 1D 72 n
[Parameter] n = 0, 1
[Description]
When n = 0, barcodes are positioned horizontally. When n = 1, barcodes are positioned vertically.
Default at power-ON is n = 0.
When vertical positioning of barcodes is specified, barcode symbols turn around 90 degrees counterclockwise.
Returns to default value with initializing command.
22

Setting the height of barcode/GS h

[ASCII] GS h n [Decimal] 29 104 n [Hexadecimal] 1D 68 n
[Parameter] 1 ≤ n ≤ FFh
[Description]
Selects the height of barcode.
“n” indicates the number of dots in vertical direction.
The initial value is n=A2h (162 dots)
Returns to default value with initializing command.

Setting the width of barcode/ GS w

[ASCII] GS w n [Decimal] 29 119 n [Hexadecimal] 1D 77 n
[Parameter] n = 2, 3, 4
[Description]
Selects the width of barcode
“n” indicates the number of dots for narrow barcode in horizontal direction.
The initial value is n=3
Returns to default value with initializing command.
23

Selecting the type of l barcode/ GS k

[ASCII] GS k n Dn NUL [Decimal] 29 107 n Dn NUL [Hexadecimal] 1D 6B n Dn NUL
[Parameter] 1 ≤ n ≤ FFh
[Description]
Code: [1D] h + [6B] h + n + Ds + [00] h ..........1
0 ≤ n ≤ 6
Code: [1D] h + [6B] h + n + s + Ds
41h ≤ n ≤ 49h Selects a barcode system and prints out the barcode.
The beginning of line becomes the next print start position.
“n” means as follows:
In case of 1:
n Barcode system Definition area of s Definition area of D
0 UPC - A Bh ≤ s ≤ Ch 30h ≤ D ≤ 39h
1 UPC – E Bh s Ch 30h D 39h
2 JAN13 (EAN13) Ch ≤ s ≤ Dh 30h ≤ D 39h
3 JAN8 (EAN8) 7h ≤ s ≤ 8h 30h ≤ D ≤ 39h
4 CODE39 1 ≤ s
5 ITF
6 CODEBAR 1 ≤ s
This command is terminated by a NULL code. For UPC-A and UPC-E, upon input of 12-byte barcode data, the barcode is printed out and subsequent data are processed as normal data.
For JAN13, upon input of 13-byte barcode, the barcode is printed out and subsequent data are processed as normal data. For JAN8, upon input of 8-byte barcode, the barcode is printed out and subsequent data are processed as normal data. Be sure that the number of data of ITF barcode is always an even number. When the number of data is an odd number, the last data will be ignored.
...........................2
1 s (even
number)
30h D 39h, 41h D 5Ah, 20h
24h, 25h, 2Bh, 2Dh, 2Eh, 2Fh
30h D 39h
30h D 39h, 41h D 44h, 24h
2Bh, 2Dh, 2Eh, 2Fh, 3Ah
24
In case of 2:
n
Barcode system Definition area of s Definition area of D
41h UPC - A Bh s Ch 30h D 39h
42h
43h
44h
45h CODE39
46h ITF
47h CODEBAR
48h CODE93 1 s ≤ FFH
49h CODE128 2 s ≤ FFh 0h D ≤ 7Fh
UPC - C Bh
JAN13 (EAN13) Ch
JAN8 (EAN8) 7h
s Ch 30h D 39h
s Dh 30h D 39h
s 8h
1
s FFH 30h D 39h
1
s FFH (even
number)
1
s FFH
30h D ≤ 39h, 41h D 5Ah, 24h
25h, 2Bh, 2Dh, 2Eh, 2Fh
30h
D 39h
30h D ≤ 39h, 41h D 44h, 24h
2Bh, 2Dh, 2Eh, 2Fh, 3Ah
0h
D 7Fh
‘s’ indicates the number of data and processes ‘s’ bytes from the next data as barcode data.
If ‘s’ is beyond the definition area, the command processing will be canceled and subsequent data will be processed as
normal data.
If ‘D’ is beyond the definition area, only paper feed will be executed and subsequent data will be processed as normal data.
If a character code ‘Dn’ is an unprintable character, subsequent data will be treated as normal characters.
<Caution>
The command is ignored when data exist in the printer buffer.
If the width of a barcode is beyond the printing area of the line, the barcode will not be printed and only paper feed will
be executed. Regardless of the line-feed rate set in ESC 3, ESC 2, etc., paper feed will be executed for the barcode height (including characters when barcode characters are specified).
After the printing of barcode, beginning of line becomes the next print start position.
Barcode characters are not affected by emphasized printing, overlapped printing, underline, character size,
character decoration, etc.
In page printing mode, barcodes positioned across logical paper lengths are not printed.
* CODE-128 supplementary explanation
The head of barcode data must be a code set select character (one of CODE-A, CODE-B, or CODE-C). Select the first code set from them.
Specify special characters with ‘{’ and the subsequent 1 character, 2 characters in total. Specify the ASCII character ‘{’ itself by sending ‘{’ twice consecutively.
(Special character) (Send data)
<ASCII> [Hexadecimal] [Decimal]
SHIFT {S 7B,53 123,83
CODE A {A 7B,41 123,65
CODE B {B 7B,42 123,66
25
CODE C {C 7B,43 123,67
FNC1 {1 7B,31 123,49 FNC2 {2 7B,32 123,50 FNC3 {3 7B,33 123,51 FNC4 {4 7B,34 123,52
{ {{ 7B,7B 123,123
Refer to barcode-related books, etc. for the code set character structure of CODE-A, CODE-B, and CODE­C.
As an example, a case for printing 10-digit data in CODE 128 is shown.
When CODE A is specified and the barcode data is 1234567890, to send data to the printer:
[1D] [6B] [49] ---------- GS k n [0C] ---------- s [7B] [41] ---------- CODE A [31] [32] [33] [34] [35] ---------- '12345' [36] [37] [38] [39] [40] ---------- '67890' [0D] [0A] ---------- CR LF
In this case, the parameter ‘s’ (data length) consists of 2 bytes indicating CODE A and 10 bytes indicating the data ‘1234567890’, 12 bytes in total.
26

Selecting printing mode/ ESC~U

[ASCII] ESC ~ U n [Decimal] 27 126 85 n [Hexadecimal] 1B 7E 55 n
[Parameter] n=0, 1, 2 or “0”, “1”, “2”
[Description] Selects the printing mode depending on the value of “n”.
n = 0: 2-step feed mode
1: 1-step feed mode 2: Phase lock mode
In 1- and 2-step feed modes, data are printed while the motor is in motion. The printing speed increases in order of (phase lock) <(1-step feed) < (2-step feed).
In phase lock mode, data are printed with the motor fixed. Print quality is higher than that in 1- and 2-step feed mode.
For barcode printing and bitmap image printing, data are printed forcibly in phase lock mode.
The printer is in phase lock mode at power-on.
27

Printer power OFF/ ESC~p

[ASCII] ESC ~ p [Decimal] 27 126 112 [Hexadecimal] 1B 7E 70
[Parameter] None
[Description]
Turns OFF the power of the printer.
When already edited but not printed image data exist, the data are printed and then the power is turned OFF.
[Caution]
After turning the power OFF, infrared communication with the host and Bluetooth communication will be terminated.
28

Selecting the code page/ ESC~P

[ASCII] ESC ~ P n [Decimal] 27 7E 80 n [Hexadecimal] 1B 7E 50 n
[Parameter] 0 ≤ n ≤ 255
[Description]
Selects the code page.
n = 0: PC437 (U.S.A.) 1: PC850 (MULTILINGUAL) 2: PC860 (PORTUGAL) 3: PC863 (FRENCH - CANADA) 4: PC865 (NORWAY) 5: SCANDINAVIA 6: YUASCII 7: PC852 (LATIN 2) 8: PC855 (CYRILLIC) 9: PC866 (RUSSIAN) 10: HUNGARIAN 11: KAMENICKY 12: TURKEY 13: PC861 (ICELANDIC) 14: WELSH 15: MAZOVIA 16: UKRAINIAN 40: NEW HEBREW 41: OLD HEBREW 42: DEC HEBREW 50: 437 GREEK 51: GREEK 851 52: GREEK ABC 53: GREEK ELOT 928 54: CYPRUS 55: MALTA 60: ARABIC NLS 61: ARABIC EXT 62: UNISYS CODEPAGE 100: BRAZIL ABICOMP 101: BRAZIL ASCII 108: LATIN 1 109: PC858 110: ISO LATIN 9
29

Selecting Windows character/ ESC~s

[ASCII] ESC ~ s n [Decimal] 27 7E 115 n [Hexadecimal] 1B 7E 73 n
[Parameter] 0 ≤ n ≤ 255
[Description]
Selects the Windows 3.1 character set n = 0: US ANSI 1: CYRILLIC ANSI 2: EASTERN EUROPE ANSI
30
Loading...
+ 70 hidden pages