ESC/POS ESC/POS ESC/POS ESC/POS CONFIDENTIAL ESC/POS EPSON ESC/POS ESC/POS ESC/POS ESC/POS ESC/POS RP-U420 Application Programming Guide CLICK HERE for “About This Manual” CLICK HERE for “Confidentiality Agreement” EXIT
ESC/POS ESC/POS ESC/POS ESC/POS CONFIDENTIAL ESC/POS EPSON ESC/POS ESC/POS ESC/POS ESC/POS ESC/POS RP-U420 Application Programming Guide Version 1.0 Seiko Epson Corporation System Device Division Notice: The contents of this manual are subject to change without notice EPSON and ESC/POS are registered trademarks of Seiko Epson Corporation. Acrobat® Reader™ copyright ©1997–1999 Adobe Systems Incorporated. All rights reserved. Adobe and Acrobat are trademarks of Adobe Systems Incorporated.
ESC/POS EPSON ESC/POS ESC/POS ESC/POS ESC/POS ESC/POS ESC/POS ESC/POS ESC/POS ESC/POS CONFID ENTIAL Confidentiality Agreement BY USING THIS DOCUMENT, YOU AGREE TO ABIDE BY THE TERMS OF THIS AGREEMENT. PLEASE RETURN THIS DOCUMENT IMMEDIATELY IF YOU DO NOT AGREE TO THESE TERMS. This document contains confidential, proprietary information of Seiko Epson Corporation or its affiliates. You must keep such information confidential.
CONFIDENTIAL ■ ■■ ■■ ■ more Usable application programs and tips USABLE APPLICATION PROGRAMS AND TIPS System Processing This example illustrates ESC/POS command functions and printing results. Item 2-1 shows a combination of receipt and journal printing. Item 2-2 shows processing to issue a Taiwan receipt. Tips include features of stamp printing and usage of the ESC o command. Note: Print samples are images of the printing results of the program samples. They do not represent the actual printing.
CONFIDENTIAL ■ ■■ ■■ ■ Print Sample Receipt Journal Stamp ← Date and Time July 6, 2000, 10:30 RP-U420 PS-170 TOTAL 420 170 590 PAID CHANGE 600 10 Item A July 6, 2000, 10:30 RP-U420 PS-170 TOTAL #12345 420 170 590 Item A Item B #12345 ← Cutting position RP-U420 Usable application programs and tips Ver. 1.0 p.
CONFIDENTIAL ■ ■■ ■■ ■ more System Processing Procedures Procedure Commands used Description 1. Initialization ESC @ Executes initialization. 2. Print date and time ESC c 0, ESC z RS, LF Prints different data on receipt and journal. Jumps to the print position on journal (journal tab). 3. Print Item A ESC z, LF Prints Item A. ESC z a parallel printing for the same data on both receipt and journal. 4. Execute a stamp for the next receipt ESC c 0, ESC o Executes a stamp for the next receipt.
CONFIDENTIAL ■ ■■ ■■ ■ Programming Example PRINT #1, CHR$(&H1B);"@"; ← Initializes PRINT #1, CHR$(&H1B);"c0";CHR$(3); PRINT #1, CHR$(&H1B);"z";CHR$(0); the printer ← Selects a print ← Cancels parallel PRINT #1, “July 6, 2000 10:30”;CHR$(&H1E); PRINT #1, “July 6, 2000 10:30 sheet printing on receipt and journal Prints date and time #12345”;CHR$(&HA);CHR$(&HA); ← Selects PRINT #1, CHR$(&H1B);"z";CHR$(1); parallel printing on receipt and journal PRINT #1, "RP-U420 420";CHR$(&HA); PRINT #1, "
CONFIDENTIAL ■ ■■ ■■ ■ more 2-2 Issuing Taiwan Receipt The example shows procedures and a program sample for issuing a Taiwan receipt, which has black marks. At first you need to set DIP Switch 1-8 (Printer mode selection) to On (Taiwan mode); then turn on the power.
CONFIDENTIAL ■ ■■ ■■ ■ more System Processing Procedures Procedure Commands used Description 1. Initialization ESC @ Executes initialization. 2. Print details ESC c 0, ESC z ESC d, LF Prints date, slip number, and details on both receipt and journal. ESC z executes parallel printing of the same data on both receipt and journal. 3. Execute a stamp for the next receipt ESC d, ESC o Executes a stamp for the next receipt. 4.
CONFIDENTIAL ■ ■■ ■■ ■ Programming Example PRINT #1, CHR$(&H1B);"@"; ← Initializes PRINT #1, CHR$(&H1B);"c0";CHR$(3); PRINT #1, CHR$(&H1B);"z";CHR$(1); ← Selects a print ← Selects parallel ← Feeds PRINT #1, CHR$(&H1B);”d”;CHR$(6); PRINT #1, “01-01-01 the printer sheet printing on receipt and journal 6-line Prints details #12345”;CHR$(&HA); PRINT #1, "RP-U420 420";CHR$(&HA); PRINT #1, "PS-170 170";CHR$(&HA); PRINT #1, "TOTAL 590";CHR$(&HA); PRINT #1, "----------------------------";CHR$(&HA);
CONFIDENTIAL ■ ■■ ■■ ■ more Tips RP-U420 has a stamp function. ESC o executes a stamp once. When printing a stamp, you need to set line spacing, depending on the position of each mechanism.
CONFIDENTIAL However, if you do the procedures above at the beginning of a receipt issue transaction, there will be space of about 14 lines above the stamp. As the program examples in this section show, if printing of a stamp for the second receipt is executed during the receipt printing for the first receipt, you can print a receipt without unnecessary spaces. If you use the autocutter, follow the steps below. 1.
CONFIDENTIAL ■ ■■ ■■ ■ more Definitions DEFINITIONS (1) Normal commands Normal commands are all the commands except real-time commands. The normal commands are stored in the receive buffer temporarily and then processed sequentially. (2) Real-time commands Real-time commands are the commands that consist of a DLE extension (such as DLE EOT or DLE ENQ). The realtime commands execute processing when received.
CONFIDENTIAL (11) Horizontal/vertical direction Horizontal direction is the direction which is perpendicular to the paper feed direction. Vertical direction is the paper feed direction.
CONFIDENTIAL ■ ■■ ■■ ■ more Character code tables CHARACTER CODE TABLES SP in a table represents space. See Using the character code tables for information on how to read these tables. Page 0 (PC437: U.S.A., Standard Europe) (International character set: U.S.A.) RP-U420 Character code tables Ver. 1.0 p.
CONFIDENTIAL ■ ■■ ■■ ■ Page 1 (Katakana) RP-U420 Character code tables Ver. 1.0 p.
CONFIDENTIAL ■ ■■ ■■ ■ Page 2 (PC850: Multilingual) RP-U420 Character code tables Ver. 1.0 p.
CONFIDENTIAL ■ ■■ ■■ ■ Page 3 (PC860: Portuguese) RP-U420 Character code tables Ver. 1.0 p.
CONFIDENTIAL ■ ■■ ■■ ■ Page 4 (PC863: Canadian-French) RP-U420 Character code tables Ver. 1.0 p.
CONFIDENTIAL ■ ■■ ■■ ■ Page 5 (PC865: Nordic) RP-U420 Character code tables Ver. 1.0 p.
CONFIDENTIAL ■ ■■ ■■ ■ Page 16 (WPC1252) RP-U420 Character code tables Ver. 1.0 p.
CONFIDENTIAL ■ ■■ ■■ ■ Page 17 (PC866: Cyrillic #2) RP-U420 Character code tables Ver. 1.0 p.
CONFIDENTIAL ■ ■■ ■■ ■ Page 18 (PC862: Latin2) RP-U420 Character code tables Ver. 1.0 p.
CONFIDENTIAL ■ ■■ ■■ ■ Page 19 (PC858: Euro) RP-U420 Character code tables Ver. 1.0 p.
CONFIDENTIAL Using the character code tables USING THE CHARACTER CODE TABLES The example below uses Page 0 (PC437) to illustrate the use of the character code tables. You can find the character "A" in Page 0 as follows: The decimal value for the character "A" is 65. Follow its column straight up to find the digits. Hexadecimal 4 Binary 0100 These numbers are the most significant bits of the ASCII code. Follow its row to the left to find the digits.
CONFIDENTIAL ■ ■■ ■■ ■ more RP-U420 supported commands RP-U420 SUPPORTED COMMANDS Command Classification Name Function type LF EXECUTING COMMAND Print and line feed PRINT COMMANDS 28 FF EXECUTING COMMAND Print and feed paper to print starting position PRINT COMMANDS 29 CR EXECUTING COMMAND Print and carriage return PRINT COMMANDS 30 RS EXECUTING COMMAND Journal tab PRINT POSITION COMMANDS 31 ESC ! SETTING COMMAND Select print mode(s) CHARACTER COMMANDS 32 ESC % SETTING COMM
CONFIDENTIAL Command Classification Name Function type Page ESC c 4 SETTING COMMAND Select paper sensor(s) to stop printing PAPER SENSOR COMMANDS 50 ESC c 5 SETTING COMMAND Enable/disable panel buttons PANEL BUTTON COMMAND 51 ESC d EXECUTING COMMAND Print and feed n lines PRINT COMMANDS 52 ESC f SETTING COMMAND Set validation paper waiting time PRINTING PAPER COMMANDS 53 ESC o EXECUTING COMMAND Stamp MECHANISM CONTROL COMMANDS 54 ESC p EXECUTING COMMAND Generate pulse MISCEL
CONFIDENTIAL Print commands LF EXECUTING COMMAND [Name] Print and line feed [Format] ASCII Hex Decimal [Range] None [Default] None [Description] Prints the data in the print buffer and feeds one line, using 4.2 mm {1/6"}. [Notes] This command sets the print position to the beginning of the line. LF 0A 10 Program Example RP-U420 Print Sample PRINT #1, "AAAAA"; CHR$(&HA); AAAAA PRINT #1, "BBBBB"; CHR$(&HA); BBBBB Print commands LF Ver. 1.0 p.
CONFIDENTIAL Print commands FF EXECUTING COMMAND [Name] Print and feed paper to print starting position [Format] ASCII Hex Decimal [Range] None [Default] None [Description] When DIP switch 1-7 is OFF (autocutter installed): When receipt is selected as the print sheet, prints the data in the print buffer and feeds to the next print starting position and cut (one point left uncut).
CONFIDENTIAL Print commands CR EXECUTING COMMAND [Name] Print and carriage return [Format] ASCII Hex Decimal [Range] None [Default] None [Description] Prints the data in the print buffer and does not feed the paper. [Notes] Sets the print starting position to the beginning of the line.
CONFIDENTIAL Print position commands RS EXECUTING COMMAND [Name] Journal tab [Format] ASCII Hex Decimal [Range] None [Default] None [Description] Moves the print starting position to the beginning of the print area for the journal. [Notes] This command is effective when all the following conditions are satisfied simultaneously: RS 1E 30 ■ Both receipt and journal are selected for the print sheet. ■ The parallel printing mode for receipt and journal is turned off.
CONFIDENTIAL Character commands ■ ■■ ■■ ■ ESC ! SETTING COMMAND [Name] Select print mode(s) [Format] ASCII Hex Decimal [Range] 0 ≤ n ≤ 255 [Default] n=0 [Description] Selects print mode(s) using n as follows: [Notes] RP-U420 more ESC 1B 27 ! 21 33 n n n Bit Off/On Hex Decimal Function 0 Off 00 0 Reserved 1 Off 00 0 Reserved 2 Off 00 0 Reserved 3 Off 00 0 Reserved 4 Off 00 0 Reserved 5 Off 00 0 Double-width mode not selected On 20 32 Double-width mod
CONFIDENTIAL Program Example Print Sample PRINT #1, CHR$(&H1B);"!";CHR$(0); "AA"; PRINT #1, CHR$(&H1B);"!";CHR$(32); "BB"; CHR$(&HA); ← PRINT #1, CHR$(&H1B);"!";CHR$(128); "AA"; PRINT #1, CHR$(&H1B);"!";CHR$(160); "BB"; CHR$(&HA); with underline AA: Normal BB, Double-width RP-U420 Character commands ESC ! Ver. 1.0 p.
CONFIDENTIAL Character commands ■ ■■ ■■ ■ ESC % more SETTING COMMAND [Name] Select/cancel user-defined character set [Format] ASCII Hex Decimal [Range] 0 ≤ n ≤ 255 [Default] n=0 [Description] Selects or cancels the user-defined character set. When the Least Significant Bit (LSB) is 0, the user-defined character set is canceled and the internal character set is enabled. When the LSB is 1, the user-defined character set is selected. [Notes] ■ Only the LSB of n is valid.
CONFIDENTIAL Program Example Program Example (continued) PRINT #1, CHR$(&H1B);"&";CHR$(2);"AC"; DATA &H18,&H00,&H00,&H00,&H3C,&H00,&H00,&H00 PRINT #1, CHR$(9); DATA &H7E,&H00,&H00,&H00,&H3C,&H00,&H00,&H00 FOR i=1 TO 2*9 DATA &H18,&H00 READ d: PRINT #1, CHR$(d); DATA &H18,&H00,&H00,&H00,&H24,&H00,&H00,&H00 NEXT i DATA &H42,&H00,&H00,&H00,&H24,&H00,&H00,&H00 PRINT #1, CHR$(9); DATA &H18,&H00 FOR i=1 TO 2*9 DATA &H00,&H00,&H10,&H00,&H20,&H00,&H5F,&H00 READ d: PRINT #1, CHR$(d); DATA &H00,&H00,
CONFIDENTIAL Character commands ■ ■■ ■■ ■ ESC & SETTING COMMAND [Name] Define user-defined characters [Format] ASCII Hex Decimal [Range] y=2 32 ≤ c1 ≤ c2 ≤ 126 0≤x≤9 0 ≤ d ≤ 255 k = c2 – c1 + 1 [Default] None [Description] Defines user-defined characters. • y specifies the number of bytes in the vertical direction [Notes] more ESC 1B 27 & 26 38 y c1 c2 [x1 d1 ... d(y × x1)] ... [xk d1 ... d(y × xk)] y c1 c2 [x1 d1 ... d(y × x1)] ... [xk d1 ... d(y × xk)] y c1 c2 [x1 d1 ... d(y × x1)] ...
CONFIDENTIAL ■ The defined downloaded characters are cleared in the following circumstances: • When deleted by ESC ? • When ESC @ is executed • When a hardware reset is executed or the power is turned off ■ No user-defined characters are defined in the initial state. ■ If any user-defined characters are not defined, the internal character set (built-in) is selected. ■ If ESC R n is executed, the user-defined characters that have been already defined are canceled.
CONFIDENTIAL Bit-image commands ■ ■■ ■■ ■ ESC ✻ more EXECUTING COMMAND [Name] Select bit-image mode [Format] ASCII Hex Decimal [Range] m = 16, 17 0 ≤ nL ≤ 255 0 ≤ nH ≤ 3 0 ≤ d ≤ 255 k = (nL + nH × 256) × 2 [Default] None [Description] Selects a bit-image mode using m for the number of dots specified by nL and nH, as follows: ESC 1B 27 ✻ 2A 42 m m m nL nL nL nH nH nH d1 ... dk d1 ... dk d1 ... dk Vertical Direction Max. Number of Dots [Notes] m Mode Number of Dots Min.
CONFIDENTIAL ■ ■■ ■■ ■ more ■ If an adjacent dot is specified for the bit image in double-density mode (m = 17), the right side of the adjacent dot is not printed. ■ This command is not affected by print modes (double width or underline). ■ After finishing processing the bit image, the printer returns to normal data processing mode. The next print starting position is located at the next dot of the last bit-image data.
CONFIDENTIAL d1 d3 d5 d7 d9 d11 d13 d15 d17....... MSB LSB MSB LSB d2 d4 d6 d8 d10 Program Example m=16: GOSUB bitimage9 ← 9-dot single-density m=17: GOSUB bitimage9 ← 9-dot double-density d12 d14 d16 d18.......
CONFIDENTIAL Mechanism control commands ESC < EXECUTING COMMAND [Name] Return home [Format] ASCII Hex Decimal [Range] None [Default] None [Description] Detects the home position again; then moves the print head to the standby position. ESC 1B 27 < 3C 60 Program Example PRINT #1, CHR$(&H1B);"<"; RP-U420 Mechanism control commands ESC < Ver. 1.0 p.
CONFIDENTIAL Miscellaneous commands ESC = SETTING COMMAND [Name] Select device [Format] ASCII Hex Decimal [Range] 1≤n≤3 [Default] n=1 [Description] Selects the device to which the host computer sends data, using n as follows: ESC 1B 27 = 3D 61 n n n n Function 1 Enables printer 2 Enables customer display 3 Enables printer and customer display ■ When the printer is disabled, it ignores all data except for real-time commands until it is enabled by this command.
CONFIDENTIAL Character commands ESC ? SETTING COMMAND [Name] Cancel user-defined characters [Format] ASCII Hex Decimal [Range] 32 ≤ n ≤ 126 [Default] None [Description] Deletes the user-defined character pattern that corresponds to the specified character code. • n specifies the character code corresponding to the user-defined character to be canceled ■ If a user-defined character has not been defined for the specified character code, the printer ignores this command.
CONFIDENTIAL Miscellaneous commands ESC @ EXECUTING COMMAND SETTING COMMAND [Name] Initialize printer [Format] ASCII Hex Decimal [Range] None [Default] None [Description] Clears the data in the print buffer and resets the printer mode to the mode that was in effect when the power was turned on. [Notes] ■ The data in the receive buffer is not cleared.
CONFIDENTIAL Character commands ■ ■■ ■■ ■ ESC R more SETTING COMMAND [Name] Select an international character set [Format] ASCII Hex Decimal [Range] 0 ≤ n ≤ 13 [Default] n=0 [Description] Selects an international character set n from the following table: ESC 1B 27 R 52 82 n n n ASCII code RP-U420 Hex 23 24 40 5B 5C 5D 5E 60 7B 7C 7D 7E Dec 35 36 64 91 92 93 94 96 123 124 125 126 n Country 0 U.S.A.
CONFIDENTIAL ■ If ESC R n is executed, the user-defined characters that are defined with ESC & are canceled.
CONFIDENTIAL Printing paper commands ■ ■■ ■■ ■ ESC c 0 more EXECUTING COMMAND SETTING COMMAND [Name] Select paper type(s) for printing [Format] ASCII Hex Decimal [Range] 1 ≤ n ≤ 3, n = 8 [Default] n=3 [Description] Selects the type of paper for printing, using n as follows: c 63 99 0 30 48 n n n Bit Off/On Hex Decimal Function 0 Off 00 0 Journal paper roll disabled On 01 1 Journal paper roll enabled Off 00 0 Receipt paper roll disabled On 02 2 Receipt paper roll enabl
CONFIDENTIAL ■ The printer waits for validation insertion until one of the following events occur: • A validation sheet is inserted • The wait time set by ESC f has passed • Hardware reset or power off • When DLE ENQ 3 is executed ■ When validation is set from enabled to disabled, the printer waits for removal of the validation sheet. ■ When the printer receives DLE ENQ 3 during the validation waiting state, the printing sheet will return to default (n = 3).
CONFIDENTIAL Paper sensor commands ESC c 3 SETTING COMMAND [Name] Select paper sensor(s) to output paper-end signals [Format] ASCII Hex Decimal [Range] 0 ≤ n ≤ 255 [Default] n =0 [Description] Selects the paper sensor(s) to output paper-end signals • Each bit of n is used as follows: c 63 99 n n n 3 33 51 Bit Off/On Hex Decimal Function 0 Off 00 0 Journal near-end sensor disabled On 01 1 Journal near-end sensor enabled Off 00 0 Receipt near-end sensor disabled On 02 2 R
CONFIDENTIAL Paper sensor commands ESC c 4 SETTING COMMAND [Name] Select paper sensor(s) to stop printing [Format] ASCII Hex Decimal [Range] 0 ≤ n ≤ 255 [Default] n=0 [Description] Selects the paper sensor(s) to use to stop printing when a paper end is detected, using n as follows: c 63 99 n n n 4 34 52 Bit Off/On Hex Decimal Function 0 Off 00 0 Journal near-end sensor disabled On 01 1 Journal near-end sensor enabled Off 00 0 Receipt near-end sensor disabled On 02 2 Rec
CONFIDENTIAL Panel button command ESC c 5 SETTING COMMAND [Name] Enable/disable panel buttons [Format] ASCII Hex Decimal [Range] 0 ≤ n ≤ 255 [Default] n=0 [Description] Enables or disables the receipt/journal feed buttons. • When the Least Significant Bit (LSB) of n is 0, the receipt/journal feed buttons are enabled • [Notes] ESC 1B 27 c 63 99 n n n 5 35 53 When the LSB of n is 1, the receipt/journal feed buttons are disabled ■ Only the LSB of n is valid.
CONFIDENTIAL Print commands ESC d EXECUTING COMMAND [Name] Print and feed n lines [Format] ASCII Hex Decimal [Range] 0 ≤ n ≤ 255 [Default] None [Description] Prints the data in the print buffer and feeds n × 4.23 mm {1/6"}. [Notes] ■ This command sets the print starting position to the beginning of the line.
CONFIDENTIAL Printing paper commands ESC f SETTING COMMAND [Name] Set validation paper waiting time [Format] ASCII Hex Decimal [Range] 0 ≤ t1 ≤ 15 0 ≤ t2 ≤ 64 [Default] t1 = 0, t2 = 10 [Description] Sets the time that the printer waits for validation paper to be inserted and the time from insertion of the validation paper to the start of printing. • t1 specifies the wait time for validation paper to be inserted as [t1 × 1] minutes.
CONFIDENTIAL Mechanism control commands ESC o EXECUTING COMMAND [Name] Stamp [Format] ASCII Hex Decimal [Range] None [Default] None [Description] Executes a stamp operation on the receipt. [Notes] ■ This command is enabled only when processed at the beginning of a line. ESC 1B 27 o 6F 111 ■ If a receipt is not selected as the paper source, this command is ignored.
CONFIDENTIAL Miscellaneous commands ESC p EXECUTING COMMAND [Name] Generate pulse [Format] ASCII Hex Decimal [Range] m = 0, 1, 48, 49 0 ≤ t1 ≤ 255 0 ≤ t2 ≤ 255 [Default] None [Description] Outputs the pulse specified by t1 and t2 to connector pin m as follows: [Notes] ESC 1B 27 p 70 112 m m m t1 t1 t1 m Function 0, 48 Drawer kick-out connector pin 2 1, 49 Drawer kick-out connector pin 5 t2 t2 t2 ■ The pulse ON time is [t1 × 2] ms, and the OFF time is [t2 × 2] ms.
CONFIDENTIAL Character commands ■ ■■ ■■ ■ ESC t SETTING COMMAND [Name] Select character code table [Format] ASCII Hex Decimal [Range] 0 ≤ n ≤ 5, 16 ≤ n ≤ 19, 254 ≤ n ≤ 255 [Default] n=0 [Description] Selects a page n from the character code table. ESC 1B 27 n n n t 74 116 n Character Code Table 0 PC437 (U.S.A.
CONFIDENTIAL Program Example Print Sample PRINT #1, CHR$(&H1B);"t";CHR$(0); ← Select page 0 GOSUB printing PRINT #1, CHR$(&H1B);"t";CHR$(1); ← Select page 1 GOSUB printing Page 0 END printing: FOR i=&H20 TO &H7F PRINT #1, CHR$(i); NEXT i Page 1 PRINT #1, CHR$(&HA); FOR i=&H80 TO &HFF PRINT #1, CHR$(i); NEXT i PRINT #1, CHR$(&HA); RETURN RP-U420 Character commands ESC t Ver. 1.0 p.
CONFIDENTIAL Character commands ■ ■■ ■■ ■ ESC z more SETTING COMMAND [Name] Turn parallel printing mode on/off for receipt and journal [Format] ASCII Hex Decimal [Range] 0 ≤ n ≤ 255 [Default] n = 1 (when DIP switch 1-8 is ON: Taiwan mode) n = 0 (when DIP switch 1-8 is OFF: standard mode) [Description] Turns parallel printing mode for receipt and journal on or off. When parallel printing mode is turned on, the printer prints the same data on both receipt and journal paper.
CONFIDENTIAL Program Example PRINT #1, CHR$(&H1B);"c0";CHR$(3); ←Select paper types (receipt and journal) PRINT #1, "AAAAAAAAAAAAAAAAAAAA"; PRINT #1, "BBBBBBBBBBBBBBBBBBBB";CHR$(&HA); PRINT #1, CHR$(&H1B);"z";CHR$(1); ←Turn on parallel printing mode PRINT #1, "CCCCCCCCCCCCCCCCCCCC"; PRINT #1, "DDDDDDDDDDDDDDDDDDDD";CHR$(&HA); Print Sample RP-U420 Print Sample AAAAAAAAAAAAAAAAAAAABBBBBBBBBB BBBBBBBBBB CCCCCCCCCCCCCCCCCCCCDDDDDDDDDD CCCCCCCCCCCCCCCCCCCCDDDDDDDDDD DDDDDDDDDD DDDD
CONFIDENTIAL Kanji commands FS & SETTING COMMAND [Name] Select Kanji character mode [Format] ASCII Hex Decimal [Description] Selects Kanji character mode. FS 1C 28 & 26 38 • Kanji character mode is selected when DIP switch 1-8 is ON (Taiwan mode). • Kanji character mode is canceled when DIP switch 1-8 is OFF (standard mode).
CONFIDENTIAL Kanji commands FS . SETTING COMMAND [Name] Cancel Kanji character mode [Format] ASCII Hex Decimal [Description] Cancels Kanji character mode. • Kanji character mode is selected when DIP switch 1-8 is ON (Taiwan mode). • [Notes] FS 1C 28 . 2E 46 Kanji character mode is canceled when DIP switch 1-8 is OFF (standard mode). ■ When the Kanji character mode is not selected, all character codes are processed one byte at a time as ASCII code.
CONFIDENTIAL Miscellaneous commands ■ ■■ ■■ ■ GS I EXECUTING COMMAND [Name] Transmit printer ID [Format] ASCII Hex Decimal [Range] 1 ≤ n ≤ 3, 49 ≤ n ≤ 51, 65 ≤ n ≤ 67, n = 69 [Default] None [Description] Transmits the printer ID specified by n as follows: RP-U420 more GS 1D 29 I 49 73 n n n n Printer ID Contents 1, 49 Model ID <2C>H 2, 50 Type ID See the table on the next page. 3, 51 Firmware version ID Depends on firmware version.
CONFIDENTIAL n = 2: Type ID [Notes] Bit Off/On Hex Decimal Function 0 On 01 1 Two-byte character code supported. 1 Off 00 0 Manual cutter installed. On 02 2 Autocutter installed. 2 Off 00 0 Reserved 3 Off 00 0 Reserved 4 Off 00 0 Not used. Fixed to Off 5 Off 00 0 Reserved 6 Off 00 0 Reserved 7 Off 00 0 Not used. Fixed to Off ■ The printer transmits the status after confirming the host is ready to receive data.
CONFIDENTIAL Mechanism control commands ■ ■■ ■■ ■ GS V more EXECUTING COMMAND [Name] Feed paper to the cutting position and cut it [Format] ➀ ➁ ASCII Hex Decimal ASCII Hex Decimal GS 1D 29 GS 1D 29 V 56 86 V 56 86 m m m m m m n n n [Range] ➀ 0 ≤ m ≤ 2, 48 ≤ m ≤ 50 ➁ 65 ≤ m ≤ 67, 0 ≤ n ≤ 255 [Default] None [Description] Cuts a receipt.
CONFIDENTIAL • When DIP switch 1-7 is ON (manual cutter installed), m specifies the paper cutting operation as follows: Printer Operation Mode m [Notes] Standard Mode Taiwan Mode 0, 48, 1, 49 No operation No operation 2, 50 No operation No operation 65, 66 Only feed receipt paper Only feed receipt paper to the preprint black mark position. ((10 + n) × 4.23 mm). If both receipt and journal are selected as the printing sheets, journal paper is also fed to the preprint black mark position.
CONFIDENTIAL RP-U420 Mechanism control commands GS V Ver. 1.0 p.
CONFIDENTIAL Status commands ■ ■■ ■■ ■ GS r EXECUTING COMMAND [Name] Transmit status [Format] ASCII Hex Decimal [Range] n = 1, 2, 49, 50 [Default] None [Description] Transmits the status specified by n, as follows: [Notes] GS 1D 29 r 72 114 n n n n Function 1, 49 Transmits paper sensor status 2, 50 Transmits drawer kick-out connector status ■ The printer transmits the status after confirming the host is ready to receive data.
CONFIDENTIAL Bit Off/On Hex Decimal Function 5 Off 00 0 Validation sensor: paper present On 20 32 Validation sensor: paper not present 6 Off 00 0 Reserved 7 Off 00 0 Fixed Drawer kick-out connector status (n = 2, 50) Bit Off/On Hex Decimal Function 0 Off 00 0 Drawer kick-out connector pin 3 is LOW On 01 1 Drawer kick-out connector pin 3 is HIGH 1,2,3 Off 00 0 Reserved 4 Off 00 0 Fixed 5,6 Off 00 0 Reserved 7 Off 00 0 Fixed Program Example for all prin
CONFIDENTIAL Status commands ■ ■■ ■■ ■ DLE EOT more EXECUTING COMMAND [Name] Real-time status transmission [Format] ASCII Hex Decimal [Range] 1 ≤ n ≤ 4, 6 [Default] None [Description] Transmits the selected printer status specified by n in real-time, according to the following parameters: n = 1: Transmit printer status n = 2: Transmit offline status n = 3: Transmit error status n = 4: Transmit paper roll sensor status n = 6: Transmit validation status • EOT 04 4 n n n n = 1: Printer status
CONFIDENTIAL • n = 2: Offline status Bit 0 1 2 3 4 5 6 7 • 4 5 6 7 RP-U420 Off/On Off On Off On Off On On Off On Off On Off Hex 00 02 00 04 00 08 10 00 20 00 40 00 Decimal 0 2 0 4 0 8 16 0 32 0 64 0 Function Not used. Fixed to Off. Not used. Fixed to On. Cover is closed. Cover is open. Paper is not being fed by using the FEED button. Paper is being fed by the FEED button. Not used. Fixed to On. No paper end stop. Printing is being stopped due to paper end. No error. Error occurs. Not used.
CONFIDENTIAL ■ ■■ ■■ ■ more Bit 2: This bit becomes “On” when home position detecting error or main motor lock-up error is occurs. Bit 7: When serial interface model and 7 bit data word length selected, this bit can not be transferred to the host. Bit 7 is different from the ESC/POS Specification. • n = 4: Paper roll sensor status Bit 0 1 2 3 4 5 6 7 Off/On Off On Off On Off On On Off On Off On Off Hex 00 02 00 04 00 08 10 00 20 00 40 00 Decimal 0 2 0 4 0 8 16 0 32 0 64 0 Function Not used.
CONFIDENTIAL • 4 5 6 7 [Notes] more n = 6: Validation status Bit 0 1 2 3 ■ ■■ ■■ ■ Off/On Off On Off On Off On On Off On Off Off Hex 00 02 00 04 00 08 10 00 20 00 00 Decimal 0 2 0 4 0 8 16 0 32 0 0 Function Not used. Fixed to Off. Not used. Fixed to On. Validation is not selected. Validation is selected. Not validation insertion waiting state. Within validation insertion waiting state. Not used. Fixed to On. Validation sensor does not detect paper. Validation sensor is detecting paper. Reserved.
CONFIDENTIAL ■ With a serial interface model, this command is executed even when the printer is offline, the receive buffer is full, or there is an error status. ■ With a parallel interface model, the printer cannot receive data when it is busy; therefore this command cannot be used under the following conditions. • • When DIP Switch 1-6 is On: receive buffer-full. When DIP Switch 1-6 is Off: receive buffer-full, offline, error status.
CONFIDENTIAL Miscellaneous commands ■ ■■ ■■ ■ DLE ENQ more EXECUTING COMMAND [Name] Real-time request to printer [Format] ASCII Hex Decimal [Range] 1≤n≤3 [Default] None [Description] Responds to a request from the host specified by n. The operations performed depend on the value of n, as follows: n = 1: Recover from an error and restart printing from the line where the error occurred. n = 2: Clear the receive and print buffers and recover from an error. n = 3: Cancel waiting for validation.
CONFIDENTIAL ■ DLE ENQ 1 restarts printing from the line where the error occurred. This command is available only for recoverable errors other than a print head temperature error. ■ DLE ENQ 2 enables the printer to recover from an error after clearing the data in the receive and print buffers. The printer retains the settings (from ESC!, ESC R, for example) that were in effect when the error occurred. Using DLE ENQ 2 and ESC @, the printer can be completely initialized.
CONFIDENTIAL Miscellaneous commands ■ ■■ ■■ ■ DLE DC4 more EXECUTING COMMAND [Name] Generate pulse at real-time [Format] ASCII Hex Decimal [Range] n=1 0≤m≤1 1≤t≤8 [Default] None [Description] Outputs the pulse specified by t to connector pin m as follows: DLE 10 16 DC4 14 20 n n n m m m t t t m Function 0 Drawer kick-out connector pin 2 1 Drawer kick-out connector pin 5 • [Notes] The pulse ON time is [t × 100] ms, and the OFF time is [t × 100] ms.
CONFIDENTIAL ■ This command should not be used within the data sequence of another command that consists of two or more bytes. If you attempt to transmit ESC ! n to the printer, but DLE DC4 105 interrupts before n is received, the code <10>H for DLE DC4 is processed as the code for ESC ! <10>H. ■ This command is enabled even when the printer is not selected by ESC =.