Page 2
Edit by: CUSTOM ENGINEERING S.p.A. Str. Berettine 2 - 43010 Fontevivo (PARMA) - Italy http: www.custom.biz All rights reserved Command Reference...
Page 3
Introduction 1 INTRODUCTION 1.1 Command description Each command reported in this manual is described as shown in the following picture. In the fi rst heading line (grey colour) is reported the hexadecimal command value. In the second heading line are listed the printers on which it is possible to use the command (for example printer AAAA).
Introduction 1.2 Print direction The printer has two printing direction which can be selected by means of the control characters: normal e reverse. 1234567890 abcdefghilmnopqrs ABCDEFGHILMNOPQRS Normal Mode Reverse Mode Command Reference...
Page 5
ESC/POS™ Emulation 2 ESC/POS EMULATION The following table lists all the commands for function management in ESC/POS Emulation of the printer. The commands can be transmitted to the printer at any moment, but they will only be carried out when the commands ahead of them have been executed.
Page 6
ESC/POS™ Emulation STATUS COMMANDS $10 $04 DLE EOT Real-time status transmission $1B $76 ESC v Transmit paper sensor status $1D $72 GS r Transmit status $1D $E0 GS { } Enable / disable automatic FULL STATUS back $1D $E1 GS { } Reading of length paper (cm) available before virtual paper end $1D $E2 GS { }...
Page 7
ESC/POS™ Emulation Given below are more detailed descriptions of each command. Printers: KM216H, KPM216H [Name] Back space [Format] ASCII Decimal [Range] [Description] Moves print position to previous character. [Notes] Can be used to put two characters at the same position.
Page 8
ESC/POS™ Emulation Printers: KM216H, KPM216H [Name] Form Feed [Format] ASCII Decimal [Description] Prints the data in the buffer, cuts the paper and presents the ticket. [Notes] [Default] [Reference] [Example] Printers: KM216H, KPM216H [Name] Print and carriage return [Format] ASCII Decimal...
Page 9
ESC/POS™ Emulation n=1: Printer status OFF/ON Decimal FUNCTION RESERVED RESERVED RESERVED On-line. Off-line. RESERVED RESERVED RESERVED RESERVED n=2: Off-line status OFF/ON Decimal FUNCTION RESERVED RESERVED Cover closed Cover opened Paper isn’t fed by FEED. key Paper is fed by FEED. key RESERVED Paper present Printing stop due to paper end...
Page 10
ESC/POS™ Emulation RESERVED Paper present 5, 6 Paper not present RESERVED n=17: Print status OFF/ON Decimal FUNCTION RESERVED RESERVED Paper drag motor off Paper drag motor on RESERVED RESERVED Paper present Paper absent RESERVED RESERVED n=20: FULL status (6 bytes) 1°...
Page 11
ESC/POS™ Emulation Cover closed Cover opened No spooling Spooling Drag paper motor off Drag paper motor on RESERVED LF key released LF key pressed FF key released FF key pressed RESERVED 5° byte = Recoverable error status OFF/ON Decimal FUNCTION Head temperature ok.
Page 12
ESC/POS™ Emulation Printers: KM216H, KPM216H [Name] Cancel current line transmitted [Format] ASCII Decimal [Description] Deletes current line transmitted. [Notes] • Sets the print position to the beginning of the line. • However, this command does not clear the receive buffer.
Page 13
ESC/POS™ Emulation $1B $21 Printers: KM216H, KPM216H [Name] Set print mode [Format] ASCII Decimal [Range] 0 ≤ n ≤ 255 [Description] Selects print modes using n (see table below): FUNCTION 200Dpi: 11/15 cpi 200Dpi: 15/20 cpi OFF/ON Decimal 300Dpi: 16/23 cpi...
Page 14
ESC/POS™ Emulation $1B $24 Printers: KM216H, KPM216H [Name] Set absolute print position [Format] ASCII Decimal [Range] 0 ≤ nL ≤ 255 0 ≤ nH ≤ 255 [Description] Sets the distance from the beginning of the line to the position at which subsequent characters are to be printed.
Page 15
ESC/POS™ Emulation $1B $26 Printers: KM216H, KPM216H [Name] Defi nes user-defi ned characters [Format] ASCII & Decimal [Range] y = 3 32 ≤ c1 ≤ c2 ≤ 126 0 ≤ x ≤ 16 (Font (18 × 24)) 0 ≤ x ≤ 13 (Font (14 × 24)) 0 ≤...
Page 16
ESC/POS™ Emulation $1B $28 $76 Printers: KM216H, KPM216H [Name] Set relative vertical print position [Format] ASCII Decimal [Range] 0 ≤ nL ≤ 255 0 ≤ nH ≤ 255 [Description] Sets the print vertical position based on the current position by using the horizontal or vertical motion unit.
Page 17
Print data Print data [Default] [Reference] [Example] $1B $2D Printers: KM216H, KPM216H [Name] Turn underline mode on/off [Format] ASCII Decimal [Range] 0 ≤ n ≤ 2 48 ≤ n ≤ 50 [Description] Turns underline mode on or off, based on the following values of n:...
Page 19
ESC/POS™ Emulation $1B $34 Printers: KM216H, KPM216H [Name] Set/reset italic mode [Format] ASCII Decimal [Range] 0 ≤ n ≤ 1,48 ≤ n ≤ 49 [Description] Turns italic mode on or off, based on the following values of FUNCTION 0, 48...
Page 20
ESC/POS™ Emulation $1B $45 Printers: KM216H, KPM216H [Name] Select emphasized mode [Format] ASCII Decimal [Range] 0 ≤ n ≤ 255 [Description] Turns emphasized mode on/off. • When the LSB of n is 0, the emphasized mode is off. • When the LSB of n is 1, the emphasized mode is on.
Page 21
ESC/POS™ Emulation $1B $56 Printers: KM216H, KPM216H [Name] Select print mode 90° turned [Format] ASCII Decimal [Range] 0 ≤ n ≤ 1, 48 ≤ n ≤ 49 [Description] Turns 90° rotation mode on/off. n is used as follows : FUNCTION 0, 48 Turns off 90°...
Page 22
ESC/POS™ Emulation $1B $61 Printers: KM216H, KPM216H [Name] Select justifi cation [Format] ASCII Decimal [Range] 0 ≤ n ≤ 2 48 ≤ n ≤ 50 [Description] Aligns all data in one line to the specifi ed position. n selects the type of justifi cation as...
Page 23
ESC/POS™ Emulation $1B $69 Printers: KM216H, KPM216H [Name] Total cut [Format] ASCII Decimal [Range] [Description] This command prints the data in the buffer and enables cutter operation. If there is no cutter, a disabling fl ag is set and any subsequent cut commands will be ignored.
Page 24
ESC/POS™ Emulation $1B $C1 Printers: KM216H, KPM216H [Name] Set/cancel cpi mode [Format] ASCII Decimal [Range] 0 ≤ n ≤ 1, 48 ≤ n ≤ 49 [Description] Sets cpi mode based on the following values of n: FUNCTION 200Dpi 300Dpi Font A = 11 cpi...
Page 25
[Default] [Reference] $1B $32, $1B $33 [Example] To print from ram bank dotline 100 to dotline 299, send: HEX: $1B $FB Printers: KM216H, KPM216H (serial interface only) [Name] Transmit graphic page to communication port [Format] ASCII Decimal [Range] 0 ≤ nL, nH ≤ 255 [Description] Transmits [nL + (nH ×...
Page 26
ESC/POS™ Emulation $1B $FD Printers: KM216H, KPM216H [Name] Receive graphic page from communication port [Format] ASCII Decimal [Range] 0 ≤ nL, nH ≤ 255 [Description] Receives [nL + (nH × 256)] words from the port and puts them into the ram bank.
Page 27
ESC/POS™ Emulation $1D $21 Printers: KM216H, KPM216H [Name] Select character size [Format] ASCII Decimal [Range] 0 ≤ n ≤ 7, 16 ≤ n ≤ 23, 32 ≤ n ≤ 39, 48 ≤ n ≤ 55, 64 ≤ n ≤ 71, 80 ≤ n ≤ 87, 96 ≤...
Page 28
ESC/POS™ Emulation [Default] [Reference] $1D $5E [Example] $1D $42 Printers: KM216H, KPM216H [Name] Turn white/black reverse printing mode on/off [Format] ASCII Decimal [Range] 0 ≤ n ≤ 255 [Description] Turns white/black reverse printing mode on or off. • When the LSB of n is 0, white/black reverse printing is turned off.
ESC/POS™ Emulation $1D $49 Printers: KM216H, KPM216H (serial interface only) [Name] Transmit printer ID [Format] ASCII Decimal [Range] 1 ≤ n ≤ 3, 49 ≤ n ≤ 51 [Description] Transmits the printer ID specifi ed by n follows: PRINTER ID...
Page 30
ESC/POS™ Emulation $1D $4C Printers: KM216H, KPM216H [Name] Set left margin [Format] ASCII Decimal [Range] 0 ≤ nL, nH ≤ 255 [Description] Sets the left margin. • The left margin is set to [(nL + nH × 256) × (horizontal motion unit)] inches.
Page 33
ESC/POS™ Emulation $1D $65 Printers: KPM216H [Name] Ejector commands [Format] ASCII Decimal [Range] 1 ≤ n ≤ 6 [Description] This command checks tickets ejector n = 1 n = 2 Ticket retracted (only if Paper retracting is enabled) n = 3 Ticket produced with m steps (1 step = 6.5 mm) n = 4 n = 5 Ticket ejection n = 6 Transmit the status byte of the ejector...
Page 34
ESC/POS™ Emulation $1D $66 Printers: KM216H, KPM216H [Name] Select font for HRI characters [Format] ASCII Decimal [Range] n = 0, 1, 48, 49 [Description] Selects a font for the HRI characters used when printing a bar code. n selects a font from...
Page 35
ESC/POS™ Emulation $1D $6B Printers: KM216H, KPM216H [Name] Print bar code [Format] Mode ASCII Decimal Mode ASCII Decimal [Range] Mode 0 ≤ m ≤ 20 ‚ Mode 65 ≤ m ≤ 90 [Description] Selects a bar code system and prints the bar code. m selects a bar code system as follows: BARCODE SYSTEM No.
Page 36
ESC/POS™ Emulation • When the bar code system used is EAN13, the printer prints the bar code data after receiving 12 (without check digit) or 13 (with check digit) bytes bar code data. • When the bar code system used is EAN8, the printer prints the bar code data after receiving 7 (without check digit) or 8 (with check digit) bytes bar code data.
Page 37
ESC/POS™ Emulation $1D $72 Printers: KM216H, KPM216H (serial interface only) [Name] Transmit status [Format] ASCII Decimal [Range] n = 1, 49 [Description] Transmits the status specifi ed by n as follows: FUNCTION 1, 49 Transmits paper sensor status (as for $1B $76).
Page 38
ESC/POS™ Emulation [Default] n = 3 [Reference] $1D $6B [Example] $1D $7C Printers: KM216H, KPM216H [Name] Set printing density [Format] ASCII Decimal [Range] 0 ≤ n ≤ 8, 48 ≤ n ≤ 56 [Description] Sets printing density. n specifi es printing density as follows:...
Page 39
= 300 Model 300 Dpi y = 600 [Reference] $1B $4A, $1D $4C, $1D $57, $1D $D0 [Example] $1D $E0 Printers: KM216H, KPM216H [Name] Enable / disable automatic FULL STATUS back [Format] ASCII Decimal [Range] 0 ≤ n ≤ 255 [Description] Enable / disable automatic full status back.
Page 40
ESC/POS™ Emulation $1D $E1 Printers: KM216H, KPM216H [Name] Reading of length paper (cm) available before virtual paper-end [Format] ASCII Decimal [Range] [Description] Reading of length (cm) paper available before virtual paper-end. The command return a string pointing out how much paper is available, for example if there are 5.1 m before the paper end, it will be: ‘510cm’...
Page 41
• The command return a string pointing out the number of retracting of the printer, for example if the printer has retracted the paper 512 times, it will be: ‘512ret’ [Default] [Reference] [Example] $1D $E5 Printers: KM216H, KPM216H [Name] Reading number of power up [Format] ASCII Decimal [Range] [Description] Reading number of power up of the printer.
Page 42
ESC/POS™ Emulation and then send the following command: HEX: DECIMAL: $1D $E7 Printers: KM216H, KPM216H [Name] Set notch distance [Format] ASCII Decimal [Range] 0 ≤ nH ≤ 255 0 ≤ nL ≤ 255 [Description] Sets notch distance in tenth mm from the beginning of the document.
Page 43
ESC/POS™ Emulation $1D $F6 Printers: KM216H, KPM216H Name] Align the print head with the notch [Format] ASCII Decimal [Range] [Description] Set the print head notch alignment (as $1D $E7 command setting). [Notes] [Default] [Reference] $1D $E7, $1D $F8 [Example] $1D $F8...
Need help?
Do you have a question about the KM216H and is the answer not in the manual?
Questions and answers