COMMAND REFERENCE US STAT FF AR NE D EN KPM150 PA PE R
Edit by: CUSTOM ENGINEERING S.p.A. Str. Berettine 2 - 43010 Fontevivo (PARMA) - Italy http: www.custom.
Introduction 1 INTRODUCTION 1.1 Command description Each command reported in this manual is described as shown in the following picture. In the first 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). The next fields give all the information useful to use the command.
Introduction 1.2 Print direction The printer has two printing direction which can be selected by means of the control characters: normal and reverse.
ESC/POS™ Emulation 2 ESC/POSTM 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. The commands are carried out when the circular buffer is free to do so. COMMAND DESCRIPTION TABLE Tab.1 Com. HEX Com.
ESC/POS™ Emulation $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 { } Reading number of cuts performed from the printer $1D $E3 GS { } Reading of length (cm) of printed paper $1D $E4 GS { } Reading number of retracting $1D $E5 GS { } Reading number of power up $1D $48 GS H Select printing position of HRI characters $1D $66 GS f Select font for HRI char
ESC/POS™ Emulation Given below are more detailed descriptions of each command. $08 Printers: KPM150 [Name] [Format] Back space ASCII Hex Decimal [Range] [Description] [Notes] [Default] [Reference] [Example] BS 08 8 Moves print position to previous character. Can be used to put two characters at the same position.
ESC/POS™ Emulation $0D Printers: KPM150 [Name] [Format] Print and carriage return ASCII CR Hex 0D Decimal 13 When autofeed is “CR enabled”, this command functions in the same way as $0A, otherwise it is disregarded. • Sets the print position to the beginning of the line. See “Autofeed in setup” parameter.
ESC/POS™ Emulation n=2: Off-line status BIT OFF/ON HEX Decimal 0 Off 00 0 Not used. Fixed to Off 1 On 02 2 Not used. Fixed to On Off 00 0 Cover closed On 04 4 Cover opened 2 3 4 5 6 7 FUNCTION Off 00 0 Paper isn’t feeded by FEED. key On 08 8 Paper is feeded by FEED. key On 10 16 Not used. Fixed to On Off 00 0 Paper present On 20 32 Printing stop due to paper end Off 00 0 No error On 40 64 Error. Off 00 0 Not used.
ESC/POS™ Emulation 6 - - - RESERVED. 7 - - - RESERVED. n=20: FULL status (6 bytes) 1st Byte = $10 (DLE); 2nd Byte = $0F 3rd Byte = Paper status BIT 0 1 OFF/ON HEX Decimal Off 00 0 Paper present FUNCTION On 01 1 Paper not present - - - RESERVED. Off 00 0 Paper present in abundance On 04 4 Near paper end 3 - - - RESERVED. 4 - - - RESERVED. 2 5 6 7 Off 00 0 Ticket not present in output. On 20 32 Ticket present in output.
ESC/POS™ Emulation 4 5 6 7 - - - RESERVED.
ESC/POS™ Emulation $1B $21 n Printers: KPM150 [Name] [Format] Select print modes ASCII ESC ! n Hex 1B 21 n Decimal 27 33 n 0 ≤ n ≤ 255 Selects print modes using n (see table below): [Range] [Description] BIT OFF/ON HEX Decimal 11/15 cpi 15/20 cpi Off 00 0 Character font A selected. 18 x 24 14 x 24 On 01 1 Character font B selected 14 x 24 10 x 24 - - - Undefined. 0 1 2 3 4 5 6 7 [Notes] [Default] [Reference] [Example] FUNCTION - - - Undefined.
ESC/POS™ Emulation [Description] [Notes] [Default] [Reference] [Example] Sets the distance from the beginning of the line to the position at which subsequent characters are to be printed. The distance from the beginning of the line to the print position is [(nL + nH × 256) × (vertical or horizontal motion unit)] inches. • Settings outside the specified printable area are ignored. • The horizontal and vertical motion unit are specified by $1D $50.
ESC/POS™ Emulation 8-dot bit image MSB d1 d2 d3 Bitimage data LSB Print data 24-dot bit image d1 d4 d7 d2 d5 d8 d3 d6 d9 MSB Bitimage data LSB Print data [Default] [Reference] [Example] $1B $2D n Printers: KPM150 [Name] [Format] Turn underline mode on/off ASCII ESC n Hex 1B 2D n Decimal 27 45 n 0 ≤ n ≤ 2, 48 ≤ n ≤ 50 Turns underline mode on or off, based on the following values of n: n = 0, 48 Turns off underline mode n = 1, 49 Turns on underline mode (1-dot thick) n = 2, 50 Turns on under
ESC/POS™ Emulation [Default] [Reference] [Example] $1B $33 $1B $33 n Printers: KPM150 [Name] [Format] Set line spacing ASCII ESC 3 n Hex 1B 33 n Decimal 27 51 n 0 ≤ n ≤ 255 Sets line spacing to [ n × (vertical or horizontal motion unit)] inches. • The horizontal and vertical motion unit are specified by $1D $50. Changing the horizontal or vertical motion unit does not affect the current line spacing. • The $1D $50 command can change the horizontal (and vertical) motion unit.
ESC/POS™ Emulation [Description] [Notes] [Default] [Reference] [Example] Select the device to which the host computer sends data, using n as follows: n Function 1 Printer enabled 2 Printer disabled 3 Printer enabled • When the printer is disabled, it ignores all transmitted data until the printer is enabled through this command.
ESC/POS™ Emulation [Reference] [Example] $09 $1B $45 n Printers: KPM150 [Name] [Format] Select emphasized mode ASCII ESC E Hex 1B 45 Decimal 27 69 [Range] [Description] 0 ≤ n ≤ 255 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. • Only the LSB of n is effective. • $1B $21 also turns on and off the emphasized mode. However, the last received command is the effective one.
ESC/POS™ Emulation • $1D $50 can change the vertical (and horizontal) motion unit. However, the value cannot be less than the minimum vertical movement amount. • In standard mode, the vertical motion unit is used. • The maximum paper feed amount is 520 mm.
ESC/POS™ Emulation [Notes] [Default] [Reference] [Example] n=0 $1B $56 n Printers: KPM150 [Name] [Format] Select print mode 90° turned ASCII ESC V n Hex 1B 56 n Decimal 27 86 n 0 ≤ n ≤ 1, 48 ≤ n ≤ 49 Turns 90° rotation mode on/off. n is used as follows: [Range] [Description] [Notes] [Default] [Reference] [Example] n FUNCTION 0, 48 Turns off 90° rotation mode 1, 49 Turns on 90° rotation mode • When underlined mode is turned on, the printer does not underline 90° rotated characters.
ESC/POS™ Emulation $1B $61 n Printers: KPM150 [Name] [Format] Select justification ASCII ESC a n Hex 1B 61 n Decimal 27 97 n 0 ≤ n ≤ 2, 48 ≤ n ≤ 50 Aligns all data in one line to the specified position. n selects the type of justification as follows: [Range] [Description] [Notes] [Default] [Reference] [Example] n JUSTIFICATION 0, 48 Flush left 1, 49 Centered 2, 50 Flush right • This command is only enabled when inserted at the beginning of a line.
ESC/POS™ Emulation [Description] [Notes] [Default] [Reference] [Example] Prints the data in the print buffer and feeds the paper n rows. • n rows paper feed is equivalent to (n × char height + line spacing set). • Sets the print starting position at the beginning of the line. • This command does not affect the line spacing set by $1B $32 or $1B $33. • The maximum paper feed amount is 254 rows. Even if a paper feed amount of more than 254 rows is set, the printer feeds the paper only 254 rows.
ESC/POS™ Emulation $1B $76 Printers: KPM150 [Name] [Format] Transmit paper sensor status ASCII ESC v Hex 1B 76 Decimal 27 118 When this command is received, transmit the current status of the paper sensor. The status to be transmitted is shown in the table below: [Description] BIT OFF/ON HEX Decimal Off 00 0 Near paper-end sensor: paper present. On 03 3 Near paper-end sensor: paper not present. Off 00 0 Paper-end sensor: paper present.
ESC/POS™ Emulation [Default] [Reference] [Example] • When the LSB of n is 1, the upside-down printing mode is on. • Only the LSB of n is effective. • This command is valid only if entered at the beginning of a line. • In upside-down printing mode, the printer rotates the line to be printed 180° and then prints it.
ESC/POS™ Emulation [Description] [Notes] [Default] [Reference] [Example] Enables / disables current ticket. • When the LSB of n is 0, validate the ticket. • When the LSB of n is 1, the current ticket is invalid. • Only the LSB of n is effective.
ESC/POS™ Emulation [Notes] [Default] [Reference] [Example] • Set n = 26 to complete recover the paper. • WARNING: setting n = 26 is not recommended for paper roll with low weight. n = 15 mm $1D $21 n Printers: KPM150 [Name] [Format] Select character size ASCII GS ! n Hex 1D 21 n Decimal 29 33 n 0 ≤ n ≤ 7, 16 ≤ n ≤ 23, 32 ≤ n ≤ 39, 48 ≤ n ≤ 55, 64 ≤ n ≤ 71, 80 ≤ n ≤ 87, 96 ≤ n ≤ 103, 112 ≤ n ≤ 119 Selects character height and width, as follows: • Bits 0 to 3: to select character height (see table 2).
ESC/POS™ Emulation OFFSET 0000h CONTENTS 2 bytes The characters identifying the bitmap. The following entries are possible : ‘BM’ - Windows 2K3, XP, VISTA File size 1 dword Complete file size of BMP image in bytes. 0006h Reserved 1 dword Reserved for later use. 000Ah Bitmap Data Offset 1 dword Offset from the beginning of the file until the beginning of the graphics. 1 dword Length of the bitmap Info header used to describe the bitmap colours, compression, etc...
ESC/POS™ Emulation $1D $42 n Printers: KPM150 [Name] [Format] Turn white/black reverse printing mode on/off ASCII GS B n Hex 1D 42 n Decimal 29 66 n 0 ≤ n ≤ 255 Turns white/black reverse printing mode on or off. • When the LSB of n is 0, white/black reverse printing is turned off. • When the LSB of n is 1, white/black reverse printing is turned on. • Only the LSB of n is effective. • This command is available for both built-in and user-defined characters.
ESC/POS™ Emulation [Notes] n PRINTER ID SPECIFICATION 1, 49 Printer model ID $A9 2, 50 Type ID Undefined 3, 51 ROM version ID Depends on ROM version (4 character) 5, 53 Printer model ID (see value for n=1) • The printer only transmits 1 byte (printer ID) without confi rmation that the host is ready to receive data. • This command is executed when the data is processed in the data buffer.
ESC/POS™ Emulation $1D $50 x y Printers: KPM150 [Name] [Format] Set horizontal and vertical motion units ASCII GS P x y Hex 1D 50 x y Decimal 29 80 x y 0 ≤ x, y ≤ 255 Sets the horizontal and vertical motion units to 1/x inch and 1/y inch respectively. When x is set to 0, the default setting value is used. When y is set to 0, the default setting value is used. • The horizontal direction is perpendicular to the paper feed direction.
ESC/POS™ Emulation $1D $57 nL nH Printers: KPM150 [Name] [Format] Set printing area width ASCII GS W Hex 1D 57 Decimal 29 87 0 ≤ nL, nH ≤ 255 0 ≤ nL + nH × 256) ≤ 640 [Range] [Description] [Default] [Reference] [Example] nH nH nH Sets the printing area width to the area specified by nL and nH. • The left margin is set to [(nL+nH×256) × (horizontal motion unit)] inches.
ESC/POS™ Emulation $1D $68 n Printers: KPM150 [Name] [Format] Set bar code height ASCII GS h n Hex 1D 68 n Decimal 29 104 n 1 ≤ n ≤ 255 Sets the height of the bar code. n specifies the number of vertical dots. [Range] [Description] [Notes] [Default] [Reference] [Example] n = 162 $1D $6B n $1D $6B m [d1...dk] $00, o $1D $6B m [d1...
ESC/POS™ Emulation o 65 UPC-A 11≤ n ≤12 48≤ d ≤ 57 66 UPC-E 11≤ n ≤12 48≤ d ≤ 57 67 EAN13 ( JAN) 12≤ n ≤13 48≤ d ≤ 57 68 EAN8 ( JAN) 7≤ n ≤8 48≤ d ≤ 57 69 CODE39 1≤ n ≤ 255 48 ≤ d ≤ 57, 65 ≤ d ≤ 90, 32, 36, 37, 43, 45, 46, 47 70 ITF 1≤ n ≤255 48≤ d ≤ 57 71 CODABAR 1≤ n ≤ 255 48 ≤ d ≤ 57, 65 ≤ d1 ≤ 68, 36, 43, 45, 46, 47, 58 72 CODE93 1≤ n ≤255 0≤ d ≤ 127 73 CODE128 2≤ n ≤255 0≤ d ≤ 127 90 CODE32 8≤ n ≤9 48≤ d ≤ 57 [Notes] • If d is outside of the specified range, t
ESC/POS™ Emulation [Default] [Reference] [Example] FNC2 {2 7B, 32 123, 50 FNC3 {3 7B, 33 123, 51 FNC4 {4 7B, 34 123, 52 ‘{‘ {{ 7B, 7B 123, 123 $1D $48, $1D $66, $1D $68, $1D $77 $1D $70 m n Printers: KPM150 [Name] [Format] Print logo ASCII GS p m n Hex 1D 70 m n Decimal 29 47 m n 0 ≤ m ≤ 1 (No.
ESC/POS™ Emulation [Notes] [Default] [Reference] [Example] 6 - - - Undefined. 7 Off 00 0 Not used. Fixed to Off. • This command is executed when the data is processed in the data buffer. Therefore, there may be a time lag between receiving the command and transmitting the status, depending on data buffer status.
ESC/POS™ Emulation [Notes] [Default] [Reference] [Example] n PRINTING DENSITY 0, 48 - 50% 1, 49 - 37% 2, 50 - 25% 3, 51 - 12% 4, 52 0% 5, 53 + 12% 6, 54 + 25% 7, 55 + 37% 8,56 + 50% • Printing density reverts to the default value when the printer is reset or turned off. n=4 $1D $E0 Printers: KPM150 [Name] [Format] Enable / disable automatic FULL STATUS back ASCII GS {} n Hex 1D E0 n Decimal 29 224 n 0 ≤ n ≤ 255 Enable / disable automatic full status back.
ESC/POS™ Emulation $1D $E1 Printers: KPM150 [Name] [Format] Reading of length paper (cm) available before virtual paper-end ASCII GS {} Hex 1D E1 Decimal 29 225 [Range] [Description] [Notes] [Default] [Reference] [Example] 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.
ESC/POS™ Emulation 1D $E4 Printers: KPM150 [Name] [Format] Reading number of retracting ASCII GS {} Hex 1D E4 Decimal 29 228 [Range] [Description] [Notes] Reading number of retracting of the printer.
ESC/POS™ Emulation $1D $E7 Printers: KPM150 [Name] [Format] Set notch distance ASCII GS {} nL nH Hex 1D E7 nL nH Decimal 29 231 nL nH 0 ≤ nH ≤ 255 0 ≤ nL ≤ 255 Sets notch distance in tenth mm from the beginning of the document. • This value is expressed as [(nH x 256)+nL] • The maximum value is 199,9 mm.
ESC/POS™ Emulation $1D $F8 Printers: KPM150 [Name] [Format] Align the autocutter with the notch ASCII GS {} Hex 1D F8 Decimal 29 248 [Range] [Description] [Notes] [Default] [Reference] [Example] Set the autocutter notch alignment (as $1D $E7 command setting).
SVELTA Emulation 3 SVELTA EMULATION The following table lists all the commands for function management. The commands must be transmitted to the printer as command string enclosed between ‘<’ character and ‘>’ character. COMMAND DESCRIPTION TABLE Tab.2 Com.
SVELTA Emulation Print horizontal ITF barcode Print a vertical ITF barcode Print an horizontal code 39 barcode Print a vertical code 39 barcode Define the barcode lines dimension MISCELLANEOUS COMMANDS Change printer emulation to ESC/ POS Enable/Disable keys panel Reload paper Change printer emulation to SVELTA TICKET MANAGEMENT COMMANDS Change the ticket print intensity Invalidate the ticket Cha
SVELTA Emulation Given below are more detailed descriptions of each command. Printers: KPM150 [Name] [Format] [Range] [Description] Enable / Disable auto FULL STATUS back ASCII ‘0’ ≤ x ≤ ‘9’, ‘A’ ≤ x ≤ ‘F’ • Enable/disable auto FULL STATUS back. • x specify the request for FULL STATUS.
SVELTA Emulation 2° byte = User status BIT 0 1 2 3 4 5 6 7 OFF/ON Off On Off On Off On Off On Off On Off On - HEX 00 01 00 02 00 04 00 08 00 20 00 40 - Decimal 0 1 0 2 0 4 0 8 0 32 0 64 - FUNCTION Printing head down Printing head up error 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 3° byte = Recoverable error status BIT 0 1 2 3 4 5 6 7 OFF/ON Off On Off On Off On Off On Off On Of
SVELTA Emulation where: 1°byte 0 = 0000 5 = 0101 bit7 = 0 bit6 = 0 (notch found) (not virtual paper end) (ticket not present) (RESERVED) bit5 = 0 bit4 =0 bit3 = 0 bit2 = 1 bit1 = 0 bit0 =1 (RESERVED) (near paper end) (RESERVED) (Paper not present) bit7 = 0 bit6 = 0 bit5 = 0 bit4 =0 (RESERVED) (FF key released) (LF key released) (RESERVED) bit3 = 0 bit2 = 1 bit1 = 0 bit0 =0 (drag motor off) (spooling) (cover closed) (print head down) 2°byte 0 = 0000 4 = 0100 n Printers:
SVELTA Emulation [Reference] [Example] Ticket example that use a filled box (800, 50) (1000, 250) Printers: KPM150 [Name] [Format] [Range] [Description] Command to create empty Box ASCII [Notes] [Default] [Reference] [Example] Create an empty box on the basis of x1, y1, x2, y2 coordinates where : x1 -> minimum horizontal coordinate y1 -> minimum vertical coordinate x2 -> maximum horizontal coordinate y2 -> maximum ver
SVELTA Emulation Printers: KPM150 [Name] [Format] [Range] [Description] Command to create parametric Box ASCII [Notes] [Default] [Reference] [Example] Create a box defined by the following parameters where : x1 -> minimum horizontal coordinate y1 -> minimum vertical coordinate x2 -> maximum horizontal coordinate y2 -> maximum vertical coordinate s -> border thickness in dot (8 dot = 1mm)s ≤ 255 t -> Fill mode 0≤t≤9 t FILL MODE 0 Deletes area 1 Fi
SVELTA Emulation Printers: KPM150 [Name] [Format] [Range] [Description] Clear data in the print buffer ASCII Clear data in the print buffer, move the cursor to column 0, row 0, resets the text rotation, set the deault font as current and disables the Box Size function during the character writing.
SVELTA Emulation [Notes] [Default] [Reference] [Example] 7: Font dimension ×7 8: Font dimension ×8 The command is ignored if height or width has different value from that reported above. Printers: KPM150 [Name] [Format] [Range] [Description] [Notes] [Default] [Reference] [Example] Invalidate the ticket ASCII When this command is received, the current ticket is invalid.
SVELTA Emulation Printers: KPM150 [Name] [Format] [Range] [Description] [Notes] [Default] [Reference] [Example] Reload paper ASCII When this command is received, the printer performs a paper reloading. During the execution of the command, the printer indicates the paper end Printers: KPM150 [Name] [Format] [Range] [Description] [Notes] [Default] [Reference] [Example] Feed the paper of n step ASCII When this command is received, the paper feed of n STEP.
SVELTA Emulation Data Printers: KPM150 [Name] [Format] [Range] [Description] Print vertical CODE 128 barcode ASCII Data [Notes] Print a CODE 128 barcode type in vertical, where: x = barcode height in millimetres; y = byte number of the string to encode. • The top part of the bar code data string must be a code set selection character (CODE A, CODE B or CODE C) which selects the first code set. • Special characters are defined by combining two characters “{“ and one character.
SVELTA Emulation [Notes] [Default] [Reference] [Example] Data Printers: KPM150 [Name] [Format] [Range] [Description] Print an horizontal CODE 39 barcode ASCII Data Print a CODE 39 barcode type in horizontal. The s parameter indicates the barcode height in millimetres. The Data parameter contains the data to convert, with start and stop characters of barcode.
SVELTA Emulation [Range] [Description] [Notes] Sets an offset that will be added to all the transmitted positions. This command is useful to adjusting the printout positions, without having to modify all the transmitted positions. x is the distance (in dot) between the ticket upper edge and the starting point of printing; y is the distance (in dot) between the ticket lateral edge and the starting point of printing. • If using the point (.
SVELTA Emulation
Printers: KPM150 [Name] [Format] [Range] [Description] Printing command (cut and buffer cleaning) in normal ASCII
[Notes] [Default] [Reference] [Example] This command executes the following operations : - align the ticket to notch; - prints ticket; - clear the data in the print buffer; - align the ticket to cut; - executes a ticket cut.
SVELTA Emulation [Notes] [Default] [Reference] [Example] •y indicates the vertical position inside the graphic page • sp indicates the thickness value of the image border (express in dot). • if n is a negative number the image is printed as a background image, without deleting the area below. Several printing commands in graphic page; in the first printing command the image no.
SVELTA Emulation Printers: KPM150 [Name] [Format] [Range] [Description] [Notes] Position the cursor ASCII [Default] [Reference] [Example] Moves the cursor at the position specified by row and column parameters. • The row and column values must be a number with four digit at most, otherwise the command will be ignored.
SVELTA Emulation Printers: KPM150 [Name] [Format] [Range] [Description] FULL STATUS back request ASCII ‘0’ ≤ x ≤ ‘9’, ‘A’ ≤ x ≤ ‘F’ • FULL STATUS back request. • x specify the request for FULL STATUS.
SVELTA Emulation 2nd byte = User status BIT 0 1 2 3 4 5 6 7 OFF/ON Off On Off On Off On Off On Off On Off On - HEX 00 01 00 02 00 04 00 08 00 20 00 40 - Decimal 0 1 0 2 0 4 0 8 0 32 0 64 - FUNCTION Printing head down Printing head up error 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 3rd byte = Recoverable error status BIT 0 1 2 3 4 5 6 7 OFF/ON Off On Off On Off On Off On Off On
SVELTA Emulation [Default] [Reference] [Example] no errors near paper end paper not present, printing head up, cover open To request the Full status (1° byte) and the User status (2°byte) proceed as follow: see bitmask: BIT3 = 0 BIT2 = 0 BIT1 = 1 BIT0 =1 quindi 0011 = 3 Send the command: Possible answer: where: 1st byte 0 = 0000 5 = 0101 bit7 = 0 bit6 = 0 (notch found) (not virtual paper end) (ticket not present) (RESERVED) bit5 = 0
SVELTA Emulation Printers: KPM150 [Name] [Format] [Range] [Description] Change speed ASCII [Notes] [Default] [Reference] [Example] Sets printing speed using n as follows : n PRINTING SPEED 0 High quality 1 Normal 2 High speed • With n = 0 and n = 1 is set to the same speed. Printers: KPM150 [Name] [Format] [Range] [Description] [Notes] [Default] [Reference] [Example] Change printer emulation to SVELTA ASCII Set the SVELTA emulation.
KPM54 Emulation Printers: KPM150 [Name] [Format] [Range] [Description] [Notes] [Default] [Reference] [Example] Validate the ticket ASCII [Reference] [Example] When this command is received, the current ticket is validate. , , Printers: KPM150 [Name] [Format] [Range] [Description] Define the barcode lines dimension ASCII [Notes] n defines the thins lines dimension (in dot) of barcode.
KPM54 Emulation 4 KPM54 EMULATION The following table lists all the commands for function management in KPM54 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. The commands are carried out when the circular buffer is free to do so. COMMAND DESCRIPTION TABLE Tab.3 Com. HEX Com.
KPM54 Emulation $1B $2A ESC * Select image print mode $10 $04 DLE EOT Real-time status transmission $1B $76 ESC v Transmit paper sensor status $1D $72 GS r Transmit status $1D $E1 GS { } Reading of length paper (cm) available before virtual paper end $1D $E2 GS { } Reading number of cuts performed from the printer $1D $E3 GS { } Reading of length (cm) of printed paper $1D $E5 GS { } Reading number of power up $1D $48 GS H Select printing position of HRI characters $1D $66 GS f S
KPM54 Emulation Given below are more detailed descriptions of each command. $08 Printers: KPM150 [Name] [Format] Back space ASCII Hex Decimal [Range] [Description] [Notes] [Default] [Reference] [Example] BS 08 8 Moves print position to previous character. Can be used to put two characters at the same position.
KPM54 Emulation $0D Printers: KPM150 [Name] [Format] Print and carriage return ASCII CR Hex 0D Decimal 13 [Range] [Description] [Notes] [Default] [Reference] [Example] When autofeed is “CR enabled”, this command functions in the same way as $0A, otherwise it is disregarded. • Sets the print position to the beginning of the line. See “Autofeed in setup” parameter.
KPM54 Emulation n=2: Off-line status BIT OFF/ON HEX Decimal 0 Off 00 0 Not used. Fixed to Off 1 On 02 2 Not used. Fixed to On 2 Off 00 0 Not used. Fixed to Off Off 00 0 Paper isn’t fed by FEED. key On 08 8 Paper is fed by FEED. key On 10 16 Not used. Fixed to On 3 4 5 6 7 FUNCTION Off 00 0 Paper present On 20 32 Printing stop due to paper end Off 00 0 No error On 40 64 Error Off 00 0 Not used.
KPM54 Emulation 7 Off 00 0 Not used. Fixed to Off n=20: FULL status (6 bytes 1st Byte = $10 (DLE) 2nd Byte = $0F 3rd Byte = Paper status BIT 0 1 2 OFF/ON HEX Decimal FUNCTION Off 00 0 Paper present On 01 1 Paper not present Off 00 0 Not used. Fixed to Off Off 00 0 Paper present On 04 4 Near paper end 3 Off 00 0 Not used. Fixed to Off 4 Off 00 0 Not used. Fixed to Off 5 - - - RESERVED Off 00 0 Not virtual paper end (*). On 40 64 Virtual paper end (*).
KPM54 Emulation 6th byte = Unrecoverable error status BIT 0 1 2 3 OFF/ON HEX Decimal Off 00 0 Cutter ok FUNCTION On 01 1 Cutter error Off 00 0 Not used. Fixed to Off Off 00 0 RAM ok On 04 4 RAM error Off 00 0 EEPROM ok On 08 8 EEPROM error 4 Off 00 0 Not used. Fixed to Off 5 Off 00 0 Not used. Fixed to Off Off 00 0 Flash ok On 40 64 Flash error Off 00 0 Not used. Fixed to Off.
KPM54 Emulation Off 00 0 Cutter motor off. On 08 8 Cutter motor on. 4 On 10 16 Not used. Fixed to On. 5 Off 00 0 Not used. Fixed to Off. 3 6 7 Off 00 0 Paper present. On 40 64 Virtual paper-end. Off 00 0 Not used. Fixed to Off. $18 Printers: KPM150 [Name] [Format] Cancel print data buffer ASCII CAN Hex 18 Decimal 24 Deletes all the print data in the current print buffer.
KPM54 Emulation $1B $21 Printers: KPM150 [Name] [Format] Select print modes ASCII ESC ! n Hex 1B 21 n Decimal 27 33 n 0 ≤ n ≤ 255 Selects print modes using n (see table below): [Range] [Description] BIT OFF/ON HEX Decimal Off 00 0 Character font A selected On 01 1 Character font B selected - - - Undefined 0 1 2 3 4 5 6 7 [Notes] [Default] [Reference] [Example] FUNCTION - - - Undefined Off 00 0 Expanded mode not selected On 08 8 Expanded mode selected Off 00 0 Double-
KPM54 Emulation [Description] [Notes] [Default] [Reference] [Example] Sets the distance from the beginning of the line to the position at which subsequent characters are to be printed. The distance from the beginning of the line to the print position is [(nL + nH × 256) × (vertical or horizontal motion unit)] inches. • Settings outside the specified printable area are ignored. • The horizontal and vertical motion unit are specified by $1D $50.
KPM54 Emulation [Default] [Reference] [Example] character is desired, use c1 = c2. • If c2 < c1, the command is not executed. • d is the dot data for the characters. The dot pattern is in the horizontal direction starting from the left. Any remaining dots on the right remain blank. • The data to define a user-defined character is (x x y) bytes. • To print a dot, set the corresponding bit to 1; to not have it print, set to 0.
KPM54 Emulation [Reference] [Example] $1D $50 $1B $2A Printers: KPM150 [Name] [Format] Select bit image mode ASCII ESC * m nL nH d1...dk Hex 1B 2A m nL nH d1...dk Decimal 27 42 m nL nH d1...
KPM54 Emulation [Example] $1B $2D Printers: KPM150 [Name] [Format] Turn underline mode on/off ASCII ESC n Hex 1B 2D n Decimal 27 45 n 0≤n≤2 48 ≤ n ≤ 50 Turns underline mode on or off, based on the following values of n: n = 0, 48 Turns off underline mode n = 1, 49 Turns on underline mode (1-dot thick) n = 2, 50 Turns on underline mode (2-dot thick) • The printer can underline all characters, but cannot underline the space and right-side character spacing.
KPM54 Emulation $1B $33 Printers: KPM150 [Name] [Format] Set line spacing ASCII ESC 3 n Hex 1B 33 n Decimal 27 51 n 0 ≤ n ≤ 255 Sets line spacing to [ n × (vertical or horizontal motion unit)] inches. • The horizontal and vertical motion unit are specified by $1D $50. Changing the horizontal or vertical motion unit does not affect the current line spacing. • The $1D $50 command can change the horizontal (and vertical) motion unit.
KPM54 Emulation BIT OFF/ON HEX Decimal Off 00 0 Printer Disabled 0 [Notes] [Default] [Reference] [Example] FUNCTION On 01 1 Printer Enabled 1 - - - Undefined. 2 - - - Undefined. 3 - - - Undefined. 4 - - - Undefined. 5 - - - Undefined. 6 - - - Undefined. 7 - - - Undefined. • When the printer is disabled, it ignores all transmitted data until the printer is enabled through this command.
KPM54 Emulation $1B $44 Printers: KPM150 [Name] [Format] Set horizontal tab positions ASCII ESC D n1...nk NUL Hex 1B 44 n1...nk $00 Decimal 27 68 n1...nk 0 1 ≤ n ≤ 255 0 ≤ k ≤ 32 Sets horizontal tab positions • n specifies the column number for setting a horizontal tab position calculated from the beginning of the line. • k indicates the total number of horizontal tab positions to be set. • The horizontal tab position is stored as a value of [character width x n] measured from the beginning of the line.
KPM54 Emulation $1B $47 Printers: KPM150 [Name] [Format] Turn double-strike mode on/off ASCII ESC G n Hex 1B 47 n Decimal 27 71 n 0 ≤ n ≤ 255 Turns double-strike mode on or off. • When the LSB of n is 0, the double-strike mode is off. • When the LSB of n is 1, the double-strike mode is on. • Only the LSB of n is effective. • Printer output is the same in double-strike and emphasized mode.
KPM54 Emulation HEX [Default] [Reference] [Example] n CHARACTER SER 0 U.S.A.
KPM54 Emulation [Notes] [Default] [Reference] [Example] • Any setting that exceeds the printable area is ignored. • When the starting position is specified by n motion units to the right: nL + nH × 256 = n • When the starting position is specified by n motion units to the left (negative direction), use the complement of 65536: nL + nH × 256 = 65536 – n • If setting exceeds the printing area width, the left or right margin is set to the default value.
KPM54 Emulation [Default] [Reference] [Example] • On the printer, the panel buttons are LINE FEED and FORM FEED. • When the keys panel is disabled, the keys may only be used after the printer has been reset. • When the panel buttons are disabled, is possible to know the status through the $10 $04 command. n=0 $10 $04 $1B $64 Printers: KPM150 [Name] [Format] Print and feed paper n rows ASCII ESC d n Hex 1B 64 n Decimal 27 100 n 0 ≤ n ≤ 255 Prints the data in the print buffer and feeds the paper n rows.
KPM54 Emulation [Notes] [Default] [Reference] [Example] n=0 See character code tables, $1C $65, $1C, $66 $1B $76 Printers: KPM150 [Name] [Format] Transmit paper sensor status ASCII ESC v Hex 1B 76 Decimal 27 118 [Range] [Description] [Notes] When this command is received, transmit the current status of the paper sensor. • This command is executed immediately, even when the data buffer is full (Busy ).
KPM54 Emulation $1B $7B Printers: KPM150 [Name] [Format] Turn upside-down printing mode on/off ASCII ESC { n Hex 1B 7B n Decimal 27 123 n 0 ≤ n ≤ 255 Turns upside-down printing mode on or off. • When the LSB of n is 0, the upside-down printing mode is off. • When the LSB of n is 1, the upside-down printing mode is on. • Only the LSB of n is effective. • This command is valid only if entered at the beginning of a line.
KPM54 Emulation [Reference] [Example] $1B $21 $1D $3A Printers: KPM150 [Name] [Format] Set start/end of macro definition ASCII GS : Hex 1D 3A Decimal 29 58 [Range] [Description] [Notes] [Default] [Reference] [Example] Starts or ends macro definition. • Macro definition starts when this command is received during normal operation. • When $1D $5E is received during macro definition, the printer ends macro definition and clears all definitions.
KPM54 Emulation $1D $43 $30 Printers: KPM150 [Name] [Format] Select counter print mode ASCII GS C 0 n m Hex 1D 43 30 n m Decimal 29 67 48 n m 0≤n≤5 m = 0, 1, 2, 48, 49, 50 Selects a print mode for the serial number counter. • n specifies the number of digits to be printed as follows: when n = 0, the printer prints the actual digits indicated by the numeric value. when n = 1 to 5, the command sets the number of digits to be printed.
KPM54 Emulation [Default] [Reference] [Example] • When this command is executed, the internal count that indicates the repetition number specified by r is cleared. aL = 1, aH = 0, bL = 255, bH = 255, n = 1, r = 1 $1D $43 $30, $1D $43 $32, $1D $43 $3B, $1D $63 $1D $43 $32 Printers: KPM150 [Name] [Format] Set counter ASCII GS C 2 nL nH Hex 1D 43 32 nL nH Decimal 29 67 50 nL nH 0 ≤ nL, nH ≤ 255 Sets the serial number counter value.
KPM54 Emulation [Default] [Reference] [Example] • In setting count-down mode, the maximum value of the counter is sa and the minimum value is sb. If counting down reaches a value less than the minimum, it resets to the maximum value. If the counter value set by sc is outside the counter operation range, the counter value is forced to convert to the maximum value by executing $1D $63. • Parameters sa to sc can be omitted. If omitted, they remain unchanged.
KPM54 Emulation n = 2, 50 Type ID BIT OFF/ON HEX Decimal 0 Off 00 0 2-byte characters codes not supported 1 2 [Notes] FUNCTION Off 00 0 Autocutter not supplied On 02 2 Autocutter supplied Off 00 0 Thermal paper w/o label On 04 4 Thermal paper label 3 - - - Undefined 4 Off 00 0 Not used. Fixed to Off 5 - - - Undefined 6 - - - Undefined 7 Off 00 0 Not used. Fixed to Off • This command is executed when the data is processed in the data buffer.
KPM54 Emulation $1D $50 Printers: KPM150 [Name] [Format] Set horizontal and vertical motion units ASCII GS P x y Hex 1D 50 x y Decimal 29 80 x y 0 ≤ x, y ≤ 255 Sets the horizontal and vertical motion units to 1/x inch and 1/y inch respectively. When x is set to 0, the default setting value is used. When y is set to 0, the default setting value is used. • The horizontal direction is perpendicular to the paper feed direction.
KPM54 Emulation [Default] [Reference] [Example] If Font A : nL = 192 If Font B : nL = 164 $1D $4C, $1D $50 nH = 1 nH = 1 $1D $5E Printers: KPM150 [Name] [Format] Execute macro ASCII GS ^ r t m Hex 1D 5E r t m Decimal 29 94 r t m 0 ≤ r, t ≤ 255 0≤m≤1 Executes a macro. • r specifies the number of times to execute the macro. • t specifies the waiting time for executing the macro. The waiting time is t × 100 msec. for each macro execution.
KPM54 Emulation • In count-down mode, if the counter value set by this command goes out of the counter operation range set by $1D $43 $31 or $1D $43 $3B; it is forced to revert to the maximum value. [Default] [Reference] [Example] $1D $43 $30, $1D $43 $31, $1D $43 $32, $1D $43 $3B $1D $66 Printers: KPM150 [Name] [Format] Select font for HRI characters ASCII GS f n Hex 1D 66 n Decimal 29 102 n n = 0, 1, 48, 49 Selects a font for the HRI characters used when printing a bar code.
KPM54 Emulation [Description] Selects a bar code system and prints the bar code. m selects a bar code system as follows: n o m BARCODE SYSTEM No.
KPM54 Emulation • The printer prints an HRI character ( n ) as a control character ( $00 to $1F and $7F). When CODE128 is used: • When using CODE128 in this printer, please note the following regarding data transmission: • The top part of the bar code data string must be a code set selection character (CODE A, CODE B or CODE C) which selects the first code set. • Special characters are defined by combining two characters “{“ and one character.
KPM54 Emulation $1D $77 Printers: KPM150 [Name] [Format] Set bar code width ASCII GS w n Hex 1D 77 n Decimal 29 119 n 2≤n≤6 Sets the horizontal size of the bar code. n specifies the bar code width as follows: [Range] [Description] [Notes] [Default] [Reference] [Example] n MODULE WIDTH (mm) 2 0.25 3 0.375 4 0.5 5 0.625 6 0.75 n=3 $1D $6B $1D $7C Printers: KPM150 [Name] [Format] Set printing density ASCII GS {} n Hex 1D 7C n Decimal 29 124 n 0 ≤ n ≤ 4, 48 ≤ n ≤ 52 Sets printing density.
KPM54 Emulation [Notes] [Default] [Reference] [Example] n FUNCTION 0, 48 Subscript character position 1, 49 Superscript character position • This command is executed if there are characters of different height on the same line.
KPM54 Emulation [Description] [Notes] Reading of length (cm) of printed paper. The command return a string pointing out how much paper is printed, for example if the printer has print about 62,3 m, it will be: ‘6230cm’ [Default] [Reference] [Example] $1D $E5 Printers: KPM150 [Name] [Format] Reading number of power up ASCII GS {} Hex 1D E5 Decimal 29 229 [Range] [Description] [Notes] Reading number of power up of the printer.
KPM54 Emulation $1D $F2 Printers: KPM150 [Name] [Format] Set the discrimination level of the alignment notch ASCII GS {} n m Hex 1D F2 n m Decimal 29 242 n m 0 ≤ n ≤ 50 0 ≤ m ≤ 50 This command sets the discrimination level of the alignment notch as it follows: n identifies the voltage level below which the sheet is considered blank from marker sensor in the auto-calibration phase m identifies the voltage level above which the sensor identifies the marker. • The levels are expressed in tenths of volt.
KPM54 Emulation • In the $10 $04 n command, with n = 17, the fourth bit of the returned byte, identifies that the notch alignment procedure is in running, while the seventh bit points out a possible timeout error of marker research. • Once the ticket is aligned at the notch, the motor performs m steps defined by $1D $F7 command.
Commands Index 5 COMMANDS INDEX ESC/POSTM EMULATION $08............................................................................7 $09............................................................................7 $0A ...........................................................................7 $0D ...........................................................................8 $10 $04 n..................................................................8 $1B $20 n .................................................
Commands Index KPM54 EMULATION $08..........................................................................63 $09..........................................................................63 $0A .........................................................................63 $0D .........................................................................64 $10 $04...................................................................64 $18..........................................................................
Commands Index Blank page 100 Command Reference
Part Number : DOMC-0022E_1.00 CUSTOM ENGINEERING SPA World Headquarters Via Berettine, 2 - 43010 Fontevivo, Parma ITALY Tel. +39 0521 680111 - Fax +39 0521 610701 info@custom.biz - www.custom.biz All rigths reserved www.custom.