Citizen CMP-10 User Manual

Command Reference
MOBILE LINE THERMAL PRINTER
MODEL
Rev. 3.10 Revised on Dec 13, 2006
CMP-10
REVISION
Rev. No. Date Comment
Rev. 1.00 2002/11/15 Newly issued
Rev. 1.01 2002/12/18 Revised P. 1, P. 2, P. 47, P. 54, P. 56, P. 59
Rev. 2.00 2003/06/30 Added ESC >, ESC l, FF (Firmware Ver. 1.95)
Rev. 3.00 2006/07/13 Added baud rate 38400 at page of ESC S n and 5.1 (2)
Rev. 3.01 2006/08/31 Revised range of CODE128 on Page56
Rev. 3.10 2006/12/13 Added new Chapter 4. Deleted [Remarks] on page 63.
Revised GS ) Added Chapter 5 to Chapter 10
Added GS z
1. CMP-10 COMMAND SET
Code Command Function Page
1 BEL Sounds the Buzzer 4 2HT Horizontal Tab Command 5 3LF Printing and Paper Feed Command 6 4CRPrint one line Command 7 5ESC RS Sounds the Buzzer 7 6 ESC SP Setting the right space amount of the
character 8 7 ESC ! Collective Specifying Printing Mode 9 8 ESC $ Specifying the Absolute Positions 11 9 ESC % Specifying/Canceling Download Character Set 12
10 ESC & Define user characters 13 11 ESC * Specifying the Bit Image Mode 14 12 ESC + Switch OFF the printer 17 13 ESC – Specifying/ Canceling Underline 17 14 ESC . Printer self test 18 15 ESC 2 Specifying 1/6-inch line feed rate 18 16 ESC 3 Setting line feed rate of minimum pitch 19 17 ESC = Data Input Control 20 18 ESC > Saving current setting 21 19 ESC ? Reading magnetic stripe reader 22 20 ESC @ Initializing the Printer 23 21 ESC D Setting Horizontal Tab Position 24 22 ESC E Specifying/canceling highlighting 25 23 ESC G Specifying/canceling Double Printing 26 24 ESC J Printing and feeding paper n/203 inch 27 25 ESC R Selecting Code table 27 26 ESC S Setting serial interface communication speed 28 27 ESC T Printing Diagnostic information 28 28 ESC V Specifying/Canceling 90°-right- turned
Characters 29
29 ESC Y Specifying print density 30 30 ESC Z Returning diagnostic information 31 31 ESC \ Specifying the relative positions 34 32 ESC _ Setting the printer in default state 34 33 ESC ` Returning the battery voltage and Printer
Head temperature 35
34 ESC a Aligning the characters 36 35 ESC c5 Enabling/Disabling Panel Switches 37 36 ESC d Printing and Feeding the paper by n lines 38 37 ESC v Transmitting the printer status 39 38 ESC x Selecting the time interval for automatically
switching Off the printer 40
39 ESC { Specifying/Canceling the Inverted Characters 41 40 GS ) Setting of printer flags 42 41 GS * Defining the Download Bit Image (LOGO) 43 42 GS / Printing the Download, Bit Image 44 43 GS : Starting/Ending Macro Definition 45
*
*
* *
*
* *
* *
* *
* *
*
* *
— 1 —
Code Command Function Page
44 GS H Selecting of Printing Position of HRI Code 46 45 GS L Setting the left margin 47 46 GS W Setting the print area width 48 47 GS ^ Executing the Macro 50 48 GS a Enabling/Disabling
ASB (Automatic Status Back) 51
49 GS f Selecting the font of HRI characters 54 50 GS h Selecting the height of the Bar Code 55 51 GS k Printing the bar code 56 52 GS w Selecting the horizontal size (Scale factor) of the Bar Code 61 53 GS z Saving AT command sequences to send to Bluetooth module 62 54 ESC l Specify/canceling black mark function 64 55 FF Printing and paper feeding to the black mark position 64
* indicates a unique command or a non-compatible command.
* *
— 2 —
2. COMMAND DETAILS
2.1 Description of Items
XXXX ALL
[Function] Command Function
[Code] A sequence of code constituting a command is represented in hexadecimal number
for < >H, binary number for < >B, and decimal number for < >, respectively; [ ]k represents a repeat count of k-times.
[Range] Indicates an argument value (setting range) for the command in hexadecimal number
(partly in decimal number). * When used for application other than defined in each control, an error may occur.
Always use in the defined range.
[Outline] Describes a command outline.
[Caution] Describes a caution as required.
[Default] Describes an initial value in hexadecimal number for the command when accompanied
by an argument.
[See Also] Describes the associated commands for use.
[Sample Program] Describes a coding example in the Q-BASIC sample program.
* This example is only for your reference and differs depending on the language used, version, and so on. For details, see the manual for the language used.
— 3 —
BEL
[Function] Sounds the Buzzer
[Code] <07>H
[Outline] By executing this command the buzzer will beep.
This command functions in the same manner as ESC RS.
— 4 —
HT
[Function] Horizontal Tab Command
[Code] <09>H
[Outline] Shifts the printing position to the next horizontal tab position.
•Ignored when the next horizontal tab position has not been set.
[Caution] • The horizontal tab position is set by ESC D.
•Initial setting of the horizontal tab position is each 8 characters in 9th, 17th, 25th, columns from FONT A.
[See Also] ESC D
[Sample Program]
PRINT #1, “0123456789012345678901”; PRINT #1, CHR$ (&HA); PRINT #1, CHR$ (&H9) + “AAA”; PRINT #1, CHR$ (&H9) + “BBB”; PRINT #1, CHR$ (&HA); PRINT #1, CHR$ (&H1B) + “D”; PRINT #1, CHR$ (3) + CHR$ (7) + CHR$ (14) + CHR$ (0); PRINT #1, CHR$ (&H9) + “AAA”; PRINT #1, CHR$ (&H9) + “BBB”; PRINT #1, CHR$ (&H9) + “CCC” + CHR$ (&HA);
[Print Results]
123456789012345678901
AAA BBB
AAA BBB CCC
← Initially set horizontal tab ← When set to the 4th, 8th, and 15th digits
— 5 —
LF
[Function] Printing and Paper Feed Command
[Code] <0A>H
[Outline] Prints data inside the input buffer and feeds lines based on the line feed amount
having been set.
• The head of the line becomes the next print starting position.
[See Also] ESC 2, ESC 3
[Sample Program]
PRINT #1, “AAA” + CHR$ (&HA); PRINT #1, “BBB” + CHR$ (&HA); PRINT #1, CHR$ (&HA); PRINT #1, “CCC” + CHR$ (&HA);
[Print Results]
AAA ← Print and line feed BBB ← Print and line feed
← Line feed only
CCC ← Print and line feed
— 6 —
CR
[Function] Print one line Command
[Code ] <0D>H
[Outline] This command is ignored or its action is the same as LF depending on the last
execution of GS ) 2 command (FLAG SETTING COMMAND). If Flag 2 is 0, carriage return (CR) command is ignored. If Flag 2 is 1, CR comamnd will act as LF command.
[Default] CR command is ignored. If you want that it acts like LF command set flag 2 to 1 by
GS ) command.
[See Also] GS )
ESC RS
[Function] Sounds the Buzzer
[Code] <1B>H<1E>H
[Outline] By executing this command the buzzer will beep.
This command functions in the same manner as BEL.
— 7 —
ESC SP n
[Function] Setting the right space amount of the character
[Code] <1B>H<20>H<n>
[Range] {0 =< n =< 20(Hex)}
[Outline] The rightward space amount is set in dot unit (1/203 inch unit).
[Caution] The rightward space amount in doublewide mode is made double of the set volume.
[Default] n = 0
[Sample Program]
PRINT #1, CHR$ (&H1B) + “ “ + CHR$ (0); PRINT #1, “AAAAA” + CHR$ (&HA); PRINT #1, CHR$ (&H1B) + “ “ + CHR$ (1); PRINT #1, “AAAAA” + CHR$ (&HA); PRINT #1, CHR$ (&H1B) + “ “ + CHR$ (12); PRINT #1, “AAAAA” + CHR$ (&HA);
[Print Results]
AAAAA ← 0-dot space A A A A A ← 1-dot space A A A A A ← 12-dot space
— 8 —
ESC ! n
[Function] Collective Specifying Printing Mode
[Code] <1B>H<21>H<n>
[Range] {0 =< n =< FF(Hex)}
[Outline] Printing mode is assigned.
Bit Function
0 Character Font Font A Font B 1 Undefined 2 Undefined 3 High-lighting Canceled Specified 4 Double height Canceled Specified 5 Double width Canceled Specified 6 Undefined 7 Underline Canceled Specified
Each n bit indicates the following:
[Caution] •With double height and double width being specified simultaneously, double wide
and double high characters are consisted.
• An underline is attached to the full character width, which, however, is not attached to the part having been skipped by the horizontal tab.
Neither is it attached to 90°-right-turned characters.
• The underline width is as having been specified by <ESC ->. (The default setting is 1 dot width.)
•n case that double wide character and normal character exist in same one line, the layout of underline is consistent one.
Value
01
[Default] n = 0
[See Also] ESC E, ESC –
— 9 —
[Sample Program]
[Print Results]
PRINT #1, CHR$(&H1B) + “!” + CHR$(&H00) + “H” ; PRINT #1, CHR$(&H1B) + “!” + CHR$(&H01) + “H” ; PRINT #1, CHR$(&H1B) + “!” + CHR$(&H08) + “H” ; PRINT #1, CHR$(&H1B) + “!” + CHR$(&H10) + “H” ; PRINT #1, CHR$(&H1B) + “!” + CHR$(&H20) + “H” ; PRINT #1, CHR$(&H1B) + “!” + CHR$(&HB9) + “H” ; PRINT #1, CHR$(&HA) ; END
Font A Font B Font A + Emphasis
>
>
>
>
>
>
>
Font B + Emphasis + Quadruple + Underline Font + Underline
Font A + Double Width Font A + Double Height
— 10 —
ESC $ n1 n2
[Function] Specifying the Absolute Positions
[Code] <1B>H<24>H<n1><n2>
[Range] {0 =< n1 =< FF(Hex)}
{0 =< n2 =< 1(Hex)}
[Outline] The printing start position is specified in the number of dots (1/203 inch unit) from
the beginning of line.
• The number of dots is divided by 256, whose quotient is taken as n2 and the residual as n1.
• Therefore, the printing start position is equal to n1 + n2 × 256 from the beginning of line.
[Caution] Specifying beyond the line end is ignored.
[Default] The initial value is not specified.
[See Also] ESC \
[Sample Program]
[Print Results]
PRINT #1, CHR$ (&H1B) + “$”; PRINT #1, CHR$ (0) + CHR$ (0) + “A”; PRINT #1, CHR$ (&H1B) + “$”; PRINT #1, CHR$ (50) + CHR$ (0) + “B”; PRINT #1, CHR$ (&H1B) + “$”; PRINT #1, CHR$ (0) + CHR$ (1) + “C”; PRINT #1, CHR$ (&HA); PRINT #1, CHR$ (&H1B) + “$”; PRINT #1, CHR$ (100) + CHR$ (0) + “A”; PRINT #1, CHR$ (&H1B) + “\”; PRINT #1, CHR$ (&HC2) + CHR$ (&HFF) + “B”; PRINT #1, CHR$ (&HA);
050100 256
>
>
A B C
B A
>
>
>
>
— 11 —
ESC % n
[Function] Specifying/Canceling Download Character Set
[Code] <1B>H<25>H<n>
[Range] {0 =< n =< FF(Hex)}
[Outline] Specifying/canceling download characters.
Further, only the lowest bit (n0) is valid for n.
n (Hex) Function
0 Selecting download character set 1 Canceling download character set
[Caution] This setting cannot be restored to initial value even with Initialize command or by
turning power OFF. It can be restored to the initial value by ESC _, a command for returning to initial state.
[Default] n = 0
[See Also] ESC &
— 12 —
ESC & m n1 n2 [d] k
[Function] Define user characters
[Code] <1B>H<26>H<m><n1><n2>[<d>]k
[Range] {m = 0, 1, 2, 3(Hex)}
{20 =< n1 =< FF(Hex)} {n1 =< n2 =< FF(Hex)} {k=(n2-n1+1)*48} (m=2) {k=(n2-n1+1)*16} (m=3)
[Outline] Defines a group of user characters.
m=0: Copy internal character set A to user character set A
(Parameters n1, n2 and d are omitted)
m=1: Copy internal character set B to user character set B
(Parameters n1, n2 and d are omitted)
m=2: For Font A (12 × 24), n1 denotes Start character code and n2 End character
code. Every character is 48 bytes, two bytes for each line. Only the first nibble of the second byte is used.
m=3: Define character group with ASCII codes between >= n1 and =< n2 for character
set B (9 × 16). Every character is 16 bytes.
[Caution] The data for character set A is composed from left to right and from top to bottom
with two bytes for each horizontal line. The first byte contains the first 8 bits with the left most bit is MSB. From the second byte only the first nibble (the most significant 4 bits) is valid.
The data for character set B is composed from left to right and from top to bottom with only one byte for each horizontal line. The nineth bith is alawys 0.
Downloaded characters are valid even after switching off the printer or after issuing Initialize command.
Download character
Font A (12 × 24) (Last 4 bits are not used and fixed as zero.)
d1 d2 d1 d3 d4 d2 d5 d6 d3 d7 d8 d4 d9 d10 d5
24
Font B (9 × 16) (9th dot is fixed as space.)
16
d14 d15 d16
d43 d45 d46 d47 d48
MSB LSB
d44
87654321
— 13 —
00
8 7654321
00
ESC * m n1 n2 [d] k
[Function] Specifying the Bit Image Mode
[Code] <1B>H<2A>H<m><n1><n2> [d] k
[Range] {m= 0, 1, 20, 21(Hex)}
{0 =< n1 =< FF(Hex)} {0 =< n2 =< 1(Hex)} {0 =< d =< FF(Hex)} {k = n1 + FF(Hex) x n2} (m=0, 1(Hex)) Number of bytes containing image data {k = (n1 + FF(Hex) x n2) x 3} (m=20, 21(Hex)) Number of bytes containing image data
[Outline] According to the number of dots specified in n1, n2, specify the bit image of mode m.
• The No. of dots printed is divided by 256, whose quotient is taken as n2 and residual as n1.
•Bit image data is sent starting from the top to bootom and from the left to right (vertical columns scanning). In modes m=0, and 1 only one byteper column is sent and in mode m-20h, 21h 3 bytes for each column are sent.
•d is bit image data, the bits subject to printing are taken as “1” and those not as “0”.
• The bit image modes specified by m are shown as follows:
Modem (Hex)
0 8-dot single density 8 67 DPI 101 DPI 192
1 8-dot double density 8 67 DPI 203 DPI 384 20 24-dot single density 24 203 DPI 101 DPI 192 21 24-dot double density 24 203 DPI 203 DPI 384
[Caution] • When the values set in m (bit image mode) are out of the above range, the data
following after n1 is processed as normal printing data.
•After completion of bit image printing, printer returns to normal data processing mode.
• Line space is automatically set to 0.
Vertical Direction Horizontal Direction
Dots
Dot Density Dot Density
Max. Dots
— 14 —
[Sample Program]
[Print Results]
PRINT #1, CHR$(&H1B) + “ * ”; PRINT #1, CHR$(0) + CHR$(20) + CHR$(0); IMG1: GOSUB IMG1 PRINT #1, CHR$(&HFF); PRINT #1, CHR$(&HA); FOR I=1 TO 18 PRINT #1, CHR$(&H1B + “ * ”; PRINT #1, CHR$(&H85); PRINT #1, CHR$(1) + CHR$(20) + CHR$(0); NEXT I GOSUB IMG1 PRINT #1, CHR$(&HFF); PRINT #1, CHR$(&HA); RETURN PRINT #1, CHR$(&H1B) + “ * ”; IMG2: PRINT #1, CHR$(32) + CHR$(20) + CHR$(0); PRINT #1, CHR$(&HFF); GOSUB IMG2 PRINT #1, CHR$(&HFF); PRINT #1, CHR$(&HA); PRINT #1, CHR$(&HFF); PRINT #1, CHR$(&H1B) + “ * ”; FOR I=1 TO 18 PRINT #1, CHR$(33) + CHR$(20) + CHR$(0); PRINT #1, CHR$(&H80); GOSUB IMG2 PRINT #1, CHR$(&H00); PRINT #1, CHR$(&HA); PRINT #1, CHR$(&H05); END NEXT I
PRINT #1, CHR$(&HFF); PRINT #1, CHR$(&HFF); PRINT #1, CHR$(&HFF); RETURN
← 8-dot single density ← 8-dot double density
← 24-dot single density
← 24-dot double density
— 15 —
This command has one more version.
[Function] Specifying the Bit Image Mode (PCX format)
[Code] <1B>H<2A>H<m><n>{<a><00>H} [d]k
[Range] {m= 10, 11 or 12(Hex)}
{0 =< n =< 30(Hex)} {0 =< a =< 18(Hex)} {0 =< d =< FF(Hex)} {0 =< k =< n x 18(Hex)}
[Outline] Designates a bit image of n*8 dots horizontal by 24 or a dots vertical.
Dot density is fixed at 203 dpi both horizontally and vertically. Bit image mode selected by the value of m is shown in the following table.
m (Hex) Type
10 Non-compressed data of 24 dots vertical
(Argument “a” and 00(Hex) are not used.)
11 Compressed data of 24 dots vertical
(Argument “a” and 00(Hex) are not used.)
12 Compressed data of a dots vertical
n denotes the number of bytes for horizontal size of a bit image. d denotes a graphic data. In 10(Hex) mode, data is in n × 24 bytes. For data in 11(Hex) mode, the size in non-compressed format shall be n × 24 bytes. For data in 12(Hex) mode, the size in non-compressed format shall be n × a bytes. Compression system in 11(Hex) and 12(Hex) is the same as that for PCX file format
(monochrome). The printer receives the compressed data, reproduces it in the following format and prints as bit-image data.
AIf either of upper two bit of input byte is 0, the byte is treated as graphic data.
If both of upper two bit of graphic data to be printed are 0, it is necessary to send the data to printer in “B” format described below.
B If both of upper two bit of input byte are 0, the remaining 6 bit specifies the times
the data is repeated. The number of times to be repeated is specified in 0-3F(Hex). The byte follows this byte is treated as graphic data to be repeated.
Graphics data should line up from left to right and from top to bottom.
— 16 —
ESC +
[Function] Switch OFF the printer
[Code] <1B>H<2B>H
[Range] None
[Outline] This command is used for switching off the printer from the host.
Sending this command causes the same operation as that by setting the power switch to off.
ESC – n
[Function] Specifying/ Canceling Underline
[Code] <1B>H<2D>H<n>
[Range] {0 =< n =< 02(Hex)}
[Outline] Specifying/canceling an underline.
•Types of underlines by n value are shown below:
n (Hex) Type
0 Canceling an underline. 1 Specifying an underline for 1-dot width. 2 Specifying an underline for 2-dots width.
[Caution] • An underline is attached to the full character width. It is, however, not attached to
the part having been skipped by horizontal tab command.
• An underline is not attached to a 90°- right-turned characters.
[Default] n = 0
[See Also] ESC !
[Sample Program]
PRINT #1, CHR$ (&H1B) + “–” + CHR$ (0); PRINT #1, “AAAAA” ; PRINT #1, CHR$ (&H1B) + “–” + CHR$ (1); PRINT #1, “AAAAA” + CHR$ (&HA);
[Print Results]
Underline Canceled
>
>
A A A A A A A A A A
Underline Specified
>
>
— 17 —
ESC .
[Function] Printer self test
[Code] <1B>H<2E>H
[Range] None
[Outline] Prints test page, downloaded bit image, and self-diagnostic information. The self-
diagnostic information includes print density, print head temperature, battery voltage, Serial or IrDA interface, baud rate, and memory switch setting.
[See Also] ESC T
ESC 2
[Function] Specifying 1/6-inch line feed rate
[Code] <1B>H<32>H
[Outline] The line feed rate per line is specified by 1/6 inch.
[Sample Program]
PRINT #1, “AAAAA” + CHR$ (&HA); PRINT #1, CHR$ (&H1B) + “3” + CHR$ (0); PRINT #1, “AAAAA” + CHR$ (&HA); PRINT #1, CHR$ (&H1B) + “3” + CHR$ (50); PRINT #1, “AAAAA” + CHR$ (&HA); PRINT #1, CHR$ (&H1B) + “2”; PRINT #1, “AAAAA” + CHR$ (&HA); PRINT #1, “AAAAA”; PRINT #1, CHR$ (&H1B) + “J” + CHR$ (100); PRINT #1, “AAAAA” + CHR$ (&HA); PRINT #1, “AAAAA” + CHR$ (&HA);
[Print Results]
A A A A A
A A A A A
>
1/6-inch line feed
>
>>>>>
>>> >>
0/203-inch line feed
A A A A A
50/203-inch line feed
A A A A A
A A A A A
A A A A A
A A A A A
1/6-inch line feed
100/203-inch line feed
1/6-inch line feed
— 18 —
ESC 3 n
[Function] Setting line feed rate of minimum pitch
[Code] <1B>H<33>H<n>
[Range] {0 =< n =< FF(Hex)}
[Outline] The line feed rate per line is specified by n/203 inch.
[Default] n = 22(Hex) 1/6-inch
[Sample Program] See Sample Program and Print Results for ESC 2.
— 19 —
ESC = n
[Function] Data Input Control
[Code] <1B>H<3D>H<n>
[Range] {0 =< n =< FF(Hex)}
[Outline] Selecting equipment in which data input from the host is effective.
• Each bit of n indicates as follows:
Bit Equipment
0 Printer Invalid Valid 1 Not defined 2 Not defined 3 Not defined 4 Not defined 5 Not defined 6 Not defined 7 Not defined
• When the printer has not been selected, this printer abandons all the received data until it is selected by this command.
[Caution] • Even when the printer has not been selected, it can become BUSY state through
printer operation.
• When the printer is deselected, this printer discards all the data until it is selected with this command.
[Default] The initial value of n is “1”.
Value
01
[Sample Program]
[Print Results]
PRINT #1, “AAAAA”; PRINT #1, CHR$ (&H1B) + “=” + CHR$ (0); PRINT #1, “aaaaa” + CHR$ (&HA); PRINT #1, CHR$ (&H1B) + “=” + CHR$ (1); PRINT #1, “AAAAA” + CHR$ (&HA);
A A A A A A A A A A
>
a a a a a
— 20 —
ESC > n
[Function] Saving current setting
[Code] <1B>H<3E>H<n>
[Range] n = 0 or 1
[Outline] This command saves International character, Serial port baud rate, Print density, Auto
power off time and maximum speed at Infrared communication to NV memory so that the setting can be resumed automatically when power on after setting data on RAM memory is gone by like battery is disconnected.
n (Hex) Type
0 Max speed at Infrared communication is 115200 bps. 1 Max speed at Infrared communication is 57600 bps.
[Caution] Do NOT use this command frequently.
NEVER turn the printer off during command is running. Otherwise there is a risk to lose the firmware updating function.
Power is turned off automatically when setting is saved.
[Default] n = 0
[See Also] ESC R, ESC S, ESC Y, ESC x
— 21 —
ESC ? n
[Function] Reading magnetic stripe reader
[Code] <1B>H<3F>H<n>
[Range] {0 =< n =< 7(Hex)}
[Outline] When the command is received the bicolor LED is shining in RED and the printer is
waiting for the magnetic card to be swiped through the reader. If even after 10 seconds the card is not swiped the command is aborted automatically.
Printer returns the information read from the tracks followed by 00(Hex). Reads the data of the track in the following table by the value of n.
n (Hex) Track
0Invalid 1Track 1 2Track 2 3Track 1 and 2 4Track 3 5Invalid 6Track 2 and 3 7Invalid
The format of the data read is as follows.
Track Header Card data Footer
Track Track 1 is F1 (Hex)
Track 2 is F2 (Hex) Track 3 is F3 (Hex)
Header Track 1: “%”
Track 2: “;”
Track 3: “+” or “;” Card data ASCII data Footer “?” If reading track is more than one (n=3 or 6), footer data of track 1 or 2 is followed by
track data of track 2 or 3.
[Caution] The command for reading multiple tracks at a time may often result in read error.
If reading is unsuccessful, repeat it.
— 22 —
Loading...
+ 56 hidden pages