Command Reference LINE THERMAL PRINTER MODEL CT-S300 Rev. 0.
REVISION Rev. No. Rev. 0.
TABLE OF CONTENTS 1. OUTLINE .............................................................................................................................................. 1 1.1 Operation Mode ............................................................................................................................................ 1 1.2 Character Set ................................................................................................................................................. 1 1.
2.2.5 Bit Image Commands ....................................................................................................................... 45 ESC * m n1 n2 [ d ] k ....................................................................................................................... 45 GS * n1 n2 [ d ] n1 × n2 × 8 ............................................................................................................. 47 GS / m ......................................................................
GS (K pL pH fn m fn = 50 .................................................................................................................. 111 GS (K pL pH fn m fn = 97 .................................................................................................................. 112 GS (M pL pH fn m ............................................................................................................................... 113 GS (M pL pH fn m fn = 1, 49 ...............................................
1. OUTLINE 1.1 Operation Mode CT-S300 has ESC/POSTM as control commands. 1.2 Character Set All print data sent from the host computer to the printer are automatically converted to one-byte alphanumeric or katakana characters (ANK) or two-byte Kanji corresponding to the characters and symbols. NOTE: For the contents of character set, refer to Chatacter Code Table of this document. 1.3 Control Commands 1.3.
2. CONTROL COMMANDS 2.1 ESC/POS Command List Print Control Commands Control Command LF CR FF ESC FF ESC J ESC d Function Printing and paper feed Back to printing (1) Printing in PAGE MODE and returning to STANDARD MODE (at the selection of PAGE MODE) (2) Printing of Black mark and paper feeding to the top of the print position (with Black mark paper selected) Printing data in PAGE MODE Printing and feeding paper in minimum pitch Printing and feeding the paper by “n” lines Mode GS P S.P. S.P. P P S.P.
Print Position Commands Commands HT ESC $ ESC D ESC T ESC W ESC \ ESC a GS $ GS L GS W GS \ Function Horizontal tab Specifying the absolute positions Setting horizontal tab position Selecting the character printing direction in PAGE MODE Defining the print area in PAGE MODE Specifying the relative position Aligning the characters Specifying the absolute vertical position of characters in PAGE MODE Setting the left margin Setting the print area width Specifying the relative vertical position of a character
Panel Switch Commands Commands ESC c5 Function Enabling/disabling the panel switches Mode S.P. GS P Mode S.P. S.P. GS P Mode S.P. GS P O Mode S.P. S.P. S.P. S.P. S.P. GS P Mode S S GS P Mode S.P. S.P. S.P. S.P. S.P. S.P. S.P. S.P. S.P.
Printer Function Setting Commands Commands GS ( D GS ( E GS ( M GS ( N Function Enabling or disabling real-time command Printer function setting command Customizing the printer Designating font attribute Mode S S S S GS P Mode S.P. S.P. S.P. S.P. S P S.P. S S.P. S.P. S.P.
2.1.1 Description of Items XXXX [Function] The name of a command. [Code] The string of codes comprising the command is represented by < >H for hexadecimal numbers, < >B for binary numbers, and < > for decimal numbers, [ ] k denotes the number of repetition of “k” times. [Range] Indicates the values (setting range) of arguments of the command.
2.2 Command Details 2.2.1 Print Control Commands LF [Function] Printing and paper feed [Code] <0A>H [Outline] Prints data inside the print buffer and feeds paper based on the line feed amount having been set. [Caution] After this command is executed, the beginning of the line is taken as the start position for the next point.
CR [Function] Back to printing [Code] <0D>H [Outline] (1) When memory switch 1-3 is OFF: This command is ignored. (2) When memory switch 1-3 is ON: The same operation as LF is executed.
FF [Function] (1) Printing in PAGE MODE and returning to STANDARD MODE (at the selection of PAGE MODE) (2) Printing of Black mark and paper feeding to the top of the print position (with Black mark paper selected) [Code] <0C>H (1) At selection of PAGE MODE [Outline] Executes a batch printout of the data mapped in the entire print area, and then returns to STANDARD MODE. [Caution] • • • • [See Also] Appendix 4.1.
ESC FF [Function] Printing data in PAGE MODE [Code] <1B>H<0C>H [Outline] Executes a batch printout of the data mapped in the entire print area in PAGE MODE. [Caution] • This command is only effective when PAGE MODE is selected. • Mapped data, as well as the ESC T and ESC W settings, and the character mapping position are held even after printing. [See Also] Appendix 4.
ESC d n [Function] Printing and feeding the paper by “n” lines [Code] <1B>H<64>H [Range] 0 [Outline] Prints data in the print buffer and feeds paper by “n” lines. Specified lines do not remain. [Caution] • After this command is executed, the beginning of the line is taken as the start position for the next print. • If [n × line feed width] exceeds approximately 1016 mm, this command feeds paper by approximately 1016 mm (40 inches). [Default] The initial value is not defined.
2.2.2 Print Character Commands CAN [Function] Canceling print data in PAGE MODE [Code] <18>H [Outline] Erases all data contained in the currently effective print area in PAGE MODE. [Caution] • This command is only effective when PAGE MODE is selected. • If the previously established print area overlaps the currently effective print area, the overlapped data in the previously established area will be erased. [See Also] Appendix 4.
ESC SP n [Function] Setting the right spacing of the character [Code] <1B>H<20>H [Range] 0 [Outline] Sets the right spacing of character to [n × basic calculation pitch] inches. [Caution] • If the horizontal magnification of character is 2 or more, the right spacing increases with the magnification. • Does not affect Kanji. • The right spacing can be set separately for the STANDARD and PAGE MODES. • The basic calculation pitch is set by GS P.
ESC ! n [Function] Collectively specifying the printing mode [Code] <1B>H<21>H [Range] 0 [Outline] Printing mode is assigned.
[Sample Program] LPRINT CHR$(&H1B);"!";CHR$(&H00);"H"; LPRINT CHR$(&H1B);"!";CHR$(&H01);"H"; LPRINT CHR$(&H1B);"!";CHR$(&H08);"H"; LPRINT CHR$(&H1B);"!";CHR$(&H10);"H"; LPRINT CHR$(&H1B);"!";CHR$(&H20);"H"; LPRINT CHR$(&H1B);"!";CHR$(&H80);"H"; LPRINT CHR$(&H1B);"!";CHR$(&HB9);"H"; LPRINT CHR$(&HA); [Print Results] Font B + Emphasis + Quadruple + Underline Font A + Underline Font A + Double width Font A + Double height Font A + Emphasis Font B Font A — 15 —
ESC % n [Function] Specifying/canceling download character set [Code] <1B>H<25>H [Range] 0 [Outline] Specifying/canceling download characters. • “n” is valid only for the lowest bit (n0).
ESC & s n m [a [p] s × a] m–n+1 [Function] Defining the download characters [Code] <1B>H<26>HHHH[HH··]m – n + 1 [Range] s = 3 (Font A, B) s = 2 (Font C) 32 n m 126 0 a 12 (Font A) 0 a 9 (Font B) 0 a 8 (Font C) 0 p1 ⋅ ⋅ ps × a 255 [Outline] Defines the font of download characters of alphanumeric characters. • “s” indicates the number of bytes in vertical direction. • “n” indicates the start character code and “m” the end character code.
ESC – n [Function] Specifying/canceling underline [Code] <1B>H<2D>H [Range] 0 n 2 48 n 50 [Outline] Specifying/canceling an underline. n 0, 48 1, 49 2, 50 Function Canceling underline Setting 1-dot width underline Setting 2-dot width underline [Caution] • An underline is attached to the full character width. It is, however, not attached to the part having been skipped by horizontal tab (HT) command. • An underline is not attached to 90°-right-turned characters and white-on-black character.
ESC ? n [Function] Deleting download characters [Code] <1B>H<3F>H [Range] 32 [Outline] Deletes the downloaded characters of specified code. [Caution] • The character “n” indicates the character code used to delete the defined pattern. After the deletion, characters are printed in the same pattern as the internal characters. • This command deletes the code-defined pattern of the character font selected by ESC !. • This command is ignored if the specified character code is undefined.
ESC E n [Function] Specifying/canceling emphasis printing [Code] <1B>H<45>H [Range] 0 [Outline] Specifying/canceling the emphasized characters. • “n” is valid only for the lowest bit (n0). • Control by the lowest bit (n0) is shown as follows: n 255 n0 0 1 Function Canceling emphasis printing Specifying emphasis printing [Caution] • Emphasis printing can also be specified/canceled by ESC ! but the setting of command last processed is valid.
ESC G n [Function] Specifying/canceling double strike printing [Code] <1B>H<47>H [Range] 0 [Outline] Specifying/canceling the double strike printing. • “n” is valid only for the lowest bit (n0). • Control by the lowest bit (n0) is shown as follows: n 255 n0 0 1 Function Canceling double strike printing Specifying double strike printing [Caution] • With this printer, double-strike printing and emphasis printing provide completely the same results.
ESC M n [Function] Selection of character fonts [Code] <1B>H<4D>H [Range] 0 n 2 48 n 50 [Outline] Selects character fonts. n 0, 48 1, 49 2, 50 Function Selection of font A (12 × 24) Selection of font B (9 × 24) Selection of font C (8 × 16) [Caution] • ESC ! can also select fonts, but the setting made by the command that has last been processed becomes valid. • In case font C selection ESC R is other than n = 8 (katakana), codepage PC437 is printed.
ESC V n [Function] Specifying/canceling 90°-right-turned characters [Code] <1B>H<56>H [Range] 0 n 2 48 n 50 [Outline] Specifying/canceling 90°-right-turned characters. n 0, 48 1, 49 Function Canceling 90°-right-turned characters Specifying 90°-right-turned characters [Caution] • No underlines are attached to 90°-right-turned characters. • This command does not affect PAGE MODE but setting is maintained.
ESC t n [Function] Selecting the character code table [Code] <1B>H<74>H [Range] 0 n 9 16 n 19 n = 22, 255 [Outline] Selecting the character code table. The character code table is selected based on the value of “n”.
ESC { n [Function] Specifying/canceling the inverted characters [Code] <1B>H<7B>H [Range] 0 [Outline] Specifying/canceling inverted characters. • “n” is valid only for the lowest bit (n0). • Control by the lowest bit (n0) is shown as follows: n n0 0 1 255 Condition Canceling inverted characters. Specifying inverted characters. [Caution] • This command is valid only when it is specified at the beginning of a line. • This command does not affect the PAGE MODE.
ESC ~ J n (Valid in CBM1000II-Compatible Mode) [Function] Specifies/cancels printing in red (black-based paper) [Code] <1B>H<7E>H<4A>H [Range] 0 [Outline] Specifies or cancels printing in red. • Red printing is valid on black-based thermal paper. Specifies or cancels printing in black on red-based thermal paper. • “n” is valid only for the lowest bit (n0).
DC3 n (Valid in CBM1000II-Compatible Mode) [Function] Specifies/cancels printing in red (black-based paper) [Code] <13>H [Range] 0 [Outline] Specifies or cancels printing in red. • Red printing is valid on black-based thermal paper. Specifies or cancels printing in black on red-based thermal paper. • “n” is valid only for the lowest bit (n0).
GS ! n [Function] Specifying the character size [Code] <1D>H<21>H [Range] 0 1 [Outline] n 255, where: vertical magnification 8, 1 horizontal magnification 8 Specifies the character size (Vertical and horizontal magnification). Bit 0 1 2 3 4 5 6 7 Function Vertical magnification specification Refer to Table 2, “Vertical Magnification”. Horizontal magnification specification Refer to Table 1, “Horizontal Magnification”. Table 1 Horizontal Magnification Hex. 00 10 20 30 40 50 60 70 Hex.
GS B n [Function] Specifying/canceling the black/white inverted printing [Code] <1D>H<42>H [Range] 0 [Outline] This command specifies or cancels the black/white inverted printing. • “n” is valid only for the lowest bit (n0). • Control by the lowest bit (n0) is shown as follows: n n0 0 1 255 Function The black/white inverted printing is canceled. The black/white inverted printing is specified. [Caution] • The black/white inversion works on internal and downloaded characters.
GS b n [Function] Specifying/canceling the smoothing [Code] <1D>H<62>H [Range] 0 [Outline] This command specifies or cancels the smoothing. • “n” is valid only for the lowest bit (n0). • Control by the lowest bit (n0) is shown as follows: n 255 n0 0 1 Function The smoothing is canceled. The smoothing is specified. [Caution] • Smoothing is effective to printer’s internal characters, download characters, and non-standard characters.
2.2.3 Print Position Commands HT [Function] Horizontal tab [Code] <09>H [Outline] Shifts the printing position to the next horizontal tab position. • Ignored when the next horizontal tab position has not been set. [Caution] The horizontal tab position is set by ESC D. [Default] At the selection of font A, tabs are set every 8 characters (at 9th, 17th, 25th, ...) with right space amount of a character set at 0 and horizontal enlargement rate of a character set at 1.
ESC $ n1 n2 [Function] Specifying the absolute positions [Code] <1B>H<24>H [Range] 0 0 [Outline] The printing start position is specified by the absolute position from the left margin with the number of dots divided by 256 and quatient specified as “n2” and remainder as “n1”. Therefore, the printing start position is designated as n1 + n2 × 256 × basic calculation pitch from the left margin. [Caution] • The basic calculation pitch is set by GS P.
ESC D [ n ] k NULL [Function] Setting horizontal tab position [Code] <1B>H<44>H [] k<00>H [Range] 1 0 [Outline] Specifying a horizontal tab position. • “n” indicates the number of columns from the beginning to the horizontal tab position. Note, however, that “n = set position – 1”. For example, to set the position at 9th column, n = 8 is to be specified. • “k” denotes the number of horizontal tab positions you want to set.
ESC T n [Function] Selecting the character printing direction in PAGE MODE [Code] <1B>H<54>H [Range] 0 n 3 48 n 51 [Outline] Selects the direction and start point of character printing in PAGE MODE.
ESC W xL xH yL yH dxL dxH dyL dyH [Function] Defining the print area in PAGE MODE [Code] <1B>H<57>H [Range] 0 xL, xH, yL, yH, dxL, dxH, dyL, dyH 255, except for dxL = dxH = 0 or dyL = dyH = 0 [Outline] Defines the location and size of the print area.
ESC \ nL nH [Function] Specifying the relative position [Code] <1B>H<5C>H [Range] 0 0 [Outline] This command specifies the next print start position in a relative position with respect to the current position. The next print start position will be at a point of [(nL + nH × 256) × basic calculation pitch] inches away from the current position. [Caution] • Specification of a position outside the print area is ignored.
ESC a n [Function] Aligning the characters [Code] <1B>H<61>H [Range] 0 n 2 48 n 50 [Outline] All the printed data within one line are aligned in the specified position. Depending on the value “n”, positional alignment is carried out as shown in the table below: n 0, 48 1, 49 2, 50 Position Left end alignment Centering Right end alignment [Caution] • This command is valid only when it is inputted at the beginning of a line. • This command does not affect the PAGE MODE.
GS $ nL nH [Function] Specifying the absolute position of character vertical direction in PAGE MODE [Code] <1D>H<24>H [Range] 0 [Outline] Specifies the vertical position of character at the start point of data development in PAGE MODE using absolute position based on the start position. The position of vertical direction of character at the start position of next data development is the position [(nL + nH × 256) × basic calculation pitch] from the start position.
GS L nL nH [Function] Setting the left margin [Code] <1D>H<4C>H [Range] 0 0 [Outline] This command sets the left margin specified by nL and nH. The value of the left margin is [(nL + nH × 256) × basic calculation pitch] inches. nL nH 255 255 Printable area Left margin Print area width [Caution] • This command only works when it is entered at the beginning of a line. • When PAGE MODE is selected, this command only executes the internal flagging of the printer.
GS W nL nH [Function] Setting the print area width [Code] <1D>H<57>H [Range] 0 0 [Outline] Sets the print area width specified by nL and nH. The print area width will be [(nL + nH × 256) × basic calculation pitch] inches. nL nH 255 255 Printable area Left margin [Caution] Print area width • This command only works when it is entered at the beginning of a line. • When PAGE MODE is selected, this command only executes the internal flagging of the printer.
(2) If a sufficient area cannot be provided as a result of step (1), the print area is extended toward the left (so, the left margin is decreased). Printable area A Left margin (2) The left margin is trimmed (1) Extended toward the right Print area width (3) If a sufficient area cannot be provided as a result of step (2), the right spacing is trimmed.
GS \ nL nH [Function] Specifying the relative vertical position of a character in PAGE MODE [Code] <1D>H<5C>H [Range] 0 0 [Outline] This command is used in PAGE MODE to specify the vertical position of a character in the data mapping start position, in a relative position with respect to the current position. The next data mapping start position will be at a point [(nL + nH × 256) × basic calculation pitch] inches away from the current position.
2.2.4 Line Feed Span Commands ESC 2 [Function] Specifying 1/6-inch line feed rate [Code] <1B>H<32>H [Outline] The line feed rate per line is specified by 1/6 inch. [Caution] Line feed rate can be specified respectively for both STANDARD MODE and PAGE MODE.
ESC 3 n [Function] Setting line feed rate of minimum pitch [Code] <1B>H<33>H [Range] 0 [Outline] Sets the line feed width per line to [n × basic calculation pitch] inches. [Χαυτιον] • The line feed width can be set separately for the STANDARD and PAGE MODES. • The basic calculation pitch is set by GS P. Once defined, the line feed width is not changed if the basic calculation pitch is changed by GS P.
2.2.5 Bit Image Commands ESC * m n1 n2 [ d ] k [Function] Specifying the bit image mode [Code] <1B>H<2A>HH[]k [Range] m = 0, 1, 32, 33 0 n1 255 0 n2 2 0 d 255 k = n1 + 256 × n2 (m = 0, 1) k = (n1 + 256 × n2) × 3 (m = 32, 33) [Outline] • According to the number of dots specified in “n1”, “n2”, specify the bit image of mode “m”. • The number of dots printed is divided by 256, whose quotient is taken as n2 and residual as “n1”.
[Sample Program] LPRINT CHR$(&H1B);"*"; LPRINT CHR$(0);CHR$(20);CHR$(0); GOSUB IMG1 LPRINT CHR$(&HA); LPRINT CHR$(&H1B);"*"; LPRINT CHR$(1);CHR$(20);CHR$(0); GOSUB IMG1 LPRINT CHR$(&HA); LPRINT CHR$(&H1B);"*"; LPRINT CHR$(32);CHR$(20);CHR$(0); GOSUB IMG2 LPRINT CHR$(&HA); LPRINT CHR$(&H1B);"*"; LPRINT CHR$(33);CHR$(20);CHR$(0); GOSUB IMG2 LPRINT CHR$(&HA); END [Print Results] ← 8-dots single density ← 8-dots double density ← 24-dots single density ← 24-dots double density — 46 — IMG1: LPRINT CHR
GS * n1 n2 [ d ] n1 × n2 × 8 [Function] Defining the download bit image [Code] <1D>H<2A>H [< d >] n1 × n2 × 8 [Range] 1 n1 1 n2 n1 × n2 [Outline] • • • • [Caution] • Relations between the bit image data and the dots defined are shown below. • With this command executed, the defined content of a downloaded character is cleared. [See Also] GS / 255 48 1536 Defines download bit images of the number of dots specified by “n1” and “n2”.
[Sample Program] GOSUB IMG LPRINT CHR$(&H1D);"/";CHR$(0); LPRINT CHR$(&H1D);"/";CHR$(1); LPRINT CHR$(&H1D);"/";CHR$(2); LPRINT CHR$(&H1D);"/";CHR$(3); END IMG: n1=10:n2=5 LPRINT CHR$(&H1D);"*"; LPRINT CHR$(n1);CHR$(n2); FOR J=1 TO n1*8 FOR I=1 TO n2 LPRINT CHR$(J); NEXT I NEXT J RETURN [Print Results] — 48 —
GS / m [Function] Printing the downloaded bit image [Code] <1D>H<2F>H [Range] 0 m 3 48 m 51 [Outline] Prints downloaded bit image in a mode specified by “m”. Modes that can be selected by “m” are shown below.
GS v 0 m xL xH yL yH d1...dk [Function] Printing of raster bit image [Code] <1D>H<76>H<30>H [] k [Range] 0 m 3, 48 m 51, 0 xL 255, 0 xH 255, 0 yL 255, 0 yH 8, 0 d 255, k = (xL + xH × 256) × (yL + yH × 256), however, k ≠ 0 [Outline] Prints raster bit images in mode “m”.
[Example] When xL + xH × 256 = 64 (xL + xH × 256) × 8 dots = 512 dots 1 2 3 62 63 64 65 66 67 126 127 128 K-2 K-1 K 7 6 MSB 5 4 3 2 1 0 LSB — 51 — yL + yH × 256 dots
2.2.6 Status Commands DLE EOT n [Function] Sending status in real-time [Code] <10>H<04>H [Range] 1 [Outline] Sends in real-time the status specified by “n”. n 4 n 1 2 3 4 [Caution] Status Printer status Status caused by an offline condition Status caused by an error Continuous paper detector status • Each status represents the current status. It is 1 byte data. • The status is transferred without checking whether the host is ready to receive or busy.
(1) Printer status (When n = 1 is specified) Bit 0 1 2 3 4 5 6 7 Status Fixed Fixed Status of pin 3 of drawer kick-out connector = L Status of pin 3 of drawer kick-out connector = H Online status Offline status Fixed Not waiting online recovery Waiting online recovery FEED switch is not pressed FEED switch is pressed Fixed Hex.
(3) Status caused by an error (when n = 3 is specified) Bit 0 1 2 3 4 5 6 7 Status Fixed Fixed No B.M detection error occurred (only when B.M paper is selected) A B.M detection error occurred (only when B.M paper is selected) Auto cutter error not occurred Auto cutter error occurred Fixed Unrecoverable error not occurred Unrecoverable error occurred Auto recovery error not occurred Auto recovery error occurred Fixed Hex.
GS a n [Function] Enabling/disabling ASB (Automatic Status Back) [Code] <1D>H<61>H [Range] 0 [Outline] This command selects the status item to be addressed by ASB (Automatic Status Back.
(1) 1st byte (Printer information) Bit 0 1 2 3 4 5 6 7 Status Unused Unused Status of pin 3 of drawer kick-out connector = “L” Status of pin 3 of drawer kick-out connector = “H” Online status Offline status Unused Cover closed Cover open Not in paper feed state triggered by FEED switch In paper feed state triggered by FEED switch Unused Hex. 00 00 00 04 00 08 01 00 20 00 40 00 Decimal 0 0 0 4 0 8 16 0 32 0 64 0 Hex. — — Decimal — — 00 0 04 4 00 08 00 00 20 00 40 00 0 8 0 0 32 0 64 0 Hex.
(4) 4th byte (Paper Sensor information) Bit 0 1 2 3 4 5 6 7 Status Undefined Undefined Undefined Undefined Unused Undefined Undefined Unused Hex. — — — — 00 — — 00 Decimal — — — — 0 — — 0 Hex.
GS r n [Function] Sending status [Code] <1D>H<72>H [Range] 1 n 2 49 n 50 [Outline] Sends the specified status to the host. n 1, 49 2, 50 [Caution] Function Sends the Paper Sensor status. Sends the Drawer Kick-out Connector status. • When the serial interface is used: For DTR/DSR control: The printer sends the status after verifying that the host is ready to receive. If the host is not ready to receive, the printer waits for the host to become ready to receive.
• Drawer kick-out connector status (n = 2, 50) Bit 0 1 2 3 4 5 6 7 [See Also] Status Status of pin 3 of drawer kick connector = “L” Status of pin 3 of drawer kick connector = “H” Undefined Undefined Undefined Unused Undefined Undefined Unused Appendix 4.3 “Identification of Send Status” DLE EOT, GS a — 59 — Hex.
2.2.7 Paper Detecting Commands ESC c 3 n [Function] Selecting the Paper Sensor valid for a Paper-end signal output [Code] <1B>H<63>H<33>H [Range] 0 [Outline] This command selects by which Paper Sensor a Paper-end signal should be output.
ESC c 4 n [Function] Selecting the Paper Near-end Sensor valid for print stop [Code] <1B>H<63>H<34>H [Range] 0 [Outline] This command selects the Paper Near-end Sensor which helps to stop printing when the paper supply almost runs out.
2.2.8 Panel Switch Commands ESC c 5 n [Function] Enabling/disabling the panel switches [Code] <1B>H<63>H<35>H [Range] 0 [Outline] Enabling/disabling the FEED switch. • “n” is valid only for the lowest bit (n0). • Control by the lowest bit (n0) is shown as follows: n n0 0 1 255 Condition FEED switch valid FEED switch invalid [Caution] • When the FEED switch is disabled with this command, the paper cannot be fed by operating the FEED switch.
2.2.9 Macro Commands GS : [Function] Starting/ending macro definition [Code] <1D>H<3A>H [Outline] Specifying starting/ending macro definition. Reception of this command during macro definition signifies ending the macro definition. [Caution] • Maximum content available for macro definition is 2048 bytes. A portion exceeding 2048 bytes is not defined. • When GS ^ is processed in macro definition, the macro definition is stopped and the content of definition is cleared.
GS ^ n1 n2 n3 [Function] Executing the macro [Code] <1D>H<5E>H [Range] 0 0 0 [Outline] Executing contents defined in macro. n1 : The number of times of macro execution n2 : Waiting time on macro execution: Waiting time of n2 × 100 msec is given for every execution. n3 : Macro execution mode n3 = 0 Continuous execution: The Macro is executed “n1” times continuously at the time interval specified by “n2”.
2.2.10 Cutter Commands GS V m ......... (1) GS V m n ..... (2) [Function] Cutting the paper [Code] (1) <1D>H<56>H (2) <1D>H<56>H [Range] (1) m = 1, m = 49 (2) m = 66 [Outline] Performs the specified paper cutting.
2.2.11 Bar Code Commands GS H n [Function] Selecting of printing position of HRI characters [Code] <1D>H<48>H [Range] 0 n 3 48 n 51 [Outline] Selecting printing position of HRI characters in printing bar codes. “n” means the followings. n 0, 48 1, 49 2, 50 3, 51 Printing Position No printing Above the bar code Below the bar code Both above and below the bar code The HRI characters refer to the bar code-turned characters so that you can read them.
[Print Results] No HRI characters Printed above Printed below Printed above and below — 67 —
GS f n [Function] Selecting the font of HRI characters [Code] <1D>H<66>H [Range] n = 0, 1 [Outline] Selecting the font of HRI characters in printing bar code. The type of font can be selected with “n” as follows: n 0, 48 1, 49 2, 50 Font Font A (12 × 24) Font B (9 × 24) Font C (8 × 16) The HRI characters refer to the bar code-turned characters so that you can read them. [Caution] The HRI characters are printed at the position specified with GS H.
GS h n [Function] Specifying the height of the bar code [Code] <1D>H<68>H [Range] 1 [Outline] Selecting bar code height. “n” denotes the number of dots in the vertical direction. [Default] n = 162 [See Also] GS k, GS w [Sample Program] Refer to Sample Program and Print Results for GS w.
GS k m [d1 ...... dk] NULL ......... (1) GS k m n [d1 ...... dn] ................ (2) [Function] Printing the bar code [Code] (1) <1D>H<6B>H [d1.....dk] NULL (2) <1D>H<6B>H [d1....dn] [Range] (1) 0 m 6 (2) 65 m 73 [Outline] Selects a bar code system and prints the bar code. The definitions of “k” and “d” vary with the bar code system. The definitions of “n” and “d” vary with the bar code system.
[Caution] For (1): • This command ends with a NULL code. • For UPC-A or UPC-E, the bar code is printed when 12 bytes of bar code data have been entered, and the subsequent data is handled as normal data. • For JAN13, the bar code is printed when 13 bytes of bar code data have been entered, and the subsequent data is handled as normal data. • For JAN8, the bar code is printed when 8 bytes of bar code data have been entered, and the subsequent data is handled as normal data.
[Description of Bar Codes] UPC-A This bar code, consisting of numerals only, has a fixed length of 12 columns; a 11column number entered from the host or application software plus a check digit (12th column) automatically calculated inside the printer. If the 12th-column numeral is sent from the host, the entire bar code will be printed as it is. UPC-E This bar code, consisting of numerals only, has a fixed length of 8 columns; the first number system character is “0” stationary.
Control Character ASCII Hex. NULL 00 SOH 01 STX 02 ETX 03 EOT 04 ENQ 05 ACK 06 BEL 07 BS 08 HT 09 LF 0A VT 0B FF 0C CR 0D SO 0E SI 0F CODE128 HRI Character ■U ■A ■B ■C ■D ■E ■F ■G ■H ■I ■J ■K ■L ■M ■N ■0 Control Character ASCII Hex.
When sending print data, note these points: (1) Each string of bar code data must begin with a code set select character (CODE A, CODE B, or CODE C), which selects the first code set to use. (2) Every special character is specified by a combination of two characters: a brace “{” followed by one character. A brace “{” itself is sent twice consecutively. Special characters Hex.
[Bar Code Print Example] UPC-A, UPC-E, JAN-13 (EAN), JAN-8 (EAN), CODE39, ITF, CODABAR, CODE93, CODE128 Type UPC-A Print Sample Outline of Symbol 12-column fixed-length bar code consisting of numerals only. UPC-E 8-column fixed-length bar code consisting of numerals only. Abbreviated version of UPC-A. JAN-13 13-column fixed-length bar code consisting of numerals only. JAN-8 8-column fixed-length bar code consisting of numerals only.
GS w n [Function] Specifying the horizontal size (magnification) of bar code [Code] <1D>H<77>H [Range] 2 [Outline] Selecting bar code width.
2.2.12 Commands for Non-volatile Memory FS pnm [Function] Printing the download NV bit images [Code] <1C>H<70>H [Range] 1 n 255 0 m 3 48 m 51 [Outline] This command prints the download NV bit images (n) using a specified mode (m). • “n” denotes the number of the download bit image. • “m” denotes the bit image mode.
F S q n [xL xH yL yH d1…dk] 1… [xL xH yL yH d1…dk] n [Function] Defining the download NV bit image [Code] <1C>H<71>H[]1 ...[]n [Range] 1 n 255, 0 xL 255, 0 xH 3 but, 1 (xL + xH × 256) 1023 0 yL 255 0 yH 1 but, 1 (yL + yH × 256) 288 0 d 255 k = (xL + xH × 256) × (yL + yH × 256) × 8 Total definition area = 2M bits (256K bytes) [Outline] This command defines the specified NV bit image. • “n” denotes the number of bit images to be defined.
• The maximum definition area of this printer is 2M bits (256K bytes). Multiple NV bit images can be defined, but bit images of which total size (Bit image data + Header) exceeds 2M bits (256K bytes) can not be defined. • The printer state will change to BUSY just before the writing operation into the non-volatile memory begins. Also,for a printer that have a dip switch [BUSY], the printer state will change to BUSY just before the writing operation begins regardless of the state of the dip switch.
2.2.13 Black Mark Control Commands GS FF (Valid Only at B.M Paper Selection) [Function] Printing and ejecting Black mark paper [Code] <1DH><0C>H [Outline] This command prints the data in the printer buffer and ejects Black mark paper. [Caution] Valid only if Black mark paper is selected. [See Also] FF, GS < GS < (Valid Only at B.
GS A m n (Valid Only at B.M Paper Selection) [Function] Correcting the leader position of Black mark paper [Code] <1DH><41>H [Range] 0 0 [Outline] This command sets the leader position of Black mark paper in terms of correction value set for the default position. “m” denotes the correcting direction. • “m” is valid only for the lowest bit (m0).
GS C0 m n [Function] Setting the numbering print mode [Code] <1D>H<43>H<30>H [Range] 0 0 [Outline] This command sets the numbering (serial number counter) print mode. “m” denotes the number of print columns. m=0 Prints the columns indicated by numeral. In this case, “n” has no meaning. m = 1 to 5 Indicates the maximum number of columns to be printed. Prints the counter in “m” columns. “n” specifies a printing position within the printing columns. n=0 Prints the data right justified.
GS C1 n1 n2 n3 n4 n5 n6 [Function] Setting the numbering counter mode (A) [Code] <1D>H<43>H<31>H [Range] 0 [Outline] This command sets the numbering (serial number counter) mode.
GS C2 n1 n2 [Function] Setting the numbering counter [Code] <1D>H<43>H<32>H [Range] 0 0 [Outline] This command sets the numbering (serial number counter) value. n1 + n2 × 256 (n1 = remainder, n2 = quotient) becomes a counter value. [Caution] • If the counter is set with this command, a repeat count of the idential count will be cleared. • If the counter value is beyond the range specified with the GS C1 or GS C; command, the counter will be initialized. [Default] Not defined.
GS C ; n1 ; n2 ; n3 ; n4 ; n5 ; [Function] Setting the numbering counter mode (B) [Code] <1D>H<43>H<3B>H<3B>H<3B>H <3B>H<3B>H<3B>H , , , , are character codes. [Range] 0 0 [Outline] This command sets the numbering (serial number counter) mode and a counter value.
GS c [Function] Print the counter [Code] <1D>H<63>H [Outline] This command prints the serial number counter data. After setting the current counter value in the print buffer as the print data (character string), it increments or decrements the counter according to the set count mode. [Caution] • The format used in setting the value to the print buffer depends on the GS C0 command. • The count mode is set by the GS C1 or GS C; command.
GS I n1L n1H n2L n2H [Function] Setting the Black mark length [Code] <1D>H<6C>H [Range] 0 n1L 0 n1H 8 n2L n2H = 0 [Outline] Define the specifications (length) of the Black mark used. n1: Sets the Black mark length n2: Sets the Black mark gap length n1 and n2 are specified units of millimeters. Divide the maximum Black mark length by 256 with the quotient designated as n1L and the remainder as n2H. Accordingly, the Black mark length available for setting will be n1L + n2H × 256.
2.2.14 Printer Function Setting Commands GS (D pL pH m [a1 b1] ··· [ak bk] [Function] Enabling or disabling real-time command [Code] <1d>H<28>H<44>pL pH m [a1 b1] ··· [ak bk] [Range] 3 (pL + pH × 256) m = 20 a=1 b = 0, 1, 48, 49 65535 [Default] a 1 [Outline] Kind of Real-time Command DLE DC4 fn m t(fn = 1): Real-time output of set pulse Default Valid Enables/disables the following real-time command processing. a 1 b 0, 48 1, 49 Function Does not process DLE DC4 fn m t (fn = 1).
GS (E pL pH fn [···] [Function] Printer function setting command [Outline] Printer function setting command is a command to change the function of the printer stored on the non-volatile memory and executes the function set by the value of “fn”. Function No. (fn) 1 2 3 4 5 6 7 8 9 10 11 12 255 Function Transfers to printer function setting mode. (Note) Terminates printer function setting mode. (Note) Sets memory switch value. (Note) Sends memory switch value set. Sets customize value.
fn = 1: Function 1 Transferring to Printer Function Setting Mode GS (E pL pH fn d1 d2 fn = 1 [Code] <1d>H<28>H<45>pL pH fn d1 d2 [Range] (pL + pH × 256) = 3 (pL = 3, pH = 0) fn = 1 d1 = 73 (“I”) d2 = 78 (“N”) [Outline] Transfers to printer function setting mode and sends the report of mode transfer. Hex. 37H 20H 00H Header ID NULL — 90 — No.
fn = 2: Function 2 End of Printer Function Setting Mode GS (E pL pH fn d1 d2 d3 fn = 2 [Code] <1d>H<28>H<45>pL pH fn d1 d2 d3 [Range] (pL + pH × 256) = 4 (pL = 4, pH = 0) fn = 2 d1 = 79 (“O”) d2 = 85 (“U”) d3 = 84 (“T”) [Outline] • Terminates printer function setting mode and executes resetting. Clears input buffer and print buffer and restores various kinds of setting to the state at power on. • Operates only in printer function setting mode.
fn = 3: Function 3 Setting Memory Switch Value GS (E pL pH fn [a1 b18 ··· b11] ··· [ak bk8 ··· bk1] fn = 3 [Code] <1d>H<28>H<45>pL pH fn[a1 b18···b11]···[ak bk8···bk1] [Range] 10 (pL + pH × 256) fn = 3 a = 1, 2, 3, 4 b = 48, 49, 50 [Outline] • Changes the memory switch set in a to the value set in “b”. b 48 49 50 65535 Function Sets corresponding bit to OFF. Sets corresponding bit to ON. Does not change corresponding bit.
• Setting memory switch 2 (a = 2) n 1 2 3 4 5 6 7 8 b (Set Value) 49 (Default) 48 49 (Default) 48 (Default) 49 48 49 (Default) 48 (Default) 49 48 (Default) 49 48 (Default) 48 (Default) 49 Function Reserved Disables auto cutter. Enables auto cutter. Enables stored printing. Disables stored printing. Sets printing at full columns to be the same as CBM1000. Sets printing at full columns to be the same as EPSON. After cover close and PE recovery, prints as it is.
• Setting memory switch 4 (a = 4) n 1 2 3 4 5 6 7 8 b (Set Value) Function 48 (Default) At the selection of Black mark paper, disables auto endmeasurement. 49 At the selection of Black mark paper, enables auto endmeasurement. 48 (Default) At the selection of Black mark paper, sets sensor position to be on the printing side. 49 At the selection of Black mark paper, sets sensor position to be on the back of the printing side.
fn = 4: Function 4 Sending the Set Memory Switch Value GS (E pL pH fn a fn = 4 [Code] <1d>H<28>H<45>pL pH fn a [Range] (pL + pH × 256) = 2 fn = 4 a = 1, 2, 3, 4 [Outline] • Sends the content of memory switch set in “a”. Hex. 37H 21H 30H or 31H 00H Header ID Data NULL No. of Data 1 1 8 1 • Sends the set value of data in 8-byte data raw in order of bits 8, 7, 6, ....
fn = 5: Function 5 Setting Customized Value GS (E pL pH fn [a1 n1L n1H]...[ak nkL nkH] fn = 5 [Code] <1d>H<28>H<45>pL pH fn [a1 n1L n1H]...[ak nkL nkH] [Range] 4 (pL + pH × 256) 65535 fn = 5 1 a 3 a = 5, 6, 97, 116, 201, 202 1 (nL + nH × 256) 65535 [Default] Described in the processing table for “a”. [Outline] • Sets the customized value set in “a” to (nL + nH × 256). a 3 5 6 97 116 201 202 Function Selects paper width. Selects printing density. Selects printing speed.
• a = 6: Sets printing speed to the value specified by (nL + nH × 256). (nL + nH × 256) 1 2 3 4 5 6 7 8 9 (Default) Printing Speed Printing speed level 1 (84%) Printing speed level 2 (86%) Printing speed level 3 (88%) Printing speed level 4 (90%) Printing speed level 5 (92%) Printing speed level 6 (94%) Printing speed level 7 (96%) Printing speed level 8 (98%) Printing speed level 9 (100%) • a = 97: Sets the number of divisions for conducting head specified by (nL + nH × 256).
fn = 6: Function 6 Sending the Set Customized Value GS (E pL pH fn a fn = 6 [Code] <1d>H<28>H<45>pL pH fn a [Range] (pL + pH × 256) = 2 : (pL = 2, pH = 0) fn = 6 1 a 3, a = 5, 6, 97, 116, 201, 202 [Outline] • Sends the set value of customized value set by “a”. Header ID Customized value No. Separation number Customized value NULL Hex. 37H 27H 30H ~ 39H 1FH 30H ~ 39H 00H No.
• a = 5: When print density is specified Setting Status Stored Print Value Density 65530 70% 65531 75% 65532 80% 65533 85% 65534 90% 65535 95% 0 Basic density 1 105% 2 110% 3 115% 4 120% 5 125% 6 130% 7 135% 8 140% Sending Data 1st Byte 2nd Byte 3rd Byte 4th Byte 5th Byte 54 (“6”) 54 (“6”) 54 (“6”) 54 (“6”) 54 (“6”) 54 (“6”) 48 (“0”) 49 (“1”) 50 (“2”) 51 (“3”) 52 (“4”) 53 (“5”) 54 (“6”) 55 (“7”) 56 (“8”) 53 (“5”) 53 (“5”) 53 (“5”) 53 (“5”) 53 (“5”) 53 (“5”) — — — — — — — — — 53 (“5”) 53 (“5”) 53 (“5
• a = 116: When kind of paper is specified Setting Status Stored Print Value Control Single-color 1 paper 2 2-color paper Sending Data 1st Byte 2nd Byte 3rd Byte 4th Byte 5th Byte 49 (“1”) — — — — 50 (“2”) — — — — • a = 201: When ACK output position is specified Setting Status Stored ACK Output Value Position 1 ACK-in-Busy ACK-while2 Busy ACK-after3 Busy Sending Data 1st Byte 2nd Byte 3rd Byte 4th Byte 5th Byte 49 (“1”) — — — — 50 (“2”) — — — — 51 (“3”) — — — — • a = 202
• a = 209: PNE sensor judgment time Setting Status Stored Density Value Multiplication 1 2 times 2 3 times 3 4 times 4 5 times 5 6 times Sending Data 1st Byte 2nd Byte 3rd Byte 4th Byte 5th Byte 49( “1”) 50 (“2”) 51 (“3”) 52 ( “4”) 53 (“5”) — — — — — — — — — — — — — — — — — — — — • a = 210: High-voltage error set value Setting Status Stored Paper Feed Value Amount 0 0 • • • • • • 255 255 Sending Data 1st Byte 2nd Byte 3rd Byte 4th Byte 5th Byte 48 (“0”) • • • 50 (“2”) 48 (“0”) • • • 53 (“5
fn = 7: Function 7 Copying User-defined Page GS (E pL pH fn a d1 d2 fn = 7 [Code] <1d>H<28>H<45>pL pH fn a d1 d2 [Range] (pL + pH × 256) = 4 : (pL = 4, pH = 0) fn = 7 a = 10, 12, 17 [Outline] • Copies the data of user-defined code page in the font specified by “a”. a 10 12 17 Font Type Font A: 12 (horizontal) × 24 (vertical) Font B: 9 (horizontal) × 17 (vertical) Font C: 8 (horizontal) × 16 (vertical) • Configuration of customized value No.
fn = 8: Function 8 Defining Data by the Column Format to Character Code Page of Work Area GS (E pL pH fn y c1 c2[x d1...d(y × x)]k fn = 8 [Code] <1d>H<28>H<45>pL pH fn y c1 c2 [x d1..
fn = 9: Function 9 Defining Data in the Raster Format to the Character Code Page of Work Area GS (E pL pH fn x c1 c2[y d1...d(y × x)]k fn = 9 [Code] <1d>H<28>H<45>pL pH fn x c1 c2 [y d1...
fn = 10: Function 10 Erasing Data of Character Code Page Data in Work Area GS (E pL pH fn c1 c2 fn = 10 [Code] <1d>H<28>H<45>pL pH fn c1 c2 [Range] (pL + pH × 256) = 3 fn = 10 128 c1 c2 255 [Outline] Erases (set to space) data in units of character on the character code page in work area. Operates only in printer function setting mode.
fn = 11: Function 11 Setting Communication Conditions of Serial Interface GS (E pL pH fn a d1...cdk fn = 11 [Code] <1d>H<28>H<45>pL pH fn a d1..dk [Range] 3 (pL + pH × 256) 65535 (0 pL 255, 0 pH 255) fn = 11 1 a 4 (Not changed in other than specified range) 48 d 57 (Not changed in other than specified range) 1 k 6 [Outline] Sets the communication conditions of serial interface specified by “a”.
fn = 12: Function 12 Sending the Set Communication Conditions of Serial Interface GS (E pL pH fn a fn = 12 [Code] <1d>H<28>H<45>pL pH fn a [Range] (pL + pH × 256) = 2 (pL = 2, pH = 0) fn = 12 1 a 4 (Does not send in other than specified range) [Outline] Sends communication conditions of serial interface specified by “a”. • a = 1: Setting baud rate Header ID Kind of communication conditions (a) Separation number Set value NULL Hex. 37H 33H 31H (“1”) ~ 34H (“4”) 1FH 30H ~ 39H 00H No.
fn = 255: Function 255 Setting All Contents Set by Printer Function Setting Mode to the State at Shipment GS (E pL pH fn a fn = 255 [Code] <1d>H<28>H<45>pL pH fn a [Range] (pL + pH × 256) = 2 fn = 255 a = 3, 5, 11, 255 [Outline] Restores various kinds of function set by printer function setting mode to the setting at the time of shipment (initial value described in User’s Manual).
GS (K pL pH fn m [Function] Selecting print control method [Outline] Executes the setting related to the print control specified by the value of “fn”. Function No. (fn) 49 50 97 200 201 202 203 204 205 206 207 208 Function Sets printing density. Sets printing speed. Sets the number of divisions for head conducting. Selects print paper. Sets paper feed amount at cover close. Sets paper feed amount after cutter operation.
fn = 49: Function 49 Setting Printing Density GS (K pL pH fn m fn = 49 [Code] <1d>H<28>H<4B>pL pH fn m [Range] (pL + pH × 256) = 2 : (pL = 2, pH = 0) fn = 49 0 m 9, 250 m 255 [Default] m = 0 (Customized value setting value) [Outline] Sets printing density.
fn = 50: Function 50 Setting Printing Speed GS (K pL pH fn m fn = 50 [Code] <1d>H<28>H<4B>pL pH fn m [Range] (pL + pH × 256) = 2 : (pL = 2, pH = 0) fn = 50 0 m 4, 48 m 52 [Default] m = 0 (Customized value setting) [Outline] Sets printing speed. m 0, 48 1, 49 2, 50 3, 51 4, 52 5, 53 6, 54 7, 55 8, 56 9, 57 Printing Speed Selects print control mode at power on. Selects printing speed level 1. Selects printing speed level 2. Selects printing speed level 3. Selects printing speed level 4.
fn = 97: Function 97 Setting Number of Divisions for Head Conducting GS (K pL pH fn m fn = 97 [Code] <1d>H<28>H<4B>pL pH fn m [Range] (pL + pH × 256) = 2 : (pL = 2, pH = 0) fn = 97 0 m 6, 48 m 52 [Default] m = 9 (Customize value setting) [Outline] Sets the number of divisions for head conducting. m 0, 48 2, 50 4, 52 No. of Divisions for Head Conducting No. of divisions at power on. Selects 2-division conducting. Selects 4-division conducting.
GS (M pL pH fn m [Function] Customizing the printer [Outline] Executes processing related to escape/recovery of the value set in the work area or the data defined by various kinds of command. fn 1, 49 2, 50 3, 51 Function Copies the set value stored in work area to the storage area. Copies the set value stored in storage area to the work area. Specifies the auto loading function of the set value at initialization to be valid or invalid.
fn = 1, 49: Function 1 GS (M pL pH fn m fn = 1, 49 [Code] <1d>H<28>H<4D>pL pH fn m [Range] (pL + pH × 256) = 2 : (pL = 2, pH = 0) fn = 1, 49 m = 1, 49 [Outline] Copies the set value stored in work area to the storage area. [Caution] • This command allows writing to non-volatile memory. Therefore, using this command frequently may result in breakage of non-volatile memory. Use this command appropriately [10 times max./day].
fn = 3, 51: Function 3 GS (M pL pH fn m fn = 3, 51 [Code] <1d>H<28>H<4D>pL pH fn m [Range] (pL + pH × 256) = 2 : (pL = 2, pH = 0) fn = 3, 51 m = 0, 1, 48, 49 [Outline] Determines the setting of storage area at initialization to the work area by the value of “m”. m 0, 48 1, 49 Function Does not copy data from storage area to work area at initialization. Copies data from storage area to work area at initialization.
GS (N pL pH fn m [Function] Designating font attribute [Outline] Executes processing of font attribute by the specified fn value. fn 48 Function Selects character color. fn = 48: Function 48 GS (N pL pH fn m fn = 48 [Code] <1d>H<28>H<4E>pL pH fn m [Range] (pL + pH × 256) = 2 : (pL = 2, pH = 0) fn = 48 m = 49 (At single color paper setting) m = 49, 50 (At 2-color paper setting) [Default] m = 49 [Outline] Prints the succeeding characters with the energy set in m.
2.2.15 Other Commands DLE ENQ n [Function] Real-time request to printer [Code] <10>H<05>H [Range] 1 [Outline] The printer responds in real-time to the request that the host specifies with number “n”. n 2 n 0 1 2 Function At the setting of execution of GS ^ by the FEED switch, the same processing as that pressing the FEED switch once is carried out. After recovering from an error, the printer resumes printing from the beginning of the line where the error occurred.
DLE DC4 fn m t (Specification of fn = 1) [Function] Outputting specified pulse in real-time [Code] <10>H<14>H [Range] fn = 1, 0 [Outline] • A signal specified with “t” is output to the connector pin specified with “m”. m 0 1 m 8, 1 t 8 Connector Pin Pin No. 2 of drawer kick-out connector Pin No. 5 of drawer kick-out connector • Set the ON time/OFF time to t × 100 ms, respectively.
DLE DC4 fn d1...d7 (Specification of fn = 8) [Function] Buffer clear [Code] <10>H<14>H ... [Range] fn = 8, d1 = 1, d2 = 3, d3 = 20, d4 = 1, d5 = 6, d6 = 2, d7 = 8 [Outline] • Erases all data in receiving buffer or print buffer. • Sends the following 3-byte data group. Header Identifier NULL Hex. 37H 25H 00H Decimal 55 37 0 No. of Data 1 byte 1 byte 1 byte • Enters the state of selecting STANDARD MODE.
ESC = n [Function] Data input control [Code] <1B>H<3D>H [Range] 0 [Outline] • Selecting equipment for which data input from the host is valid. • Each bit of “n” indicates as follows. • When the printer has not been selected, this printer abandons all the received data until it is selected by this command.
ESC @ [Function] Initializing the printer [Code] <1B>H<40>H [Outline] Clears data stored in the print buffer and brings various settings to the initial state (Default state). [Caution] • • • • • The settings of DIP switches are not read again. Data inside the internal input buffer is not cleared. Macro definitions are not cleared. NV bit image definitions are not cleared. Data in the user NV memory is not cleared.
ESC L [Function] Selecting PAGE MODE [Code] <1B>H<4C>H [Outline] Switches from STANDARD MODE to PAGE MODE. [Caution] • This command is only effective if it entered at the beginning of a line. • This command is not effective if it is entered when in PAGE MODE. • STANDARD MODE is restored when printing specified by FF is finished or when ESC S is issued. • The character mapping start position will be the point specified by ESC T in the print area specified by ESC W.
ESC S [Function] Selecting STANDARD MODE [Code] <1B>H<53>H [Outline] Switches from PAGE MODE to STANDARD MODE. [Caution] • This command is only effective if it is entered when in PAGE MODE. • Any data mapped in PAGE MODE is erased. • After this command is executed, the beginning of the line is taken as the next print start position. • The print area defined by ESC W is initialized.
ESC p m n1 n2 [Function] Generating the specified pulses [Code] <1B>H<70>H [Range] m = 0, 1, 48, 49 0 < n1 n2 255 [Outline] • The signals specified by “n1” and “n2” are output to the connector pin specified by “m”. • “m” has the followings. m 0, 48 1, 49 Connector Pin Drawer kick-out pin No. 2 Drawer kick-out pin No. 5 • The ON time is n1 × 2 ms, and OFF time n2 × 2 ms. [Caution] • When “m” is beyond a definition range, no signal is output, discarding “n1” and “n2”.
GS ( A pL pH n m [Function] Execution of test printing [Code] <1D>H<28>H<41>H [Range] (pL + (pH × 256)) = 2 (pL = 2, pH = 0) 0 n 2, 48 n 50 1 m 3, 49 m 51 [Outline] Specified test printing will be executed. • pL, pH will specify the number of subsequent parameters by (pL + (pH × 256))bytes. • “n” will specify the paper for test printing in the following table.
GS I n [Function] Sending the printer ID [Code] <1D>H<49>H [Range] 1 [Outline] Sends the specified printer ID. n 4, 49 n 1,49 2,50 3,51 4,52 n 52, 65 n 69, n=112, 250, 251 Type of Printer ID Model ID Type ID ROM version ID Black mark Length Specification Value (Hex.) CT-S300 35 Refer to table “Type ID” below 90h Depends on Black mark paper (mm) Sends the specified printer information.
n = 4, 52 specified (only for B.M specs) The Black mark length and mark interval currently used are returned in 4-byte code. All fractional parts in millimeters are rounded off. Byte 1 + Byte 2 × 256 = Black mark interval Byte 3 + Byte 4 × 256 = Black mark length (2) (1) Black mark paper [Caution] • Under DTR/DSR control, the printer sends the printer ID after verifying that the host is ready to receive. • Sending the Black mark length is valid only when Black mark paper is selected.
GS P x y [Function] Specifying the basic calculation pitch [Code] <1D>H<50>H [Range] 0 0 [Outline] • This command sets the horizontal basic calculation pitch to approx. 25.4/x mm (1/ x inches), and the vertical basic calculation pitch to approx. 25.4/y mm (1/y inches). • If x = 0, the horizontal basic calculation pitch is reverted to the default value. • If y = 0, the vertical basic calculation pitch is reverted to the default value.
ESC RS [Function] Sound buzzer [Code] <1B>H<1E>H [Outline] Sound the buzzer for 200 ms. [Caution] This command is buffered before execution. [Sample Program] LPRINT CHR$(&H1B);CHR$(&H1E); [Execution Result] The buzzer sounds for approx. 200 ms.
3. CHARACTER CODE TABLE 3.1 Code Page 3.1.
3.1.
3.1.
3.1.
3.1.
3.1.
3.1.
3.1.
3.1.
3.1.
3.1.
3.2 International Character Code Table Country U.S.A France Germany U.K.
4. APPENDIX 4.1 Explanation on PAGE MODE 4.1.1 Overview The printer has two print modes: STANDARD and PAGE. In STANDARD MODE, the printer prints or feeds paper each time it receives a print or paper feed command. In PAGE MODE, when the printer receives print commands and/or form feed commands, it simply forwards them to the specified print area of memory. Only when an ESC FF or FF is executed, all the data mapped in the print area will then be printed in a batch.
4.1.3 Mapping of Print Data in the Print Area Print data is mapped in the print area as follows: (1) The print area is set by ESC W. When the printer has finished all of the print and paper feed actions specified before receiving an ESC W, the ESC W sets the right end (as viewed facing the printer) as the start point (x0, y0) of the print area.
4.1.4 Example of Using PAGE MODE The following explains specific uses of PAGE MODE. When in PAGE MODE, the commands are typically sent from the host to the printer in the following sequence: (1) An ESC L puts the printer in PAGE MODE. (2) An ESC W specifies the print area. (3) An ESC T specifies the print direction. (4) Print data is sent. (5) An FF instructs the printer to print the print data in a batch. (6) After printing, the printer returns to STANDARD MODE.
In Figure 4-3, a line feed occurs between “lesson” and “Test 1” because the space “ “ next to “lesson” does not fit in the horizontal range of the 200 × 400-pitch print area. The line feed width conforms to the value specified by a command such as ESC 3. It is possible to set as many print areas as desired before executing FF. If print areas overlap each other, the print area setup data are ORed with the previous data. If you want to erase a section of mapped data, use the CAN command.
Before an FF is sent (170th line), the following program code can be added to remove part of the data. 180 PRINT #1, CHR$(&H1B);"W";CHR$(72);CHR$(0);CHR$(120);CHR$(0); 190 PRINT #1, CHR$(36);CHR$(0);CHR$(48)CHR$(0); 200 PRINT #1, CHR$(&H18); As a result of the additional program code, a print-out is executed as shown in Figure 4-5 “Print Result of Adding a Program of Example 3 to Example 2”, where the string “GHI” is removed.
4.2 Bidirectional Parallel Interface Overview The interface of the printer is a Level-1 compatible device according to IEEE-P1284. It supports the communication modes described in 4.2.1 below. 4.2.1 Parallel Interface Communication Mode The parallel interface of the printer provides three communication modes as outlined below. When the printer is turned on or reset, it defaults to Compatibility mode. • Compatibility Mode Data is transmitted from the host to the printer in units of one byte.
4.2.3 Negotiation Overview Usually, the printer is started in Compatibility mode, which corresponds to the Centronics interface phase. When the host intends to switch to the Nibble or Byte mode, it sends a request and negotiates with the printer. A general flow of negotiations is given below. (1) The host sets the IEEE 1284 Active signal to High. In response, the printer moves into the Negotiation phase. (2) The printer replies whether it can execute the mode requested by the host.
Precautions (1) The Negotiation phase is triggered when the IEEE 1284 Active signal sent by the host becomes High. (2) In Compatibility mode, the time when the negotiation process begins is, as a general rule, after the host sets nStrobe to High and then the printer outputs an nAck pulse.
Data Communication from Printer to Host Nibble Mode In this mode, data is transferred between the printer and the host through the procedure described below. The steps beginning from (1) are applicable when the Negotiation phase has switched to the Host Busy Data Available phase. If the Negotiation phase has switched to the Host Busy Data Not Available phase, the procedure starts at step (9).
Byte Mode In this mode, data is transferred between the printer and the host through the procedure described below. The steps beginning from (1) are applicable when the Negotiation phase has switched to the Host Busy Data Available phase. If the Negotiation phase has switched to the Host Busy Data Not Available phase, the procedure starts at step (9). (1) After the negotiations for the entry into the Byte mode are complete, the host indicates that it is ready to receive data from the printer.
Device ID The device ID is a character string that provides the ID, the type, and other information regarding the printer connected to the interface. When the printer receives a request for a device ID from the host, it replies with the following device ID: <00>H<2E>H MFG : CBM; CMD : ESC/POS; MDL : CT-S300; CLS : PRINTER; The first two bytes of the device ID indicate the length of the entire device ID. For a description of a request for a device ID, refer to the “Negotiation” section.
(2) Immediate termination: 1) If the interface is deactivated (IEEE 1284 Active: Low) without Event 22 having taken place, the printer immediately performs Termination. In this termination, the data is not guaranteed, and the printer switches the data bus from output to input within 1 µsec. In the Reverse Idle phase, the printer can notify the host that it has data to transfer to the host.