DPU-S445 SERIES THERMAL PRINTER TECHNICAL REFERENCE U00110811305
DPU-S445 SERIES THERMAL PRINTER TECHNICAL REFERENCE Document Number U00110811305 First Edition Second Edition Third Edition Forth Edition Fifth Edition Sixth Edition May 2008 July 2008 January 2009 June 2009 February 2010 July 2011 Copyright © 2008-2011 by Seiko Instruments Inc. All rights reserved. Seiko Instruments Inc. (hereinafter referred to as “SII”) has prepared this technical reference for use by SII personnel, licensees, and customers.
TABLE OF CONTENTS Section Page CHAPTER 1 TERMS USED IN THIS MANUAL CHAPTER 2 SPECIFICATIONS 2.1 PRINTER SPECIFICATIONS............................................................................................. 2-1 2.2 SPECIFIED THERMAL PAPER SPECIFICATIONS.......................................................... 2-3 2.2.1 Timing Mark for the Cut Paper Dimensions .................................................................. 2-4 2.2.2 Thermal Label Paper Dimensions...................................
6.5 COMMAND DESCRIPTION ............................................................................................. 6-18 6.5.1 Command Format ....................................................................................................... 6-18 6.5.2 Formatting Commands................................................................................................ 6-19 6.5.3 Line Spacing Commands ............................................................................................ 6-23 6.5.
Table Page TABLES Table 1-1 Character Types and Relationship between 1-byte and 2-byte Characters ................ 1-1 Table 2-1 Table 2-2 Table 2-3 General Specifications ................................................................................................. 2-1 Thermal Paper Provided by SII .................................................................................... 2-3 Specified Thermal Paper Specifications ......................................................................
Figure Page FIGURES Figure 1-1 Figure 1-2 Figure 1-3 Relationship between Input Buffer and Line Buffer .................................................... 1-1 Line Spacing ............................................................................................................... 1-2 Character Spacing ...................................................................................................... 1-2 Figure 2-1 Figure 2-2 Figure 2-3 Figure 2-4 Dimensions ......................................
CHAPTER 1 TERMS USED IN THIS MANUAL This chapter describes the terms used in this manual. INPUT BUFFER AND LINE BUFFER When the DPU-S445 (hereinafter it is referred to as “printer”) receives data (character codes and commands) from the host devices, it stores the data in the printer input buffer. The input buffer has a capacity of 4K bytes (4096 bytes). Then, the printer retrieves data from the input buffer. If data is character code, data is stored into the line buffer.
Line Spacing Line spacing is the space between the lines of printed characters (See Figure 1-2). ABC Line Spacing ABC Figure 1-2 Line Spacing This printer use a line thermal print mechanism, therefore, a paper feed step is necessary before printing characters or bit images. The line feed command with printing feeds the paper for height of characters or bit images. Therefore, a paper feed amount which is smaller than character or bit image height is ignored.
CHAPTER 2 SPECIFICATIONS 2.
Dimensions Paper Inlet Paper Outlet Unit Figure 2-1 Dimensions 2-2 : mm
2.2 SPECIFIED THERMAL PAPER SPECIFICATIONS Table 2-2 Thermal Paper Provided by SII Item Specifications Model TP-341L-1 Type Normal paper roll Paper width 112 Outside diameter 48mm max. Paper thickness 59 ±5 μm Printing surface of Paper roll Outside 0 -1.0 mm Table 2-3 Specified Thermal Paper Specifications Item Paper roll Paper mode *1 Cut paper Label paper Specifications PD160R-N Oji Paper Co., Ltd. TF50KS-E2D Nippon Paper Industries Co.
2.2.1 Timing Mark for the Cut Paper Dimensions 112 0 -1.0 9 min. 16 5 Insertion direction of paper 3 max.
(1) Example of use of the cut paper An example of use of the cut paper is shown Figure 2-2. (a) Set the function setting of Paper Mode to “Cut paper”. (b) Set the paper length as page length. (c) Insert the cut paper. (d) Print data within the printable area shown in Figure 2-3. (The position of print end must be at the position of 15mm or longer from the bottom edge of the paper.) (e) The cut paper is ejected by sending Form Feed command at the end of printing. Repeat steps (c) to (e).
2.2.2 Thermal Label Paper Dimensions 112 0 -1.0 110 6 8 20 to 250 ABCDEF 012345 abcdef Page length Label length Form Feed command To the beginning of the next label 3 Non-printing area b. Paper cut position Printing area a. Print start position ABCDEF 012345 abcdef Thermal label paper (surface) 12 3 max. 5 9 min.
(1) Example of use of thermal label paper An example of use of the thermal label paper is shown Figure 2-4. (a) Set the function setting of Paper Mode to “Mark Roll Paper”. (b) Insert the thermal label paper. (c) Set the page length as the length from the beginning of the current label to the beginning of the next label. (d) Set the skip amount (non-printing area) between labels. (e) Print data within the printable area. (f) Use Form Feed command to find the beginning of the next label.
2.3 SPECIFIED BATTERY PACK SPECIFICATIONS Item Specification Model BP-L0720-A1-E Available printing lines Battery Cycle Life *2 *1 10000 lines min. 300 cycles *1: 25C, character spacing is 4 dots, line spacing is 34 dots, TF50KS-E2D selection, print density is 100%, continuous printing with 'H' 1-byte characters, serial communication, fully charged with 8.4 V by specified battery charger. *2: 25C, charged in the printer with specified AC adapter, print ratio is 12.
2.4 PRECAUTIONS FOR USE Always print the two-dimensional bar code and ladder bar code (its bar is to be printed verticality to the printer) within 0 to 40°C to ensure the bar code's reading accuracy. The two-dimensional bar code and ladder bar code printing always requires the low speed mode to ensure its reading accuracy. Set the print speed to the low speed mode by using Motor Speed Select (GS 'E') command. The height of the ladder bar code requires over 10 mm to ensure its reading accuracy.
When using a Bluetooth interface, the radio environment around the printer may cause a failure in communications. This is due to the specifications of Bluetooth, which is a radio communications standard. When handling this product, be aware of static electricity. If the static electricity is discharged, this could case communication failure. When this problem occurs, disconnect the USB connector that is connected to the host device and wait few seconds before connect it again.
CHAPTER 3 INTERFACE This chapter describes 4 types of the interface specifications which are required to connect the host device with the printer. Irrespective of the interface used, amount of the input buffer in the printer is 4k bytes, and transmission buffer is 768 bytes. If the transmission buffer becomes the condition of the buffer full, the printer waits data processing until the buffer can be received data. Be aware that printing process does not performed in that meantime. 3.
(3) Connector 8 1 3260-8S3: HIROSE ELECTRIC CO., LTD. or equivalent (4) Examples of connection with the host device (a standard personal computer) Printer Host device Printer Host device N.C. 1 1 F.G N.C. 1 TXD 2 2 TXD TXD 2 2 RXD 3 3 RXD RXD 3 3 TXD DSR 4 4 RTS DSR 4 4 DTR GND 5 5 CTS GND 5 5 S.G DTR 6 6 DSR DTR 6 6 DSR CTS 7 7 S.
(6) Data transmission Busy control In Busy Control, the conditions which transmit status information to the host device from the printer are as follows; When CTS Control of function setting sets to Enable, the printer sends data from TXD after confirming CTS status as SPACE. When CTS Control of function setting sets to Disable, the printer sends data from TXD regardless of the condition of the host device.
3.2 USB INTERFACE SPECIFICATIONS (1) General specifications Item Specification USB Version Ver 2.0 conformity USB Printing class specification 1.1 Communication speed Full speed(12 Mbps) Communication protocol Bulk transfer (2) Pin assignment Pin No. Name I/O Function 1 Vbus - 2 D- I/O USB data signal 3 D+ I/O USB data signal 4 N.C.
3.3 INFRARED INTERFACE SPECIFICATIONS The printer can communicate with the host device through the infrared interface. The infrared interface used in the printer conforms to the physical layer standard (Ver 1.2) specified by the Infrared Data Association (IrDA). The printer supports the minimum infrared transmission functions as the second station specified by IrDA and BHT-Ir protocol specified by DENSO CORPORATION. 3.3.1 Physical Specifications Item Specification Transmission distance 0.2m max.
(3) Services supported by IrLMP 1. Connect service 2. Disconnect service 3. Data service A single LSAP address does not support multiple connections. furthermore, LSAP address 7 and 9 can not share the connection state. If multiple connections are requested, a disconnect request is transmitted and the printer waits until it receives a disconnect command.
(6) IrCOMM Supports 3-Wireraw, IrLPT, 3-Wire and 9-Wire. Flow control is performed only by the IrLAP layer when connecting with 3-Wireraw or LrLPT. Flow control is performed by the TinyTP layer when connecting with 3-Wire or 9-Wire. Xon/off control and line status control are not supported.
3.3.3 BHT-Ir Specifications The printer also supports BHT-Ir communication specified by DENSO CORPORATION. The printer can receive data from the 'BHT-6500' made by DENSO CORPORATION when Data Input Mode SWDIP2-1 and SWDIP2-2 is selected to BHT-Ir. The inherent processing of the printer for BHT-Ir communication is shown below: See BHT-Ir protocol specification for details of the protocol. (1) ID Printer ID: 3445H (fixed) (2) Text format Only text is valid.
3.4 BLUETOOTH INTERFACE SPECIFICATIONS Bluetooth-supporting model can perform wireless communication by Bluetooth communication function. When Data Input Mode of the function setting is set to Bluetooth/USB, internal Bluetooth module of the printer operates regardless of its communication. When using the printer at the place with radio limitations like a hospital or an airplane, set Data Input Mode of the function setting as Serial/USB or IrDA/USB to stop Bluetooth communication.
CHAPTER 4 FUNCTION SETTINGS 4.1 FUNCTION SETTING The communication method, a paper types, and so on can be preset in this printer. Preset these functions before using the printer. The function settings of the printer are stored in FLASH memory. Once these are set, these are stored until changing again. The function settings are specified through the software DIP switch (hereinafter referred to as SWDIP switch), SWDIP1 to 4. Details for settings of SWDIP 1 to 4 are described below.
4.1.1 Function Settings(SWDIP1) Table 4-1 Function Settings (SWDIP1) SWDIP 1-8 Data Control 1-7 Stop Bit 1-6 1-5 1-4 Value Function 0 1 Xon/Xoff Busy 2 bits 1 bit Parity See table below Bit Length 7 bits 8 bits 1-3 1-2 Baud Rate See table below 1-1 Data Control selection Select flow control in serial communication as BUSY (hardware) control or Xon/Xoff control. In BUSY control, flow control is performed using RTS signal in the printer.
Baud Rate selection Select Baud Rate of communications as Serial and BHT-Ir. Baud Rate SWDIP1-3 SWDIP1-2 SWDIP1-1 1200 *1 0 0 0 2400 0 0 1 0 1 0 9600 0 1 1 19200 1 0 0 38400 1 0 1 57600 1 1 0 115200 1 1 1 4800 *1 *1 This setting is enabled only when Serial is selected as the communication mode. When BHT-Ir is selected as the communication mode, the baud rate is set to 2400 bps automatically.
4.1.
Data Input Mode selection Select the communication method. Refer to CHAPTER 3 INTERFACE for more detail. Data Input Mode SWDIP2-2 SWDIP2-1 BHT-Ir/USB 0 0 Serial/USB 0 1 1 0 1 1 IrDA/USB Bluetooth/USB *1 *1 This setting is enabled for Bluetooth-supporting model only. Bluetooth-supporting model is shipped with this setting value (Bluetooth/USB).
4.1.3 Function Settings(SWDIP3) Table 4-3 Function Settings (SWDIP3) SWDIP 3-8 3-7 3-6 Value Function 0 1 Reserved Fix to 1 Print Density See table below Paper Select See table below Paper Mode See table below 3-5 3-4 3-3 3-2 3-1 Print Density selection Normally, select the print density as 100%.
Paper Mode selection Select Paper Mode as the thermal paper in use. Paper Mode SWDIP3-2 SWDIP3-1 Cut Paper 0 0 Roll Paper 0 1 Mark Roll Paper 1 0 Reserved 1 1 (1) Cut Paper mode This mode assumes that to print the thermal paper which be cut by a certain fixed length. The paper should be printed the mark on back side to detect paper position when loading the paper automatically. Refer to 2.2 SPECIFIED THERMAL PAPER SPECIFICATION for the paper dimensions.
4.1.
Bluetooth Baud Rate selection Select Bluetooth Baud Rate in Bluetooth communication. Usually, select Bluetooth baud rate to 230400bps. Bluetooth Baud Rate SWDIP4-4 SWDIP4-3 230400 bps 0 0 57600 bps 0 1 115200 bps 1 0 230400 bps 1 1 CTS Control selection When CTS Control selection sets to Enable and Data Control SWDIP1-8 is selected to Busy, the printer transmits data after identifying CTS of the host device as SPACE.
4.1.5 Function Settings by Switch Operation A function setting can be performed by switch operation. Use the function settings by switch operation in the function settings mode of the printer. Operate the following procedures to enter the printer to the function settings mode. (a) Be sure that the thermal paper is set to the printer and the printer is turned off. If the thermal paper is not set, set the thermal paper to the printer.
(1) Initializing SWDIP switch settings (a) When the following message is printed in the function setting mode, press the FEED switch. Load Default Setting? Yes: Feed SW / No: Power SW (b) When the following message is printed, the printer turns off. The settings are set to defaults. Initialization is complete. Default Setting Saved. Setting Mode Finished. (2) Changing SWDIP switch settings (a) When the following message is printed in the function setting mode, press the POWER switch.
Operation 1: SWDIP switch selection (a) If pressing the FEED switch after printing the message shown below, the function setting shifts (operation 2). If pressing the POWER switch instead of the FEED switch, the details of the printed SWDIP switch (SWDIP switch 1) are not changed, and the next SWDIP switch is selected (operation 1). DIP Switch setting mode. DIP SW-1=******** Change Setting? Yes: Feed SW / No: Power SW Hint "********" in the message indicates the setting of the SWDIP switch.
Operation 3: Exiting function setting mode (a) If pressing the FEED switch after printing the message shown below, the function setting shifts (operation 1). DIP Switch setting mode. Continue: Feed SW / Quit: Power SW If pressing the POWER switch after printing the message shown below, the printer exits the function setting mode and turns off. The function setting is now complete. Setting Mode Finished. 4.1.
4.2 TEST PRINT The printer has a test print function that prints the contents of Function Settings and character strings for test. (a) Be sure that the thermal paper is set to the printer and the printer is turned off. If the thermal paper is not set, set the thermal paper to the printer. (b) Press the POWER switch and the FEED switch on the printer at the same time until the POWER lamp lights, release the POWER switch first and then the FEED switch second. (c) The test print is performed.
4.3 HEX DUMP MODE This function can be used to check whether the host device transmits data to the printer correctly. Perform the following steps. (a) Be sure that the thermal paper is installed to the printer and the printer is turned off. (b) Keep on pressing the POWER and FEED switches in six seconds. (c) Release the POWER and FEED switches after blinking the POWER and ERROR lamps. (d) Press the POWER switch after printing the message below.
CHAPTER 5 LAMP DISPLAY AND SWITCH FUNCTION This chapter explains printer status by lamp display and functions of switches. 5.1 PRINTER STATE LAMP DISPLAY Table 5-1 lists states of the printer, display that by two lamps (POWER and ERROR lamps).
5.2 ERROR RECOVERY PROCEDURE When an error occurs, the printer stops printing operation. Moreover, when Busy Output When Error Occurs is enabled in the Function Settings, the status of data reception becomes busy. However, Some errors can be recovered to a status just before a printing stop after clearing errors. Error recovery procedure is shown below. In this case, the printer resumes the printing from next line or next dot line a print stopped.
5.3 POWER SWITCH Turning ON / OFF the printer and changing the mode to the print-ready can be performed by the POWER switch. (NOTE) Always use the POWER switch to turn off the printer. Do not power off the printer by removing the AC adapter or the battery pack. If doing so, the memory may be damaged. 5.4 FEED SWITCH The paper can be fed by the FEED switch. The action differs depending upon SWDIP3-1 to 3-2 of the function settings.
CHAPTER 6 COMMAND DESCRIPTIONS This chapter describes the functions of the commands supported by the printer. 6.1 THE SUMMARY OF COMMAND FUNCTION The printer supports the ESC/P based commands.
Table 6-1 Command Summary (2/4) Command Function Page ESC 'R' Select International Character 6-31 ESC 't' Select Character Code Table 6-31 DC2 'y' Euro Character Specify 6-32 ESC '%' Set/Cancel Download Character Set 6-34 ESC '&' Define Download Characters 6-34 DC2 'D' Download Characters Area Operation 6-35 SO Select Expanded Character Mode with Automatic Cancellation 6-36 DC4 Cancel Expanded Character Mode with Automatic Cancellation 6-36 ESC 'W' Select/Cancel Expanded Characte
Table 6-1 Command Summary (3/4) Command Function Page DC3 '+ Ruler Line ON 6-62 DC3 '-' Ruler Line OFF 6-62 DC3 'A' Ruler Line Buffer A 6-62 DC3 'B' Ruler Line Buffer B 6-62 DC3 'C' Ruler Line Buffer Clear 6-63 DC3 'D' Define Ruler Line by Dot 6-63 DC3 'F' Define Ruler Line with Repeating Patterns 6-63 DC3 'L' Define Ruler Line by Line 6-63 DC3 'V' Ruler Line LSB/MSB Image 6-64 DC3 'P' Print One dot Line after Printing Line Buffer Data 6-64 DC3 '(' Continuous Ruler Line Com
Table 6-1 Command Summary (4/4) Command Function Page DC2 '$' '1' Rectangle Print 6-90 DC2 '$' '2' Line Type Property 6-91 DC2 '$' '3' Line Width Property 6-91 DC2 '$' '4' Fill Property 6-91 DC2 'e' Enable/Disable Automatic Status Transmission 6-93 DC2 'r' Send Remaining Memory Capacity 6-93 DC2 'v' Send VP Voltage 6-94 DC2 'q' Send External RAM Checksum 6-94 DC2 'l' Send SWDIP Switch Settings 6-94 DC2 'j' Execute Response Request 6-95 DC2 'F' Select Character Font Size 6-
6.2 FUNCTION CODES One of the following control codes is attached to the beginning of each command. These control codes are also called function codes. HT(09H), LF(0AH), VT(0BH), FF(0CH), CR(0DH), SO(0EH), DC2(12H), DC3(13H), DC4(14H), CAN(18H), ESC(1BH), FS(1CH), GS(1DH) Function codes may or may not have parameters or image data. The number of bytes per command differs based on the type of command. Some commands are only 1 byte long, while some are up to several hundred bytes in length. 6.
- Second byte (If the first byte is 00H) 20H - 7EH: The codes are processed as 1-byte character in the Kanji ROM. 80H - FEH: The codes are processed as 1-byte character in the Kanji ROM. FFH: It differs from each character set. If the extended graphics character set or the katakana character set are selected, they are ignored with the first byte. If the Codepage 1252 is selected, it is processed as the character code.
(If the first byte is A1H to FDH) A1H - FEH: The codes are processed as the second byte of Korean. The other codes are ignored unless they are commands. The next data to be received is processed as the first byte. 6.3.2 Shift JIS Code System If the Shift JIS Code System is selected with the Kanji Code System Select command, Kanji characters can be printed with 2-byte character codes without entering the Kanji Mode Specify command.
(3) 2-byte character codes when mounting Korean character 2-byte character codes specify Korean or User-defined characters. - First byte A0H: User-defined character area. A1H - FDH: Korean characters area when selecting Korean. The other codes are ignored unless they are commands. The next data to be received is processed as the first byte. - Second byte (If the first byte is A0H) A1H - FEH: The codes are processed as the second byte of user-defined characters.
6.4 MEMORY Check remaining memory size when using optional fonts, routine command or stamp. Refer to this section to use those functions. 6.4.1 Extended RAM Memory (1) Memory area The printer has 232280 bytes of memory for User-defined characters, downloaded characters, optional fonts, routine command and stamp. Set or clear memory area for each function. Setting of the memory area means to create a partition for certain function exclusively.
(2) Capacity of memory size Allocated memory size depend on used function. User-defined character and downloaded character is allocated size of 9784 and 6248 bytes respectively. Optional fonts, routine function or stamp is allocated size of (number of data + Memory control Information). Moreover, registration of routine function and stamp requires the above-mentioned size per registration data.
When the command is normal and memory area has been allocated, but the bar code cannot be printed within printable area: The command is ignored. When the command is normal, memory area has been allocated and the bar code can be printed within printable area: The two-dimensional bar code is printed. The necessary empty capacity differs according to types and sizes of bar codes. (a) Used Memory Capacity of PDF417 The total empty area of area 1 to 4 shown in Table 6-5 is necessary for PDF417 print.
(b) Used Memory Capacity of QR Code The total empty area of area1 to 3 shown in Table 6-6 is necessary for QR Code print.
(c) Used Memory Capacity of Data Matrix The total empty area of area1 to 4 shown in Table 6-7 is necessary for Data Matrix print. For an example, when number of bar code data byte =20 and symbol size=22 (vertical) 22 (horizontal); Area1 = 20 bytes Area2 = 2230 bytes Area3 = (30+20+1) 2 = 102 bytes Area4-A = 1 (30+68) 2 = 196 bytes Area4-B= 33 {int[ 20 + 15 ] × 20 + int[ 22 + 15 16 16 ] }22 × 2 = 168 bytes Total = 2548 bytes (Area4 uses a value of Area4-A.
Table 6-8 Data Matrix Symbol Sizes Symbol size Map matrix size Number of the Code Word Vertical Horizontal Vertical Horizontal Data Error correction 10 10 8 8 3 5 12 12 10 10 5 7 14 14 12 12 8 10 16 16 14 14 12 12 18 18 16 16 18 14 20 20 18 18 22 18 22 22 20 20 30 20 24 24 22 22 36 24 26 26 24 24 44 28 32 32 28 28 62 36 36 36 32 32 86 42 40 40 36 36 114 48 44 44 40 40 144 56 48 48 44 44 174 68 52 52 48 48 204 8
(d) Used Memory Capacity of MaxiCode The total empty area of area1 to 2 shown in Table 6-9 is necessary for MaxiCode print. For an example, when number of bar code data byte=33; Area 1 = 33+1 = 34 bytes Area 2 = 7684 bytes Total = 7718 bytes (Empty area size is an even byte number.
6.4.2 FLASH Memory The printer stores data such as User-defined character, downloaded character, optional font, routine function, stamp and template data into FLASH memory. Of these data, User-defined character, downloaded character, optional font and template data can be used dedicated memory area. Moreover, FLASH memory has shared memory area as 256K byte user area for routine function and stamp. Data except template data stored into FLASH memory is used when that is not present into extended RAM.
When data storage and release are repeated, the memory state turns to the [4] state. To use the “Released state (Erasable state)” area again, execute the User Area Defragment (DC2 '*' '1') command. The [5] shows the memory state after the command is executed. Executing Remaining User Area Response (DC2'*' '2') command to check the current remaining area. Remaining Memory Response command in user area responds the current available amount of FLASH memory.
6.5 COMMAND DESCRIPTION Each command for the printer is described respectively. This section explains each command. 6.5.1 Command Format Each command is described in the following format.
6.5.2 Formatting Commands ESC 'C' n Code Set page Length at n Lines 1BH 43H n 1n127 Function Set page length at n lines. The page length is (current line spacing x n) dot lines. If the line spacing is zero, this command is ignored. The current position becomes the beginning of the page. The bottom margin set by ESC 'N' is canceled. If n = 0, the page length is set at n inches. This setting is canceled by Page Mode Select (DC2 'z' 0) command. Moreover, this command is ignored in the page mode.
ESC 'O' Code Cancel Bottom Margin 1BH 4FH Function Cancels bottom margin. If the page length is not specified in the initial state in the roll paper mode, this command is ignored. Default The bottom margin is canceled. Top of the page Printable area The defined page length The defined bottom margin Non-printable area ESC 'Q' n Code Set Right Margin 1BH 51H n 1n255 Function Sets the right margin at n columns from the left edge (first column).
ESC 'I' n Set Left Margin Code 1BH 6CH n 0n255 Function Sets the left margin at n columns from the left edge (first column). Column n (current character pitch x n) from the left edge becomes the left margin. The character width includes character spacing. The character width is also doubled in double-width setting. The character width is not calculated by double when Select expanded character mode with automatic cancellation (SO) command is selecting.
100 OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1 110 PRINT #1,"Page Length : 5 line" 120 PRINT #1,"Skip Length : 2 line" 130 PRINT #1,"Right Margin : 34 char" 140 PRINT #1,"Left Margin : 17 char" 150 PRINT #1,CHR$(&H0D); 160 PRINT #1,CHR$(&H1B);"C";CHR$(5); 170 PRINT #1,CHR$(&H1B);"N";CHR$(2); 180 PRINT #1,CHR$(&H1B);"Q";CHR$(34); 190 PRINT #1,CHR$(&H1B);"l";CHR$(17); 200 FOR I=&H20 TO &HFE 210 PRINT #1,CHR$(I); 220 NEXT I 230 PRINT #1,CHR$(&H0D); 240 CLOSE #1 250 END 'Page Length : 5 line 'Skip Length : 2 line
6.5.3 Line Spacing Commands ESC '0' Code Set 1/8-inch Line Spacing 1BH 30H Function Sets the line spacing amount to 1/8 of an inch (26 dots lines). If the line buffer contains data and the line spacing amount is smaller than the character height, the data in the buffer is printed and line feeding is performed by the character height. Default 34 dots lines Printer initial state after power-on can be changed by Set default/Set test print header (DC2 'i')command.
100 OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1 110 PRINT #1,CHR$(&H1B);"0"; 120 PRINT #1,"ESC+0 ----- 1/8 inch line space" 130 PRINT #1,CHR$(&H1B);"2"; 140 PRINT #1,"ESC+2 ----- 1/6 inch line space" 150 FOR I=0 TO 96 STEP 24 160 PRINT #1,CHR$(&H1B);"3";CHR$(I); 170 PRINT #1,"ESC+3+n -----";I;"dot-line line space" 180 NEXT I 190 PRINT #1,"---------------------------------------" 200 CLOSE #1 210 END Figure 6-3 Program Sample 2 Figure 6-4 Print Sample 2 6-24
6.5.4 Tab Setting Commands ESC 'B' {DATA} NUL Code Set Vertical Tab Positions 1BH 42H {p1 p2••• pk} 00H 1p255 0k16 Function Sets the vertical tab position. The tab position is the (current line spacing × p lines) dot position with respect to the page starting position. If the line spacing is zero, ESC 'B' is ignored and the subsequent data is processed as normal data. The positions, p, are input in ascending order and the command ends with 00H (NUL).
ESC 'D' {DATA} NUL Code Set Horizontal Tab Positions 1BH 44H {p1 p2•••pk} 00H 1p255 1k32 Function Sets horizontal tab positions. The tab position is the (current character with × p columns) position with respect to the left margin. The character width includes the character spacing. The character width is also doubled in double-width mode. The character width is not calculated by double when Select expanded character mode with automatic cancellation (SO) command is selecting.
6.5.5 Print and Paper Feed Commands CR Code Print and Carriage Return 0DH Function Functions the same as an LF command. If the line buffer contains data and the line spacing amount is smaller than the character height, the data in the buffer is printed and line feeding is performed by the character height. LF Code Print and Line Feed 0AH Function After data in the line buffer is printed out, the printer feeds one line.
ESC 'J' n Code Print and Feed Paper 1BH 4AH n 0n255 Function Prints the data in the print buffer and feeds the paper one dot line. If the line buffer contains data and n is smaller than the character height, the data in the line buffer is printed and one line is fed by the character height. If the line buffer contains data, the select expanded character mode with automatic cancellation selected by SO is canceled.
6.5.6 Print Position Commands HT Code Execute Horizontal Tab 09H Function Moves the print position to the next horizontal tab position. This command is ignored if the next horizontal tab position is not set. This command is ignored if the next horizontal tab position exceeds the right margin. The horizontal tab position is set using the ESC 'D' command. Default The default tab positions are at intervals of 8 characters.
100 OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1 110 PRINT #1,CHR$(&H1B);"2"; 120 PRINT #1,CHR$(&H1B);"C";CHR$(25); 130 PRINT #1,CHR$(&H1B);"B";CHR$(3);CHR$(6);CHR$(9);CHR$(12);CHR$(0); 140 PRINT #1,CHR$(&H1B);"D";CHR$(10);CHR$(20);CHR$(30);CHR$(0); 150 PRINT #1,"--------------- Page top ---------------" 160 PRINT #1,"Carrige Return + CR";CHR$(&H0D); 170 PRINT #1,"Line Feed + LF";CHR$(&H0A); 180 PRINT #1,"100 dot-line feed + ESC+J";CHR$(&H1B);"J";CHR$(100); 190 PRINT #1,"Vertical Tab + VT";CHR$(&H0B); 200 PRINT
6.5.7 1-byte Character Set Selection Commands ESC 'R' n Code Select International Character 1BH 52H n 0n12 Function n selects an international character set from the following table. n Country 0 U.S.A. 1 France 2 Germany 3 U.K. 4 Denmark l 5 Sweden 6 Italy 7 Spain 8 Japan 9 Norway 10 Denmark II 11 Spain II 12 Latin America The download characters and optional fonts are not affected by the international character sets. If n is selected out of range, this command is ignored.
DC2 'y' n Code Euro Character Specify 12H 79H n n=0, 32n254 (except 127) Function Exchanges the font of character code n of the one-byte system to Euro characters. When n is 0, the exchange to the Euro characters is released and the font returns before selection. Only one character code to be exchanged to Euro characters is available. When an exchange to Euro characters for other character code is performed, the last change to Euro characters for character code is released.
100 OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1 110 PRINT #1,CHR$(&H1B);"$";CHR$(&HD8);CHR$(0);"23 24 40 5B 5C 5D 5E 60 7B 7C 7D 7E" 120 FOR I=0 TO 12 130 RESTORE 310 140 FOR J=0 TO I 150 READ CNTRY$ 160 NEXT J 170 PRINT #1,CNTRY$;CHR$(&H1B);"$";CHR$(&HA8);CHR$(0);:GOSUB 250 180 NEXT I 190 FOR I=0 TO 1 200 PRINT #1,CHR$(&H1B);"t";CHR$(I); 210 PRINT #1,"#$%&01234567ABCDEFGabcdefg アイウエオ" 220 NEXT I 230 CLOSE #1 240 END 250 PRINT #1,CHR$(&H1B);"R";CHR$(I);" "; 260 PRINT #1,CHR$(&H23);" ";CHR$(&H24);" ";CHR$(&H40);
6.5.8 1-byte Characters Definition Commands ESC '%' n Code Set/Cancel Download Character Set 1BH 25H n Function Sets or cancels the download character set. Only the least significant bit of n is valid. n = 0: Cancel the download character set. n = 1: Set the download character set. When the download character set is set, it can be printed. When the download character set is input with undefined character code, the optional font or the selected internal character set is printed.
•24-dot font •16-dot font 16 dots d1 d4 8 dots d46 MSB d1 d3 d15 d2 d4 d16 MSB 16 dots 24 dots d2 d5 d47 d3 d6 d48 LSB LSB DC2 'D' n Code Download Characters Area Operation 12H 44H n Function Allocates or frees up the download character area. Only the least significant bit (LSB) of n is valid. n = 0: Frees up the download character area. n = 1: Allocates the download character area.
6.5.9 Character Decoration Commands SO Code Select Expanded Character Mode with Automatic Cancellation 0EH Function Prints 1-byte characters and 2-byte characters following this code in double-width characters. This mode is canceled by DC4, LF, VT, FF, ESC 'W', GS '<' or CR, or by buffer-full printing. When the line buffer is cleared, the expanded character mode is canceled.
ESC 'F' Code Cancel Emphasized Print Mode 1BH 46H Function Cancels the emphasized print mode for 1-byte characters and 2-byte characters. The emphasized print mode can also be selected or canceled with ESC '!', but the most recently processed command is effective. The double print mode is also canceled. ESC 'G' Code Select Double Print Mode 1BH 47H Function Selects the double print mode for 1-byte characters and 2-byte characters. Same as in emphasized print mode.
ESC '!' n Code Set Print Mode 1BH 21H n Function Sets a print mode for 1-byte characters. Each bit of n is used as follows: Bit Function n=0 n=1 0 Undefined - - 1 Undefined - - 2 Undefined - - 3 Emphasized printing Canceled Set 4 Double printing Canceled Set 5 Double-width Canceled Set 6 Undefined - - 7 Underline Canceled Set The underline is attached to all character widths, including character right-side spacing.
DC2 'Y' n Code Character Rotation 12H 59H n Function Selects the direction of rotation of 1-byte and 2-byte characters. Only two low-order bits are valid. n = 0: Cancel character rotation. n = 1: Rotate the character 90° clockwise. n = 2: Rotate the character 90° counterclockwise. n = 3: Ignore the command. If the character is decorated, the decorated character is rotated. Character decoration applies to a line.
6.5.10 Character Pitch Adjustment Command ESC SP n Code Set Character Spacing 1BH 20H n 0n127 Function Sets the character right-side spacing for 1-byte characters in dot units (n). If a character code is input after this command, it is printed with (character width + set character spacing). The character left-side spacing will be 0 dot. Only the seven significant bits of n are valid. n must be 0 to 127 dots. The character right-side spacing for double-width mode is twice the value set by this command.
100 OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1 110 PRINT #1,CHR$(&H12);"F0"; '16 dots font 120 PRINT #1,CHR$(&H1B);"&";CHR$(0);"DD"; 'D 130 RESTORE 460 : N=16 : GOSUB 430 140 PRINT #1,CHR$(&H12);"F1"; '24 dots font 150 PRINT #1,CHR$(&H1B);"&";CHR$(0);"oo"; 'o 160 RESTORE 480 : N=48 : GOSUB 430 170 PRINT #1,CHR$(&H1B);"%1"; 'Down Load Select 180 PRINT #1,CHR$(&H12);"F0";"16 dots Down Load Select" 190 PRINT #1,CHR$(&H12);"F1";"24 dots Down Load Select" 200 PRINT #1,CHR$(&HE);"DoubleWidth by SO" 210 PRINT #1,"Nor
Figure 6-10 Print Sample 5 6-42
6.5.11 Kanji Character Set Selection Commands FS '&' Code Select Kanji Mode 1CH 26H Function Selects Kanji mode. In Kanji mode, only 2-byte character codes are accepted. 1-byte character in SII Japanese font set (at shipping) can be printed by entering 00H + 1-byte code. This command is ignored when Shift-JIS is selected as the Kanji code system. Default Cancel Kanji mode. FS '.' Code Cancel Kanji Mode 1CH 2EH Function Cancels Kanji mode.
FS 'r' n Code Select Kanji Quarter Size Character Mode 1CH 72H n Function Selects Kanji quarter size character mode. Only the least significant bit of n is valid. n = 0: Superscript n = 1: Subscript Only the least significant bit of n is valid, and it can be set only in Kanji mode. When Kanji mode is ineffective, FS 'r' is ignored. If one of the following Kanji codes is input, a Kanji quarter size character is printed.
6.5.12 Kanji Character Definition Commands FS '2' c1 c2 {DATA} Code Define User-defined Character 1CH 32H c1 c2 {d1 d2•••dk} Function Defines a Kanji User-defined character pattern for the character code specified by c1 and c2. c1 and c2 indicate a Kanji code for the User-defined character to be defined. c1 indicates the first byte, and c2, the second byte. c1 and c2 depend on selected kanji code system or mounted font set, refer to 6.3 CHARACTER CODES for details.
DC2 'G' n Code User-defined Character Area Operation 12H 47H n Function Allocates or frees up the User-defined character area. Only the least significant bit (LSB) of n is valid. n = 0: Frees up the User-defined character area. n = 1: Allocates the User-defined character area. When the User-defined character area is freed up, the User-defined character is erased and the User-defined character definition commands are ignored. The User-defined character area after memory initialization is 9784 bytes.
6.5.13 Kanji Character Decoration Commands FS 'J' Code Select Vertical Writing 1CH 4AH Function Selects vertical writing. Valid in Kanji mode only. Character decoration applies to a line. If the vertically written character is doubled vertically, it is doubled in the Y direction (character widths are doubled). If the width is doubled, the character is doubled in the X direction (characters are doubled vertically). Default Horizontal writing.
FS '-' n Code Select/Cancel Kanji Underline Mode 1CH 2DH n Function Select or cancel underline mode. Only the low two bits of n is valid. n = 0: Cancel underline mode. n = 1: Select 1-dot underline mode. n = 2: Select 2-dot underline mode. n = 3: Ignore the command. The underline is attached to all printing characters, including character right-side spacing. However, the underline is not attached when skipped by HT or other commands.
FS '!' n Code Set Kanji Print Mode 1CH 21H n Function Sets a print mode for 2-byte characters.
6.5.14 Kanji Character Pitch Adjustment Command FS 'S' nl nr Code Set Kanji Left- and Right-side Spacing 1CH 53H nl nr 0nl127 0nr127 Function Sets the left-side spacing nl and the right-side spacing nr of 2-byte characters. Only the seven least significant bits of nl and nr are valid. Up to 127 dots can be set. The character spacing specified by this command does not apply to 1-byte characters. The character spacing for double-width mode is twice the value set by this command.
100 OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1 110 GJ$=CHR$(&H77)+CHR$(&H21) 120 PRINT #1,CHR$(&H12);"F0"; '16 dots font 130 PRINT #1,CHR$(&H1C);"2";GJ$; '7721H 140 RESTORE 570 : N=32 : GOSUB 540 150 PRINT #1,CHR$(&H12);"F1"; '24 dots font 160 PRINT #1,CHR$(&H1C);"2";GJ$; '7721H 170 RESTORE 600 : N=72 : GOSUB 540 180 FOR I=&H30 TO &H33 '2330~2333 190 K$=K$+CHR$(&H23)+CHR$(I) 200 NEXT I 210 FOR I=&H41 TO &H44 '2341~2444 220 K$=K$+CHR$(&H23)+CHR$(I) 230 NEXT I 240 FOR I=&H21 TO &H23 '3021~3024 250 K$=K$+CHR$(&H3
Figure 6-12 Print Sample 6 6-52
6.5.15 Image Command ESC '*' m nl nh {DATA} Code Set Bit Image Mode 1BH 2AH m nl nh {d1 d2•••dk} m: 0,1,32,33 (mode setting) 0nh×256+nl4095 Function Sets the bit image mode and prints bit image. m indicates the bit image mode. The bit image modes are related to the set bit images as shown below when the horizontal image width is 104mm (832 dots). m Vertical Mode Horizontal Dots Resolution Dots Resolution 0 8-dot single-density 8 2.7 dots/mm 416 4 dots/mm 1 8-dot double-density 8 2.
•8-dot mode d1 d2 d3 •24-dot mode MSB d1 d4 d7 MSB Bit image data d2 d5 d8 Bit image data d3 d6 d9 LSB LSB Print data Print data 6-54
GS 'v' '0' m xl xh yl yh {DATA} Code Raster Bit Image Print 1DH 76H 30H m xl xh yl yh {d1 d2•••dk} 0=0 or 48 0xh x 256 + xl 65535 0yh x 256 + yl 65535 Function Prints raster format dot images. xh, xl: specify the horizontal data by count of bytes. yh, yl: specify the vertical data by count of dots. The printer does not print data which exceeds right margin. Ignores this command when xhxl or yhyl is 0. Ignores the setting of page length or bottom margin.
100 OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1 110 D=408:N=D 120 PRINT #1,"8 dots Single-density 130 PRINT #1,CHR$(&H1B);"*";CHR$(0);CHR$(D MOD 256);CHR$(D\256); 140 GOSUB 260 150 N=D : PRINT #1,"8 dots Double-density 160 PRINT #1,CHR$(&H1B);"*";CHR$(1);CHR$(D MOD 256);CHR$(D\256); 170 GOSUB 260 180 N=D*3 : PRINT #1,"24 dots Single-density 190 PRINT #1,CHR$(&H1B);"*";CHR$(32);CHR$(D MOD 256);CHR$(D\256); 200 GOSUB 260 210 N=D*3 : PRINT #1,"24 dots Double-density 220 PRINT #1,CHR$(&H1B);"*";CHR$(33);CHR$(D MOD
6.5.16 Stamp Stamp function does overlap characters with predefined bit images and to print out them simultaneously. Since the memory stores the defined stamps unless initializing the user area of the memory or clearing the stamp, repeating print of the same stamp is possible without entering a large amount of data repeatedly. Create bit image in the rectangular area which is specified by a number of bytes in the horizontal direction and a number of dot lines in the vertical direction.
DC2 'T' n x yl yh {Image Data} Code Stamp Define 12H 54H n x yl yh {d1 d2•••dk} 0n127 1x127 1yhx256+yl2047 Function Specify the stamp images. Specify the stamp number between 00H and 7FH (0 to 127) to n. The stamp number is any number. Stamps are selected with this number. If the defined stamp number is specified, the predefined stamp is cleared and the memory area of the predefined stamp is freed up, then the new stamp is defined.
DC2 'S' n x Code Stamp Select 12H 53H n x 0n127 0x255 Function Selects stamp and specifies the printing position to the horizontal direction. n: Stamp number (00H to 7FH) x: Printing position in the horizontal direction (by 8 dots) (00H to FFH) x specifies the printing position to the horizontal direction. The printing position can be specified by 8 dots. The stamp is printed at the x × 8th dot position from the left edge of the printable area.
100 OPEN "COM1:9600,N,8,1" AS #1 110 S$=STRING$(20,CHR$(&HFF))+STRING$(6,CHR$(0))+STRING$(20,CHR$(&H55)) 120 PRINT #1,CHR$(&H12);"T";CHR$(10);CHR$(20);CHR$(160);CHR$(0); 130 FOR I=1 TO 20 : FOR J=0 TO 7 140 PRINT #1,MID$(S$,I+J,20); 150 NEXT J,I 160 PRINT #1,CHR$(&H12);"S";CHR$(10);CHR$(0); 170 GOSUB 290 180 PRINT #1,CHR$(&H12);"S";CHR$(10);CHR$(50); 190 GOSUB 290 200 PRINT #1,CHR$(&H12);"S";CHR$(10);CHR$(1); 210 PRINT #1," STAMP PRINT" 220 PRINT #1,CHR$(&H12);"W"; 230 PRINT #1," STOP STAMP" 240 PRINT #1,CH
6.5.17 Other Commands CAN Code Cancel Print Data in Buffer 18H Function Clears the data in the line buffer. The next print starting position is the beginning of the line (left margin).
6.5.18 Ruler Line Commands DC3 '+' Code Ruler Line ON 13H 2BH Function Turns on ruler line printing. After this command is input, the printer prints the contents of the ruler line buffer with a character print or paper feed command until the DC3 '-' command or DC3 'C' command is input. When characters are printed, characters and ruler lines are overlapped with each other in the mode specified by DC2 '#'. The ruler lines are not affected by the print area or print position setting.
DC3 'C' Code Ruler Line Buffer Clear 13H 43H Function Clears all bits in the selected line buffer to zero. If all bits in the selected line buffer are set to zero, the data is not printed even when the ruler line printing is turned on. Default Both ruler line buffers A and B are clear. DC3 'D' nl nh Code Define Ruler Line by Dot 13H 44H nl nh 0nh×256+nl4095 Function Sets to 1 the specified dot in the selected ruler line buffer. nl and nh specify the dot position.
DC3 'V' {DATA} Code Ruler Line LSB/MSB Image 13H 56H {d1 d2••• dk} 0d255 Function Writes one dot line of the image data into the selected ruler line buffer. The image data k corresponds to the line of dots in a ruler line buffer. When the page mode is not selected, number of image data is 104 bytes. In page mode, number of image data depends on its printing mode and page size.
100 OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1 110 PRINT #1,CHR$(&H13);"A"; 120 PRINT #1,CHR$(&H13);"V"; 130 PRINT #1,STRING$(52,CHR$(&H88)); 140 FOR I=1 TO 52 : PRINT #1,CHR$(I); : NEXT I 150 PRINT #1,CHR$(&H13);"+"; 160 PRINT #1,"RULED LINE OR" 170 PRINT #1,CHR$(&H12);"#1"; 180 PRINT #1,"RULED LINE XOR" 190 PRINT #1,CHR$(&H13);"("; 200 FOR I=0 TO 200 210 X=INT(SQR(40000!-I^2)):X1=415-X:X2=415+X 220 PRINT #1,"C"; 230 PRINT #1,"L";CHR$(X1 MOD 256);CHR$(X1\256);CHR$(160);CHR$(1); 240 PRINT #1,"D";CHR$(X2 MOD 25
6.5.19 Optional Font Commands DC2 'P' s e x y {DATA} Code Define Optional Font 12H 50H s e x y {d1 d2•••dk} 20HseFEH s7FH, e7FH 8x127 1y48 0d255 Function Defines an optional font. s and e specify a definition start character code and a definition end character code of the optional font. If only one character is input, s=e. If the area from s to e contains 7FH, the 00H for one character of data must be input for 7FH.
x 20 dots 1 2 3 4 5 6 58 59 60 y 20 dots * shadow area is ignored Order of Optionnal font data input (x=20、y=20) Default No definition. DC2 'O' n Code Select Optional Font 12H 4FH n Function Selects an optional font. Only the least significant bit of n is valid. n = 0: Cancel the optional font. n = 1: Select the optional font. If the optional font is selected, the character codes for which the optional font was defined are printed with the font.
100 OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1 110 SCD=&H41:ECD=&H45 120 PRINT #1,CHR$(&H12);"P";CHR$(SCD);CHR$(ECD);CHR$(16);CHR$(8); 130 FOR I=0 TO ECD-SCD 140 RESTORE 280 : N=16 : GOSUB 250 150 NEXT I 160 FOR I=0 TO 1 170 PRINT #1,CHR$(&H12);"O";CHR$(I); 180 FOR J=0 TO 1 190 PRINT #1,CHR$(&H1B);"W";CHR$(J); 200 PRINT #1,CHR$(&H1B);"w";CHR$(J); 210 PRINT #1,"ABCDEFGHIJ" 220 NEXT J : NEXT I 230 CLOSE #1 240 END 250 FOR J=0 TO N-1 260 READ D$ : PRINT #1,CHR$(VAL("&h"+D$)); 270 NEXT J : RETURN 280 '816 Font 29
6.5.20 Bar Code Commands GS 'H' n Code Select HRI Character Print Position 1DH 48H n Function Selects the print position of the HRI character when printing a bar code. Only the two low-order bits of n are valid. n = 0: Does not print n = 1: Above the bar code n = 2: Below the bar code n = 3: Above and below the bar code HRI characters are printed with the font selected by GS 'f'.
GS 'k' n {DATA} Code Print Bar Code 1DH 6BH n {d1 d2•••dk} 0n255 Function Selects a bar code system and prints a bar code. n: Bar code system n Function 0 UPC-A 1 UPC-E 2 JAN13(EAN) 3 JAN8 4 CODE39 5 ITF 6 CODABAR 7 CODE128 Each bar code data is input as follows: UPC-A :Input one of '0' to '9' 11 times, then input 00H. UPC-E :Input one of '0' to '9' 11 times, then input 00H. JAN13 :Input one of '0' to '9' 12 times, then input 00H. JAN8 :Input one of '0' to '9' 7 times, then input 00H.
Note A ladder bar code is that to be printed horizontally against paper feed direction by specifying Page Mode Select (DC2 'z' 0) command n as 1. When printing the ladder bar code, specify bar code height should be 10 mm or longer and print that under the temperature of 0 to 40°C. Moreover, specify printing motor speed as low speed by Motor Speed Select (GS 'E') command. If ladder bar code is printed with the condition except above, may cause loss of reading accuracy.
GS 'w' n1 n2 Code Set Width of Bar Code 1DH 77H n1 n2 0n1255 0n2255 Function Specifies the bar code narrow width and wide width in dots. The two low-order bits of n1 and n2 are valid. They are set as follows: Narrow width n1 Dots 0 2 1 3 2 4 Wide width n2 n1 0 1 2 3 0 5 6 6 6 1 7 8 9 9 2 9 10 11 12 If the two low-order bits of n1 are 3, it is ignored to n1, and n2 will be processed as normal data.
GS 'o' n Code PDF Row Height 1DH 6FH n 2n85 Function Sets a PDF row height by dot. n:PDF417 row height in a dot number. Sets PDF417 row height n dots. When a small value is set as the row height, some bar code reader may not read. Normally, set 3 dots or more. Default n=7 GS 'p' 0 m2 e r c nl nh {DATA} Code PDF417 Print 1DH 70H 00H m2 e r c nl nh {d1 d2•••dk} 0≤m2≤1 0≤e≤8 0, 3≤r≤90 0, 1≤c≤30 0≤ nh 256+ nl ≤1023 Function Prints PDF417 based on the designated contents.
DC2 ';' n Code QR Code and Data Matrix Module Sizes 12H 3BH n 2≤n≤11 Function Sets QR Code and Data Matrix module sizes by dot. n: Number of dots on one side of the module. Sets module sizes of QR Code and Data Matrix to n dots. When a small value is set as the module size, some bar code readers may not read. Set the module size to 4 dots or more for normal operation.
When the position of bar code end is not placed within the page length and exceeds the print area set by bottom margin setting, the printer prints bar code after executing Form Feed. The bar code print position setting is valid. The quiet zone width is fixed to four modules. GS 'p' 2 ecc row col nL nH {DATA} Code Data Matrix Print 1DH 70H 02H ecc row col nL nH {d1 d2•••dk} ecc=00H 8≤row≤144 10≤col≤144 1≤nH×256+nL≤3116 Function Prints the Data Matrix code base on the specified contents.
GS 'p' 3 mode ….n {DATA} Code Maxi Code Print 1DH 70H 03H 02H sc cc pc n {d1 d2•••dk} (mode2) 1DH 70H 03H 03H sc cc pc n {d1 d2•••dk} (mode3) 1DH 70H 03H 04H n {d1 d2•••dk} (mode4) 1DH 70H 03H 05H n {d1 d2•••dk} (mode5) Function Prints the MaxiCode data based on the specified contents. sc: Specifies a service class. In mode 2, and mode 3, sc should be 3-digit numerals. cc: Specifies a country code. In mode 2, and mode 3, cc should be 3-digit numerals. pc: Specifies a postal code.
110 OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1 120 PRINT #1,"****** BARCODE TEST ******" 130 FOR I=0 TO 7 140 RESTORE 380 150 FOR J=0 TO I 160 READ CODE$ 'Get Code Name 170 NEXT J 180 RESTORE 400 190 FOR J=0 TO I 200 READ DAT$ 'Get Bar Data 210 NEXT J 220 PRINT #1,CHR$(&H1D);"w";CHR$(I MOD 3);CHR$(I MOD 4); 'Narrow/Wide 230 PRINT #1,CHR$(&H1D);"P";CHR$(I MOD 3); 'Bar Position 240 PRINT #1,CHR$(&H1D);"h";CHR$(I*10+100); 'Bar Height 250 PRINT #1,CHR$(&H1D);"H";CHR$(I MOD 4); 'Strings position 260 PRINT #1,CHR$(&
Figure 6-24 Print Sample 12 6-78
100 OPEN “COM1:9600,N,8,1” FOR OUTPUT AS #1 110 PRINT #1, "*****PDF417*****" 120 PRINT #1, CHR$(&H1D);"n";CHR$(3); 'Nominal narrow element width setting 130 PRINT #1, CHR$(&H1D);"o";CHR$(6); 'PDF step height setting 140 PRINT #1, CHR$(&H1D);"P";CHR$(0); 'Barcode print position setting (left end) 150 PRINT #1, CHR$(&H1D);"p";CHR$(0); 'Print of PDF417 160 PRINT #1, CHR$(0);CHR$(2);CHR$(0);CHR$(0);CHR$(50);CHR$(0); 170 FOR I=1 TO 5 180 READ DAT$ 190 PRINT #1, DAT$; 200 NEXT I 210 PRINT #1, CHR$(&H0A);"*****QR
Figure 6-26 Print Sample 13 6-80
100 OPEN “COM1:9600,N,8,1” FOR OUTPUT AS #1 110 FOR I=2 TO 3 120 READ MODE$,SERVICE$,COUNTRY$,POSTAL$ 130 PRINT #1, "*****MaxiCode ";MODE$;"*****" 140 PRINT #1, CHR$(&H1D);"P";CHR$(I MOD 2); 'Barcode print position setting 150 PRINT #1, CHR$(&H1D);"p";CHR$(3); 'Print of MaxiCode (modes 2 & 3) 160 PRINT #1, CHR$(I);SERVICE$;COUNTRY$;POSTAL$;CHR$(50); 170 FOR J=1 TO 5 180 READ DAT$ 190 PRINT #1, DAT$; 200 NEXT J 210 PRINT #1, CHR$(&H0A); 220 NEXT I 230 FOR I=4 TO 5 240 READ MODE$ 250 PRINT #1, "*****MaxiCode
Figure 6-28 Print Sample 14 6-82
6.5.21 Routine Commands The routine commands put character strings and commands in memory and prints data in routine formats. They are a type of macro processes. The routine commands begin with DC2 'E' m and are divided into four types according to the value of m. Only the two low-order bits of m are valid. m = 0: Set routine format. m = 1: Set routine parameter data. m = 2: Execute routine format. m = 3: Delete all routine data.
'V' {d1 d2 ••• dk} NAME : Sets routine image (Same function as DC3 'V' {DATA}) FUNCTION : Stores image data in the selected ruled line buffer. 'P' n NAME : Prints routine dot line (parameter print) n=Repetitive dot lines (0n255) FUNCTION : Prints data in the line buffer. After printing data in the line buffer, it prints n dot lines of the selected ruled line. If n=0, data in the line buffer only is printed.
DC2 'E' 1 n dl dh {DATA} Code Set Routine Parameter Data 12H 45H 01H n dl dh {d1 d2•••dk} 0n127 0dhdl65525 Function Sets character data to be printed in a routine format. n is a routine parameter number. 128 types can be registered (00H to 7FH). If n is not in the above range, DC2 'E' 1 n is ignored and the subsequent data is processed as normal data. dl and dh indicate the number of bytes of the routine parameter data.
DC2 'E' 2 n Code Execute Routine Format 12H 45H 02H n 0n127 Function Executes a routine format. n is the number of a routine format to be executed. If n is not in the above range, the command is ignored. If format data is not registered with the format number specified by n, the command is ignored. If the parameter data is not set, paper is fed in 24 dots lines. If parameter data exceeds a printable line, it is not printed.
100 OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1 110 'Format Set 120 PRINT #1,CHR$(&H12);"E0";CHR$(0);CHR$(7);CHR$(0); 'Format No.0 130 PRINT #1,"ACF";CHR$(&HFF);CHR$(&HFF);"P";CHR$(2); 140 FOR I=1 TO 3 150 PRINT #1,CHR$(&H12);"E0";CHR$(I);CHR$(29);CHR$(0); 'Format No.
6.5.22 Page Mode The page mode function maintains a rectangular area with an arbitrary size, deploys the printed data there, and prints characters in the normal direction or rotated 90° clockwise. The page mode function allows the user to layout printing material more freely thanks to the above features. DC2 'z' 0 n x yl yh Code Page Mode Select 12H 7AH 00H n x yl yh 0 n 1 0x104 0yh 256 + yl2400 Function Specifies the page mode. Specify the page size with x, yh and yl.
DC2 'z' 1 Code Page Mode Print 12H 7AH 01H Function Prints the contents of the page area. The printer returns to the standard mode after processing the page mode print. Printing deploys in direction according to Page Mode Select (DC2 'z' 0) command. If the printer is not in the page mode, this command is ignored.
DC2 '$' '1' xsL xsH ysL ysH xeL xeH yeL yeH mode Code Rectangle Print 12H 24H 31H xsL xsH ysL ysH xeL xeH yeL yeH mode 0xsH×256+xsL65535 0ysH×256+ysL65535 0xeH×256+xeL65535 0yeH×256+yeL65535 0mode255 Function Specifies diagonal coordinates of the drawing (line, frame, fill). Horizontal start point = xsH×256 + xsL Vertical start point = ysH×256 + ysL Horizontal end point = xeH×256 + xeL Vertical end point = yeH×256 + yeL mode: Print type Bit No.
DC2 '$' '2' n Code Line Type Property 12H 24H 32H n 0 n 2 Function Specifies a line type property. Default n Line type 0 Solid line 1 Long dashed line 2 Short dashed line n=0 DC2 '$' '3' n Code Line Width Property 12H 24H 33H n 0
100 OPEN "COM1:9600,N,8,1" AS #1 110 S$=”ABCDEFGHIJKLMN” 120 PRINT #1,CHR$(&H12);"z";CHR$(0);CHR$(1);CHR$(80);CHR$(0);CHR$(3); 130 PRINT #1,S$ 140 PRINT #1,CHR$(&H1B);"W1";S$ 150 PRINT #1,CHR$(&H1B);"w1";S$ 160 PRINT #1,CHR$(&H12);"z";CHR$(2);CHR$(0);CHR$(1); 170 PRINT #1,CHR$(&H1D);"P";CHR$(2); 180 PRINT #1,CHR$(&H1D);"H";CHR$(2); 190 PRINT #1,CHR$(&H1D);"h";CHR$(80); 200 PRINT #1,CHR$(&H1D);"k";CHR$(0);”12345678901”;CHR$(0); 210 PRINT #1,CHR$(&H12);"$2";CHR$(1); 220 PRINT #1,CHR$(&H12);"$3";CHR$(2); 230 P
6.5.23 Status Commands DC2 'e' n Code Enable/Disable Automatic Status Transmission 12H 65H n Function Select whether to send an error status if an error occurs. Only the least significant bit of n is valid. n = 0: Do not send an error status. n = 1: Send an error status. If error status transmission is specified (n=1), the error status (one byte) is output. If an error occurs or error status changes, a single-byte error code indicating the cause of the error is automatically output.
DC2 'v' Code Send VP Voltage 12H 76H Function Measures the VP voltage (head and motor operating voltage) in the printer and sends it. The voltage is transmitted as a 3-bytes code consisting of a 1-digit integer part, a decimal point, and a 1-digit decimal. Example: 7.2 V -> 37H 2EH 32H 6.5 V -> 36H 2EH 35H If the voltage is out of the VP voltage permissible range (6.50 to 9.75 V), an error status is generated, and no commands or data can be input. If the voltage becomes 9.
DC2 'j' n Code Execute Response Request 12H 6AH n Function Sends the execute response code as n if this command is executed. n: response code (low order 4 bits are valid) This interface has 4K bytes reception buffer and does not handle several operations such as the commands, data input or execution or printing at the same time. Therefore, command or printing termination can not be confirmed from outside.
100 OPEN "COM1:9600,N,8,1" AS #1 110 PRINT #1,CHR$(&H12);"v"; 120 PRINT #1,"Vp voltage : ";INPUT$(3,#1);" V" 130 PRINT #1,CHR$(&H12);"r"; 140 PRINT #1,"Rest Memory : ";INPUT$(6,#1);"H Byte" 150 PRINT #1,CHR$(&H12);"q"; 160 PRINT #1,"Extend Check Sum :";INPUT$(4,#1);"H" 170 PRINT #1,CHR$(&H12);"l"; 180 PRINT #1,"DIP_SW:";INPUT$(35,#1) 190 PRINT #1,CHR$(&H12);"e1"; 200 PRINT "Indicate error when an error occurs." 210 PRINT "When you want to stop program, press Ctrl+Break key.
6.5.24 Character Set Command DC2 'F' n Code Select Character Font Size 12H 46H n Function Sets the character font size to 16 dots or 24 dots. Only the least significant bit of n is valid. n = 0: 16 dots n = 1: 24 dots The character size specified here is applied to 1-byte characters, and 2-byte characters. Default Depends on the setting of SWDIP 2-6.
100 OPEN "COM1:9600,N,8,1" FOR OUTPUT AS #1 110 FOR I=0 TO 1 120 PRINT #1,CHR$(&H12);"F";CHR$(I); 130 IF I=0 THEN PRINT #1,"16"; ELSE PRINT #1,"24"; 140 PRINT #1," DOT FONT" 150 FOR J=&H41 TO &H5A 160 PRINT #1,CHR$(J); 170 NEXT J:PRINT #1,CHR$(&H0D); 180 PRINT #1,CHR$(&H1C);"&"; 190 FOR J=&H21 TO &H30 200 PRINT #1,CHR$(&H30);CHR$(J); 210 NEXT J:PRINT #1,CHR$(&H0D); 220 PRINT #1,CHR$(&H1C);"r";CHR$(0); 230 FOR J=&H30 TO &H39 240 PRINT #1,CHR$(&H23);CHR$(J); 250 NEXT J:PRINT #1,CHR$(&H0D); 260 PRINT #1,CHR$(&
6.5.25 Auxiliary Function Commands DC2 '!' n Code Select Paper 12H 21H n Function Specifies paper to be used. The three low-order bits of n are valid. n = 0: PD160R-N n = 1: TC98KS-LH n = 2: P350 n = 3: reserved n = 4: KT55F20 n = 5: TF8067 n = 6: TL69KS-HW76B n = 7: TF50KS-E2D Default Depends on the setting of SWDIP 2-3 to 2-5. (NOTE) If too much energy is applied to the thermal head, it would shorten its life span and cause the paper feed problem.
DC2 'E' n Code Motor Speed Select 1DH 45H n 0n255 Function Sets the motor speed high or low. Bit No. Default Value Function 0 1 0 Undefined - - 1 Undefined - - 2 Undefined - - 3 Undefined - - 4 Motor speed High speed Low speed 5 Undefined - - 6 Undefined - - 7 Undefined - - n=0 (High speed) DC2 'a' n Code Set Automatic Power-off Time 12H 61H n 0n255 Function Enables the automatic power-off function and sets the automatic power-off time.
DC2 '=' n Code Select Image LSB/MSB 12H 3DH n Function Sets whether the leftmost bit is set to the LSB (least significant bit) or MSB (most significant bit) for the data. Only the least significant bit of n is valid. n = 0: The leftmost bit is LSB. n = 1: The leftmost bit is MSB. This command is valid for the followings: Define Optional Font Define Ruler Line with Repeating Patterns Ruler Line LSB/MSB image Raster Bit Image Print Stamp Define Default n=0 (The leftmost bit is LSB.
GS 'g' '0' m nl nh Code Maintenance Counter Initialization 1DH 67H 30H m nl nh m=0 (nh×256+nl)=20, 21, 70 Function Sets the values of the specified maintenance counter and the maintenance counter saved in the system area to 0. nh and nh show maintenance number (nh×256+nl).
GS 'g' '2' m nl nh Code Maintenance Counter Transmission 1DH 67H 32H m nl nh m=0 (nh×256+nl)=20, 21, 70, 148, 149,198 Function Transmits the maintenance counter value. Transmits the maintenance counter value. The initial value of the maintenance counter becomes the value saved in the system area. Specifies the maintenance number as (nh× 256+nl).
DC2 '{' a n m Code User Area Data Registration/Clears 12H 7BH a n m Function Registers/Clears data in the external RAM to the FLASH memory. a = Data types (00H to 05H) n = Data ID m = Registers/Clears data (*******1B: registers, *******0B: clears) When the least significant bit of m is set as 1, the printer registers data in the external RAM to the FLASH memory. If selected data by a already has been registered into the FLASH memory, the printer deletes registered data and registers new one.
DC2 'R' n Code User Area Initialization 12H 52H n 0 n 1 Function Initializes memory in the user area. Specify n as memory the external RAM or FLASH memory. n = 0: Use area in the external RAM n = 1: Use area in the FLASH memory The printer clears data in line buffer, page mode, all User-defined characters, downloaded characters, optional fonts, stamps, template and initializes memory in the user area.
100 OPEN "COM1:9600,N,8,1" AS #1 110 PRINT #1,CHR$(&H12);"=0"; 120 PRINT #1,CHR$(&H13);"(AF";CHR$(&H3);CHR$(&HC0);")"; 130 PRINT #1,CHR$(&H12);"=1"; 140 PRINT #1,CHR$(&H13);"(BF";CHR$(&H3);CHR$(&HC0);")"; 150 PRINT #1,CHR$(&H13);"+"; 160 PRINT #1,CHR$(&H13);"A"; 170 PRINT #1,CHR$(&H12);"#0";"Left=LSB, Overlap print with OR." 180 PRINT #1,CHR$(&H13);"B"; 190 PRINT #1,CHR$(&H12);"#1";"Left=MSB, Overlap print with XOR.
DC2 'k' n1 n2 n3 n4 Code Function Settings 12H 6BH n1 n2 n3 n4 0n1255, 0n2255, 0n3255, 0n4255 Function Changes the printer SWDIP switch setting. The contents of n1, n2, n3 and n4 are as follows: The underline is the status after setting is initialized with switches.
Note Using much of this command may cause the FLASH memory damage. It is recommended that this command be used 10 times/day. DC2 'i' m {DATA} Code Set Default/Set Test Print Header 12H 69H m {Data} Function Set default and test print header. Moreover, can be set various settings for Bluetooth.
Reading test print header transfers head data to the computer from top to bottom. Transfer NULL character to complete the data transmission. Initializing of the test print header clears set header and returns to default test print header at shipping. Set Writing Bluetooth device name as character string within 2 to 32 bytes. Bluetooth device name is completed when data exceeds 32 bytes or the NULL character is detected.
Reading each default values is transferred data that correspond of m by the hexadecimal of 2 or 4 digits to the host device. Reboot or execute reset command after turning off the POWER switch to set the default settings.
6.5.26 Download Mode DC2 DC2 Code Download Mode Selection 12H 12H Function Switches to the download mode. This function performs a hardware reset in order to return from the download mode to the printing mode. (Execute hardware reset by turning on the power again or using '@' command.) In the download mode, only the commands described in Table [Download mode] become valid.
If the m differs from the data structure which specified by Data Structure of a 2-Byte Character ('{' n ) command, the printer discards data of 1048576 bytes from next byte. This command is valid for download mode. Do not turn the printer off or input communication break during executing the command. To print Japanese Kanji or Korean, following the format below and creates font data.
Address Structure for font data Structure of Japanese <2-byte download> Font data for 1 character is configured as the figure below. Padding data of 1 byte is added to 24 dots font data every 3 bytes. Therefore, 1 character font data requires 96 + 32 = 128 bytes.
Structure of Korean <2-byte download> Font data for 1 character is configured as the figure below. 1 character font data requires 72 + 32 = 104 bytes.
'{' n Code Data Structure of a 2-Byte Character 7BH n 0 n 1 Function Selects the data structure of a 2-byte character. n Code Function 0 Japanese 1 Korean This command is valid for download mode.
6.6 DEFAULTS The defaults of the items are listed below.
Table 6-10 Default Settings(2/2) Default Item Initial automatic status transmission Depend on the SWDIP switch setting Automatic status transmission Not respond Paper selection Depend on the SWDIP switch setting Print density selection Depend on the SWDIP switch setting Auto power off Depend on the SWDIP switch setting Auto power off time *1 30 minutes (at shipping) Overlap mode selection OR overlap Select Image LSB/MSB The leftmost bit is LSB Maximum paper feed length to mark detection A
6.7 INITIAL AUTOMATIC STATUS TRANSMISSION The printer can transfer 1 byte of data containing status information at one second intervals automatically regardless of the existence of an error when bit 8 of SWDIP switch 2 is set to 0. The contents of status information is the same as the description shown in DC2 'e' n.
6.8 COMMAND INDEX 6.5.2 Formatting Commands ............................................................................................................... 6-19 ESC 'C' n ESC 'C' 0 n ESC 'N' n ESC 'O' ESC 'Q' n ESC 'I' n 6.5.3 Line Spacing Commands............................................................................................................ 6-23 ESC '0' ESC '2' ESC '3' n 6.5.4 Set/Cancel Download Character Set ......................................................
6.5.11 Kanji Character Set Selection Commands ............................................................................... 6-43 FS '&' FS '.' FS 'C' n FS 'r' n FS DC2 6.5.12 Kanji Character Definition Commands ..................................................................................... 6-45 FS '2' c1 c2 {DATA} DC2 'G' n 6.5.13 Select Vertical Writing ............................................................................. 6-47 Select Horizontal Writing..................................
6.5.20 Bar Code Commands.................................................................................................................. 6-69 GS 'H' n Select HRI Character Print Position........................................................ 6-69 GS 'f' n Select HRI Character Font...................................................................... 6-69 GS 'h' n Set Bar Code Height............................................................................... 6-69 GS 'k' n {DATA} Print Bar Code ......
6.5.25 Auxiliary Function Commands .................................................................................................. 6-99 DC2 '!' n DC2 '~' n DC2 'E' n DC2 'a' n DC2 '#' n DC2 '=' n GS 'g' '0' m nl nh GS 'g' '1' m GS 'g' '2' m nl nh DC2 '{' a n m DC2 '*' '1' DC2 '*' '2' DC2 'R' n ESC '@' DC2 's' 't' 'p' DC2 'k' n1 n2 n3 n4 DC2 'i' m {DATA} 6.5.26 Select Paper ........................................................................................... 6-99 Select Print Density ............
APPENDIX A CHARACTER SETS (CHARACTER CODE TABLE) A.1 CHARACTER CODE TABLE ANK (Katakana character set: if Japanese is selected as an international character set) * 20H and A0H indicate a space. 7FH and FFH are ignored.
IBM Compatible (Extended graphics character set: if Japanese is selected as an international character set) * 20H indicates a space. 7FH and FFH are ignored. Codepage 1252 character set: if Japanese is selected as an international character set * 20H indicates a space. 7FH is ignored.
A.2 INTERNATIONAL CHARACTER SETS The following codes differ depending on the international character set selected.
A.3 KANJI CODE TABLE Kanji characters of 1997 JIS levels 1 and 2 are supported. The following special characters and character codes for vertical writing, which are not listed in the table, are also supported.
A.