Wincor Nixdorf TH200 Programmer's Manual

TH200
High Speed Thermal Printer
Programmer’s Guide
TH200
March 2005
Programmer’s Guide TH200
1. Commands Summary Table................................................................................................................ 5
2. Description of Commands and Sequences....................................................................................... 8
HT .............................................................................................................................................................. 9
LF............................................................................................................................................................... 9
FF..............................................................................................................................................................9
CR........................................................................................................................................................... 10
CAN......................................................................................................................................................... 10
DLE EOT n............................................................................................................................................. 10
DLE ENQ n ............................................................................................................................................ 13
DLE DC4 n m t...................................................................................................................................... 14
ESC FF................................................................................................................................................... 14
ESC SP n ............................................................................................................................................... 15
ESC ! n ................................................................................................................................................... 16
ESC $ nL nH.......................................................................................................................................... 17
ESC % n................................................................................................................................................. 17
ESC & y c1 c2 [x1 d1...d(y × x1)]...[xk d1...d(y × xk)]...................................................................... 18
ESC * m nL nH d1... dk ........................................................................................................................ 20
ESC – n .................................................................................................................................................. 22
ESC 2...................................................................................................................................................... 22
ESC 3 n .................................................................................................................................................. 23
ESC = n.................................................................................................................................................. 23
ESC ? n .................................................................................................................................................. 24
ESC @.................................................................................................................................................... 24
ESC D n1...nk NUL............................................................................................................................... 25
ESC E n.................................................................................................................................................. 25
ESC G n ................................................................................................................................................. 26
ESC J n................................................................................................................................................... 26
ESC L...................................................................................................................................................... 27
ESC M n................................................................................................................................................. 27
ESC R n.................................................................................................................................................. 28
ESC S..................................................................................................................................................... 28
ESC T n.................................................................................................................................................. 29
ESC V n.................................................................................................................................................. 30
ESC W xL xH yL yH dxL dxH dyL dyH............................................................................................... 30
ESC \ nL nH........................................................................................................................................... 31
ESC a n .................................................................................................................................................. 32
ESC c 3 n ............................................................................................................................................... 33
ESC c 4 n ............................................................................................................................................... 33
ESC c 5 n ............................................................................................................................................... 34
ESC d n .................................................................................................................................................. 34
ESC p m t1 t2 ........................................................................................................................................ 35
ESC t n ................................................................................................................................................... 36
ESC { n................................................................................................................................................... 37
2
Programmer’s Guide TH200
FS g 1 m a1 a2 a3 a4 nL nH d1...dk.................................................................................................. 38
FS g 2 m a1 a2 a3 a4 nL nH............................................................................................................... 39
FS p n m................................................................................................................................................. 40
FS q n [xL xH yL yH d1...dk]1...[xL xH yL yH d1...dk]n.................................................................... 41
GS FF ..................................................................................................................................................... 43
GS ! n...................................................................................................................................................... 43
GS $ nL nH............................................................................................................................................. 45
GS ( A pL pH n m.................................................................................................................................. 46
GS * x y d1...d(x × y × 8)...................................................................................................................... 47
GS / m..................................................................................................................................................... 48
GS :......................................................................................................................................................... 48
GS B n .................................................................................................................................................... 49
GS H n.................................................................................................................................................... 49
GS I n...................................................................................................................................................... 50
GS L nL nH............................................................................................................................................. 51
GS P x y.................................................................................................................................................. 52
GS V m GS V m n........................................................................................................................ 53
GS W nL nH........................................................................................................................................... 54
GS \ nL nH.............................................................................................................................................. 55
GS ^ r t m ............................................................................................................................................... 56
GS a n..................................................................................................................................................... 57
GS f n...................................................................................................................................................... 59
GS h n..................................................................................................................................................... 59
GS k m d1...dk NUL GS k m n d1...dn.................................................................................... 60
GS r n...................................................................................................................................................... 63
GS v 0 m xL xH yL y H d1....dk............................................................................................................ 64
GS w n.................................................................................................................................................... 65
FS ! n.......................................................................................................................................................66
FS &........................................................................................................................................................ 67
FS – n ..................................................................................................................................................... 67
FS . .......................................................................................................................................................... 68
FS 2 c1 c2 d1...dk................................................................................................................................. 68
FS C n..................................................................................................................................................... 69
FS S n1 n2............................................................................................................................................. 70
FS W n.................................................................................................................................................... 71
3. Character Code Tables ...................................................................................................................... 72
3.1 Page 0 (PC437: USA).................................................................................................................... 72
3.2 PAGE1 (Katakana)......................................................................................................................... 73
3.3 Page 2 (PC850: Multilingual)........................................................................................................ 74
3.4 Page 3 (PC860: Portuguese) ....................................................................................................... 75
3.5 Page 4 (PC863: Canadian-French)............................................................................................. 76
3.6 Page 5 (PC865: Nordic) ................................................................................................................ 77
3.7 Page 18 (PC852 Latin2)................................................................................................................ 78
3.8 Page 19 (PC858)............................................................................................................................ 79
3
Programmer’s Guide TH200
3.9 Page 16 (WPC1252)...................................................................................................................... 80
3.10 Page 17 (PC866: Cyrillic #2)...................................................................................................... 81
3.11 Thai character code 11................................................................................................................ 82
3.12 International Character Set......................................................................................................... 83
4. Appendix.......................................................................................................................................... 84
Appendix A Printable Area & Cutting Positions.......................................................................... 84
Appendix B FEED button menu.................................................................................................. 85
Appendix C Hexadecimal Dump mode....................................................................................... 90
Appendix D Page Mode.............................................................................................................. 91
Appendix E Miscellaneous Notes............................................................................................... 95
Appendix F Marked Paper Specification.................................................................................... 96
Appendix G Transmission Status Identification........................................................................... 97
Appendix H EEPROM Setting Table........................................................................................... 98
Appendix I Example printing in page mode............................................................................. 100
Appendix J Code 128 bar code................................................................................................ 103
4
Programmer’s Guide TH200

1. Commands Summary Table

Command Name
HT Horizontal tab LF Print and line feed FF Print and return to standard mode (in page mode) % CR Print and carriage return CAN Cancel print data in page mode % DLE EOT Real-time status transmission DLE ENQ Real-time request to printer DLE DC4 Generate pulse at real-time ESC FF Print data in page mode % ESC SP Set right-side character spacing ESC ! Select print mode(s) ESC $ Set absolute print position ESC % Select/cancel user-defined character set ESC & Define user-defined characters ESC * Select bit-image mode ESC – n Turn underline mode on/off ESC 2 Select def ault line spacing ESC 3 Set line spacing ESC = Selec t peripheral device ESC ? Cancel user-defined characters ESC @ Initialize printer ESC D Set horizontal tab positions ESC E Turn emphasized mode on/off ESC G Turn double-strike mode on/off ESC J Print and feed paper ESC L Select page mode ESC M Select character font ESC R Select an international character set ESC S Select standard mode % ESC T Select print direction in page mode ESC V Turn 90° clockwise rotation mode on/off ESC W Set printing area in page mode ESC \ Set relative print position ESC a Select justification ESC c 3 Select paper sensor(s) to output paper-end signals
Parameter Setting
☆ ☆
☆ ☆
☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆
☆ ☆
(☆)
Std
Mode
☆ ☆
☆ ☆ ☆ ☆
☆ (☆) ☆
Page Mode
% 27
function
9 9 9 10 10 10 13 14 14
16
17 18 20 22 22
23 24 24 25 25 26
27 28 28 29 30
32 33
GS P
Page
15
17
23
26
30 31
5
Programmer’s Guide TH200
Parameter
Command Name
ESC c 4 Select paper sensor(s) to stop printing ESC c 5 Enable/disable panel button ESC d Print and feed n lines ESC p General pulse ESC t Select character code table ESC { Turn upside-down printing mode on/of f FS g 1 Write to NV user memory FS g 2 Read from NV user memory FS p Print NV bit image FS q Define NV bit image GS FF Feed next mark to the printing position GS ! Select character size GS $ Set absolute vertical print position in page mode % GS ( A Execute test print GS * Define downloaded bit image GS / Print downloaded bit image GS : Start/end macro definition GS B Turn white/black reverse printing mode on/off GS H Select printing position of HRI characters GS I Transmit printer ID GS L Set left margin GS P Set horizontal and vertical motion units GS V Select cut mode and cut paper GS W Set printing area width GS \ Set relative vertical print position in page mode % GS ^ Execute macro GS a Enable/disable Automatic Status Back (ASB) GS f Select font for HRI characters GS h Set bar code height GS k Print bar code GS r Transmit status GS v 0 Print raster bit image GS w Set bar code width
Setting
☆ ☆
☆ ☆ ☆ ☆ (☆)
☆ ☆ (☆)
☆ ☆
☆ ☆
☆ ☆ ☆ ☆ ☆ ☆
☆ ☆ (☆) ☆ ☆
(☆) ☆ ☆ (☆)
☆ ☆ ☆ ☆ ☆ ☆
Std
Mode
Page Mode
Disabled 34
Disabled 38
Disabled 40 Disabled 41
Disabled 46
Disabled 64
GS P
function
33 34
35 36 37
39
43 43
45
47 48 48 49 49 50
51
52
53 54
55
56 57 59 59 60 63
65
Page
6
Programmer’s Guide TH200
Kanji command list
(for Asia language models)
Command Name
Command
Type
Executing Setting
Standard
mode
Page mode
GS P
function
Page
FS ! Set print mode(s) for Kanji characters FS & Select Kanji character mode FS - Turn underline mode on/off for Kanji characters FS . Cancel Kanji character mode FS 2 Define user-defined Kanji characters FS C Select Kanji character code system FS S Set Kanji character spacing FS W Turn quadruple-size mode on/off for Kanji characters
☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆ ☆
Notes:
Parameter Setting: Set printer parameters.
Enabled only when the command is set at the beginning of a line.
Enabled only when data is not present in the printer buffer. % Ignored. No effect. Only value setting is possible.
Disabled: Parameters are processed as printable data.
66 67 67 68 68 69
70
71
7
Programmer’s Guide TH200

2. Description of Commands and Sequences

Format
Code: The code sequence.
ASCII : code Hex : hexadecimal equivalents. Decimal : decimal equivalents. [ ]k indicates contents of [ ] repeated k times.
Range: Allowable ranges for the arguments. Description: Describes the command’s function. Details: Describes the usage of the command in detail.
Notes: Additional information on setting and using the printer command. Default: Default parameter values, if any. Reference: Lists related commands. Example: Illustrations on command usage.
8
Programmer’s Guide TH200
HT Horizontal tab
Code:
Description: Notes:
Reference:
ASCII HT Hex 09 Decimal 09
Moves the print position to the next horizontal tab position.
This command is ignored unless the next horizontal tab position has been set. If the next horizontal tab position exceeds the printing area, the printer sets the printing
position to [Printing area width + 1].
Horizontal tab positions are set with ESC D. If this command is received when the printing position is at [printing area width + 1], the
printer executes print buffer-full printing of the current line and horizontal tab processing from the beginning of the next line.
The default setting of the horizontal tab position for the paper roll is font A (12×24) e very
8th character.
ESC D
LF
Print and line feed
Code:
Description: Notes: Reference:
ASCII LF Hex 0A Decimal 10 Prints the data in the print buffer and feeds one line based on the current line spacing. This command sets the print position to the beginning of the line.
ESC 2, ESC 3
FF
Print and return to standard mode in page mode
Code:
Description:
Notes:
Reference:
ASCII FF Hex 0C Decimal 12 Prints the data in the print buffer collectively and returns to standard mode in page mode, prints the data in the print buffer and feeds one line based on the current line spacing in standard mode.
This command is valid only in page mode. The buffer data is deleted after being printed. The printer does not execute paper cutting. This command sets the print position to the beginning of the line.
ESC FF, ESC L, ESC S
9
Programmer’s Guide TH200
CR Print and carriage return
Code:
Description:
Notes:
Reference:
ASCII CR Hex 0D Decimal 13 When automatic line feed is enabled, this command functions the same as LF; when automatic line feed is disabled, this command is ignored.
Sets the print starting position to the beginning of the line. This command is set according to the printer configuration.
LF
CAN Cancel print data in page mode
Code:
Description: Notes:
Reference:
ASCII CAN Hex 18 Decimal 24 In page mode, deletes all the print data in the current area.
This command is enabled only in page mode. If data that existed in the previously specified printing area also exists in the currently
specified printing area, it is deleted.
ESC L, ESC W
DLE EOT n Real-time status transmission
Code:
Range: Description:
Notes:
ASCII DLE EOT n Hex 10 04 n Decimal 16 4 n 1 n ≤ 4 Transmits the selected printer status specified by n in real-time, according to the following parameters:
n = 1: Transmit printer status n = 2: Transmit off-line status n = 3: Transmit error status n = 4: Transmit paper roll sensor status
The status is transmitted whenever the data sequence of <10>H<04>H< n> (1 n 4)
is received.
Example:
In ESC * m nL nH d1...dk, d1=<10>H, d2= <04>H, d3=<01>H
This command should not be used within the data sequence of another command that
consists of 2 or more bytes.
Example:
If you attempt to transmit ESC 3 n to the printer, but DTR (DSR for the
10
Programmer’s Guide TH200
Even though the printer is not selected using ESC = (select peripheral device), this
command is effective.
The printer transmits the current status. Each status is represented by one-byte data. The printer transmits the status without confirming whether the host computer can
receive data.
The printer executes this command upon receiving it. This command is executed even when the printer is off-line, the receive buffer is full, or
there is an error status with a serial interface model.
With a parallel interface model, this command is ignored. When Auto Status Back (ASB) is enabled using the GS a command, the status
transmitted by the DLE EOT command and the ASB status must be differentiated..
n = 1: Printer status
Bit Off/On Hex Decimal Function
0 Off 00 0 Not used. Fixed to Off 1 On 02 2 Not used. Fixed to On
Off 00 0 Drawer open/close signal is LOW (connector 2 On 04 4 Drawer open/close signal is HIGH (connector Off 00 0 On-line. 3
On 08 8 Off-line 4 On 10 16 Not used. Fixed to On 5,6 Undefined 7 Off 00 00 Not used. Fixed to Off.
n = 2: Off-line status
Bit Off/On Hex Decimal Function
0 Off 00 0 Not used. Fixed to Off 1 On 02 2 Not used. Fixed to On
Off 00 0 Cover is closed. 2 On 04 4 Cover is open Off 00 0 Paper is not being fed by using the 3 On 08 8 Paper is being fed by the FEED button
4 On 10 16 Not used. Fixed to On
Off 00 0 No paper-end stop. 5 On 20 32 Printing is being stopped. Off 00 0 No error. 6 On 40 64 Error occurs
7 Off 00 0 Not used. Fixed to Off
Bit 5: Becomes on when the paper end sensor detects paper end and printing stops.
host computer) goes to MARK before n is transmitted and then DLE EOT 3 interrupts before n is received, the code <10>H for DLE EOT 3 is processed as the code for ESC 3 <10>H.
11
Programmer’s Guide TH200
Reference:
n = 3: Error status
Bit Off/On Hex Decimal Function
0 Off 00 0 Not used. Fixed to Off 1 On 02 2 Not used. Fixed to On 2 Undefined
Off 00 0 No auto-cutter error 3 On 08 8 Auto-cutter error occurs.
4 On 10 16 Not used. Fixed to On
Off 00 0 No unrecoverable error 5 On 20 32 Unrecoverable error occurs Off 00 0 No auto-recoverable error. 6 On 40 64 Auto recoverable error occurs
7 Off 00 0 Not used. Fixed to Off
Bit 3: If these errors occur due to paper jams or the like, it is possible to recover by
correcting the cause of the error and executing DLE ENQ n (1 n 2). If an error due to a circuit failure (e.g. wire break) occurs, it is impossible to recover.
Bit 6: When printing is stopped due to high print head temperature until the print head
temperature drops sufficiently or when the paper roll cover is open during printing, bit 6 is On.
n = 4: Continuous paper sensor status
Bit Off/On Hex Decimal
Function
0 Off 00 0 Not used. Fixed to Off 1 On 02 2 Not used. Fixed to On
Off 00 0 Paper roll near-end sensor: paper 2,3 On 0C 12 Paper near-end is detected by the paper
4 On 10 16 Not used. Fixed to On.
Off 00 0 Paper roll sensor: Paper present 5,6 On 60 96 Paper roll end detected by paper roll
7 Off 00 0 Not used. Fixed to Off
DLE ENQ, GS a, GS r
12
Programmer’s Guide TH200
DLE ENQ n Real-time request to printer
Code:
Range: Description:
Notes:
Reference:
ASCII DLE ENQ n Hex 10 05 n Decimal 16 5 n 1 n ≤ 2 Responds to a request from the host computer. n specifies the requests as follows:
n Request
1 Recover from an error and restart printing from the line where the error occurred 2 Recover from an error after clearing the receive and print buffers
This command is effective only when an auto-cutter error occurs. The printer starts processing data upon receiving this command. This command is executed even when the printer is off-line, the receive buffer is full, or
there is an error status with a serial interface model.
With a parallel interface model, this command can not be executed when the printer is
busy.
The status is also transmitted whenever the data sequence of <10>H<05>H<n> (1 n
2) is received.
Example:
In ESC * m nL nH dk, d1 = <10>H, d2 = <05>H, d3 = <01>H
This command should not be contained within another command that consists of two or
more bytes.
Example:
If you attempt to transmit ESC 3 n to the printer, but DTR (DSR for the host computer) goes to MARK before n is transmitted, and DLE ENQ 2 interrupts before n is received, the code <10>H for DLE ENQ 2 is processed as the code for ESC 3 <10>H.
DLE ENQ 2 enables the printer to recover from an error after clearing the data in the
receive buffer and the print buffer. The printer retains the settings (by ESC !, ESC 3, etc.) that were in effect when the error occurred. The printer can be initialized completely by using this command and ESC @. This command is enabled only for errors that have the possibility of recovery, except for print head temperature error.
When the printer is disabled with ESC = (Select peripheral device), the error recovery
functions (DLE ENQ 1 and DLE ENQ 2) are enabled, and the other functions are disabled.
DLE EOT
13
Programmer’s Guide TH200
DLE DC4 n m t Generate pulse at real-time
Code:
Range:
Description:
Notes:
Reference:
ASCII DLE DC4 n m t Hex 10 14 n m t Decimal 16 20 n m t n = 1 m = 0, 1 1 ≤ t≤ 6 Outputs the pulse specified by t to connector pin m as follows:
m Connector pin
0 Drawer kick-out connector pin 2 1 Drawer kick-out connector pin 5
The pulse ON time is [t × 100 ms] and the OFF time is [t × 100ms].
When the pulse is output to the connector pin specified while ESC p or DEL DC4 is
executed while this command is processed, this command is ignored.
The printer executes this command upon receiving it. With a serial interface model, this command is executed even when the printer is
off-line, the receive buffer is full, or there is an error status.
With a parallel interface model, this command cannot be executed when the printer is
busy.
If print data includes the same character strings as this command, the printer performs
the same operation specified by this command. The user must consider this.
This command should not be used within the data sequence of another command that
consists of 2 or more bytes.
This command is effective even when the printer is disabled with ESC = (Select
peripheral device).
ESC p
ESC FF
Print data in page mode
Code:
Description: Notes:
Reference:
ASCII ESC FF Hex 1B 0C Decimal 27 12 In page mode, prints all buffered data in the printing area collectively.
This command is enabled only in page mode. After printing, the printer does not clear the buffered data, setting values for ESC T and
ESC W, and the position for buffering character data.
FF, ESC L, ESC S
14
Programmer’s Guide TH200
ESC SP n Set right-side character spacing
Code:
Range: Description:
Notes:
Default: Reference:
ASCII ESC SP n Hex 1B 20 n Decimal 27 32 n 0 n 255 Sets the character spacing for the right side of the character to [n × horizontal or vertical motion units]. The right-side character spacing for double-width mode is twice the normal value. When
characters are enlarged, the right-side character spacing is n times normal value.
This command sets values independently in each mode (standard and page modes). The horizontal and vertical motion uni ts are specified by GS P. Changing the horizontal
or vertical motion unit does not affect the current right-side spacing.
In standard mode, the horizontal motion unit is used. In page mode, the horizontal or vertical motion unit differs in page mode, depending on
starting position of the printable area as follows:
1 When the starting position is set to the upper left or lower right of the printable
area using ESC T, the horizontal motion unit (x) is used.
2 When the starting position is set to the upper right or lower left of the printable
area using ESC T, the vertical motion unit (y) is used.
The maximum right -side spacing is 255/180 inches. Any setting exceeding the
maximum is converted to the maximum automatically.
n = 0
GS P
15
Programmer’s Guide TH200
ESC ! n Select print mode(s)
Code:
Range: Description:
Notes:
Default: Reference:
ASCII ESC ! n Hex 1B 21 n Decimal 27 33 n 0 n 255 Selects print mode(s) using n as follows:
Bit Off/On Hex Decimal Function
Off 00 0 Character font A (12 × 24) 0 On 01 1 Character font B (9 × 17)
1,2 Undefined.
Off 00 0 Emphasized mode not selected 3 On 08 8 Emphasized mode selected Off 00 0 Double-height mode not selected 4 On 10 16 Double-height mode selected Off 00 0 Double-width mode not selected 5 On 20 32 Double-width mode selected
6 Undefined
Off 00 0 Underline mode not selected 7 On 80 128 Underline mode selected
When both double-height and double-width modes are selected, quadruple size Characters are printed. The printer can underline all characters, but can not underline the space set by HT or
90° clockwise rotated characters.
The thickness of the underline is that selected by ESC -, regardless of the character
size.
When some characters in a line are double or more in height, all the characters on the
line are aligned at the baseline.
ESC E can also turn on or off emphasized mode. However, the setting of the last
received command is effective.
ESC - can also turn on or off underline mode. However, the setting of the last received
command is effective.
GS ! can also select character size. However, the setting of the last received command
is effective. n = 0 ESC -, ESC E, GS !
16
Programmer’s Guide TH200
ESC $ nL nH Set absolute print position
Code:
Range:
Description:
Notes:
Reference:
ASCII ESC $ nL nH Hex 1B 24 nL nH Decimal 27 36 nL nH 0 nL 255 0 nH 255 Sets the distance from the beginning of the line to the position at which subsequent characters are to be printed. The distance from the beginning of the line to the print position is [(nL + nH × 256) ×
(vertical or horizontal motion unit)] inches.
Settings outside the specified printable area are ignored. The horizontal and vertical motion uni ts are specified by GS P. In standard mode, the horizontal motion unit (x) is used. In page mode, horizontal or vertical motion unit differs depending on the starting
position of the printable area as follows:
1When the starting position is set to the upper left or lower right of the printable area using ESC T, the horizontal motion unit (x) is used.
2When the starting position is set to the upper right or lower left of the printable area using ESC T, the vertical motion unit (y) is used.
ESC \, GS $, GS \, GS P
ESC % n Select/cancel user-defined character set
Code:
Range: Description:
Notes:
Default: Reference:
ASCII ESC % n Hex 1B 25 n Decimal 27 37 n 0 n 255 Selects or cancels the user-defined character set.
When the LSB of n is 0, the user-defined character set is canceled. When the LSB of n is 1, the user-defined character set is selected.
When the user-defined character set is canceled, the internal character set is
automatically selected. n is available only for the least significant bit. n = 0 ESC &, ESC ?
17
Programmer’s Guide TH200
ESC & y c1 c2 [x1 d1...d(y × x1)]...[xk d1...d(y × xk)] Define user-defined characters
Code:
Range:
Description:
Notes:
Default: Reference: Example:
ASCII ESC & y c1 c2 [x1 d1...d(y × x1)] ... [xk d1...d(y × xk)] Hex 1B 26 y c1 c2 [x1 d1...d(y × x1)] ... [xk d1...d(y × xk)] Decimal 27 38 y c1 c2 [x1 d1...d(y × x1)] ... [xk d1...d(y × xk)] y = 3 32 ≤ c1 ≤ c2 ≤ 127 0< x 24 0 ≤ d1 ... d(y × xk) 255 Defines user-defined characters.
y specifies the number of bytes in the vertical direction. c1 specifies the beginning character code for the definition, and c2 specifies the final
code. x specifies the number of dots in the horizontal direction. The allowable character code range is from ASCII code <20>H to <7F>H (96
characters). It is possible to define multiple characters for consecutive character codes. If only one
character is desired, use c1 = c2. d is the dot data for the characters. The dot pattern is in the horizontal direction from the
left side. Any remaining dots on the right side are blank.
The data to define a user-defined character is (y × x) bytes. Set a corresponding bit to 1 to print a dot or 0 to not print a dot. A user-defined character and a downloaded bit image can be defined simultaneously. The user-defined character definition is cleared when:
ESC ? is executed. The the power is turned off.
When the user-defined characters are defined in font B (9 × 17), only the most
significant bit of the 3rd byte of data in vertical direction is effective. The internal character set ESC %, ESC ? When font A (12 × 24) is selected.
18
Programmer’s Guide TH200
· When font B (9×17) is selected.
19
Programmer’s Guide TH200
ESC * m nL nH d1... dk Select bit-image mode
Code:
Range:
Description:
Notes:
ASCII ESC * m nL nH d1...dk Hex 1B 2A m nL nH d1...dk Decimal 27 42 m nL nH d1...dk m = 0, 1, 32, 33 0 nL 255 0 nH ≤ 3 0 d 255 Selects a bit-image mode using m for the number of dots specified by nL and nH, as follows:
m Mode
Vertical Direction Horizontal Direction Number of Dots
Dot Density
Dot density
Number of Data (K)
0 8-dot single-density 8 60 DPI 101 DPI nL + nH × 256 1 8-dot double-density 8 60 DPI 203 DPI nL + nH × 256
32 24-dot single-density 24 180 DPI 101 DPI (nL + nH × 256) × 33 24-dot double-density 24 180 DP 203 DPI (nL + nH × 256) ×
If the value of m is out of the specified range, nL and data following are processed as
normal data. The nL and nH indicate the number of dots of the bit image in the horizontal direction.
The number of dots is calculated by nL + nH × 256. If the bit-image data input exceeds the number of dots to be printed on a line, the
excess data is ignored. d indicates the bit-image data. Set a corresponding bit to 1 to print a dot or to 0 to not
print a dot.
After printing a bit image, the printer returns to normal data processing mode. This command is not affected by print modes (emphasized, double-strike, underline,
character size or white/black reverse printing), except upside-down printing mode.
The relationship between the image data and the dots to be printed is as follows: When 8-dot bit image is selected:
20
Programmer’s Guide TH200
When 24-dot bit image is selected:
21
Programmer’s Guide TH200
ESC – n Turn underline mode on/off
Code:
Range: Description:
Notes:
Default: Reference:
ASCII ESC - n Hex 1B 2D n Decimal 27 45 n 0 n 2, 48 n 50 Turns underline mode on or off, based on the following values of n:
n Function
0, 48 Turns off underline mode 1, 49 Turns on underline mode (1-dot thick) 2, 50 Turns on underline mode (2-dots thick)
The printer can underline all characters (including right-side character spacing), but
cannot underline the space set by HT. The printer cannot underline 90° clockwise rotated characters and white/black inverted
characters. When underline mode is turned off by setting the value of n to 0 or 48, the following data
is not underlined, and the underline thickness set before the mode is turned off does not
change. The default underline thickness is 1 dot.
Changing the character size does not affect the current underline thickness. Underline mode can also be turned on or off by using ESC !. Note, however, that the
last received command is eff ective. n = 0
ESC !
ESC 2 Select default line spacing
Code:
Description: Notes: Reference:
ASCII ESC 2 Hex 1B 32 Decimal 27 50 Selects 1/6-inch line (approximately 4.23mm) spacing. The line spacing can be set independently in standard mode and in page mode. ESC 3
22
Programmer’s Guide TH200
ESC 3 n Set line spacing
Code:
Range: Description: Notes:
Default: Reference:
ASCII ESC 3 n Hex 1B 33 n Decimal 27 51 n 0 n 255 Sets the line spacing to [n × vertical or horizontal motion unit] inches.
The line spacing can be set independently in standard mode and in page mode. The horizontal and vertical motion uni ts are specified by GS P. Changing the horizontal
or vertical motion unit does not affect the current line spacing.
In standard mode, the vertical motion unit (y) is used. In page mode, this command functions as follows, depending on the starting position of
the printable area:
When the starting position is set to the upper left or lower right of the
printable area using ESC T, the vertical motion unit (y) is used.
When the starting position is set to the upper right or lower left of the
print able area using ESC T, the horizontal motion unit (x) is used.
The maximum paper feed amount is 1016 mm (40 inches). Even if a paper feed amount
of more than 1016 mm (40 inches) is set, the printer feeds the paper only 1016 mm (40
inches). Line spacing equivalent to approximately 4.23mm (1/6 inches).
ESC 2, GS P
ESC = n Set peripheral device
Code:
Range: Description:
Notes:
Default:
ASCII ESC = n Hex 1B 3D n Decimal 27 61 n 0 n ≤ 1 Selects device to which host computer sends data, using n as follows:
Bit Off/On Hex Decimal Function
Off 00 0 Printer disabled 0 On 01 1 Printer enabled
1-7 Undefined
When the printer is disabled, it ignores all data except for error-recovery commands (DLE EOT, DLE ENQ, DLE DC4) until it is enabled by this command. n = 1
23
Programmer’s Guide TH200
ESC ? n Cancel user-defined characters
Code:
Range: Description: Notes:
Reference:
ASCII ESC ? n Hex 1B 3F n Decimal 27 63 n 32 n 127 Cancels user-defined characters. This command cancels the pattern defined for the character code specified by n. After
the user-defined characters are canceled, the corresponding pattern for the internal
character is printed. This command deletes the pattern defined for the specified code in the font selected by
ESC !. If a user-defined character has not been defined for the specified character code, the
printer ignores this command.
ESC &, ESC %
ESC @ Initialize printer
Code:
Description:
Notes:
ASCII ESC @ Hex 1B 40 Decimal 27 64 Clears the data in the print buffer and resets the printer mode to the mode that was in effect when the power was turned on.
The DIP switch settings are not checked again. The data in the receive buffer is not cleared. The macro definition is not cleared. The NV bit image data is not cleared. The data of the user NV memory is not cleared.
24
Programmer’s Guide TH200
ESC D n1...nk NUL Set horizontal tab positions
Code:
Range:
Description:
Notes:
Default:
Reference:
ASCII ESC D n1... nk NUL Hex 1B 44 n1...nk 00 Decimal 27 68 n1...nk 0 1 n 255 1 ≤ k ≤ 32 Sets horizontal tab positions. n specifies the column number for setting a horizontal tab position from the beginning of
the line. k indicates the total number of horizontal tab positions to be set. The horizontal tab position is stored as a value of [character width × n] measured from
the beginning of the line. The character width includes the right-side character spacing,
and double-width characters are set with twice the width of normal characters.
This command cancels the previous horizontal tab settings. When setting n = 8, the print position is moved to column 9 by sending HT. Up to 32 tab positions (k = 32) can be set. Data exceeding 32 tab positions is processed
as normal data.
Transmit [n] k in ascending order and place a NUL code 0 at the end. When [n] k is less than or equal to the preceding value [n] k-1, tab setting is finished and
the following data is processed as normal data.
ESC D NUL cancels all horizontal tab positions. The previously specified horizontal tab positions do not change, even if the character
width changes. The character width is memorized for each standard and page mode. The default tab positions are at intervals of 8 characters (columns 9, 17, 25, ...) for font A (12 × 24).
HT
ESC E n Turn emphasized mode on/off
Code:
Range: Description:
Notes:
Default: Reference:
ASCII ESC E n Hex 1B 45 n Decimal 27 69 n 0 n 255 Turns emphasized mode on or off
When the LSB of n is 0, emphasized mode is turned off. When the LSB of n is 1, emphasized mode is turned on.
Only the least significant bit of n is enabled. This command and ESC ! turn on and off emphasi zed mode in the same way. Be careful when this command is used with ESC !.
n = 0 ESC !
25
Programmer’s Guide TH200
ESC G n Turn on/off double-strike mode
Code:
Range: Description:
Notes:
Default: Reference:
ASCII ESC G n Hex 1B 47 n Decimal 27 71 n 0 n 255 Turns double-strike mode on or off.
When the LSB of n is 0, double-strike mode is turned off. When the LSB of n is 1, double-strike mode is turned on.
Only the lowest bit of n is enabled. Printer output is the same in double-strike mode and in emphasized mode.
n = 0
ESC E
ESC J n Print and feed paper
Code:
Range: Description:
Notes:
Reference:
ASCII ESC J n Hex 1B 4A n Decimal 27 74 n 0 n 255 Prints the data in the print buffer and feeds the paper [n × vertical or horizontal motion unit] inches. After printing is completed, this command sets the print starting position to the
beginning of the line.
The paper feed amount set by this command does not affect the values set by ESC 2 or
ESC 3.
The horizontal and vertical motion units are specified by GS P. In standard mode, the printer uses the vertical motion unit (y). In page mode, this command functions as follows, depending on the starting position of
the printable area:
When the starting position is set to the upper left or lower right of the
printable area using ESC T, the vertical motion unit (y) is used.
When the starting position is set to the upper right or lower left of the
print able area using ESC T, the horizontal motion unit (x) is used.
The maximum line spacing is 1016mm (40 inches). When the setting value exceeds the
maximum, it is converted to the maximum automatically.
GS P
26
Programmer’s Guide TH200
ESC L Select page mode
Code:
Description: Notes:
Reference:
ASCII ESC L Hex 1B 4C Decimal 27 76 Switches from standard mode to page mode. This command is enabled only when processed at the beginning of a line in standard
mode.
This command has no effect in page mode. After printing by FF is completed or by using ESC S, the printer returns to standard
mode.
This command sets the position where data is buffered to the position specified by ESC
T within the printing area defined by ESC W.
This command switches the settings for the following commands (in which the values
can be set independently in standard mode and page mode) to those for page mode:
Set right-side character spacing: ESC SP, FS S Select default line spacing: ESC 2, ESC 3
Only value settings is possible for the followi ng commands in page mode; these
commands are not executed.
Turn 90° clockwise rotation mode on/off: ESC V Select justification: ESC a Turn upside-down printing mode on/off: ESC { Set left margin: GS L Set printable area width: GS W
The printer returns to standard mode when power is turned on, the printer is reset, or
ESC @ is used. FF, CAN, ESC FF, ESC S, ESC T, ESC W, GS $, GS \
ESC M n
Select character font
Code:
Range: Description:
ASCII ESC M n Hex 1B 4D n Decimal 27 77 n n = 0, 1, 2,3,48, 49,50,51 Selects character fonts.
N Function
0,48 Character font A (12 × 24) selected 1,49 Character font B (9 × 17) selected 2,50 User defined character selected 3,51 Chinese font(24 × 24) selected
27
Programmer’s Guide TH200
ESC R n Select an international character set
Code:
Range: Description:
Default:
ASCII ESC R n Hex 1B 52 n Decimal 27 82 n 0 n 12 Selects an international character set n from the following table,see
N Character set
0 U.S.A 1 France 2 Germany 3 U.K 4 Denmark I 5 Sweden 6 Italy 7 Spain I 8 Japan 9 Norway 10 Denmark II 11 Spain II 12 Latin America 13 Korea
n = 0
ESC S Select standard mode
Code:
Description: Notes:
ASCII ESC S Hex 1B 53 Decimal 27 83 Switches from page mode to standard mode.
This command is effective only in page mode. Data buffered in page mode are cleared. This command sets the print position to the beginning of the line. The printing area set by ESC W is initialized. This command switches the settings for the following commands (in which the values
can be set independently in standard mode and page mode) to those for standard
mode:
Set right-side character spacing: ESC SP, FS S Select default line spacing: ESC 2, ESC 3
The followi ng commands are enabled only to set in standard mode.
Set printing area in page mode: ESC W Select print direction in page mode: ESC T
The followi ng commands are ignored in standard mode.
Set absolute vertical print position in page mode: GS $
28
Programmer’s Guide TH200
Reference:
Standard mode is selected automatically when power is turned on, the printer is reset,
or command ESC @ is used. FF, ESC FF, ESC L
Set relative vertical print position in page mode: GS \
ESC T n Select print direction in page mode
Code:
Range:
Description:
ASCII ESC T n Hex 1B 54 n Decimal 27 84 n 0 n 3 48 n 51 Selects the print direction and starting position in page mode. n specifies the print direction and starting position as follows:
Notes:
Default: Reference:
When the command is input in standard mode, the printer executes only internal flag
operation. This command does not affect printing in standard mode. This command sets the position where data is buffered within the printing area set by
ESC W. Parameters for horizontal or vertical motion units (x or y) differ as follows, depending on
the starting position of the printing area:
If the starting position is the upper left or lower right of the printing area,
data is buffered in the direction perpendicular to the paper feed direction: Commands using horizontal motion units: ESC SP, ESC $, ESC \ Commands using vertical motion units: ESC 3, ESC J, GS $, GS \
If the starting position is the upper right or lower left of the printing area,
data is buffered in the paper feed direction:
Commands using horizontal motion units: ESC 3, ESC J, GS $, GS \ Commands using vertical motion units: ESC SP, ESC $, ESC \
n = 0 ESC $, ESC L, ESC W, ESC \, GS $, GS P, GS \
29
Programmer’s Guide TH200
ESC V n Turn 90° clockwise rotation mode on/off
Code:
Range: Description:
Notes:
Default: Reference:
ASCII ESC V n Hex 1B 56 n Decimal 27 86 n 0 n 1, 48 n 49 Turns 90° clockwise rotation mode on/off. n is used as follows:
n Function
0, 48 Turns off 90° clockwise rotation mode 1, 49 Turns on 90° clockwise rotation mode
This command affects printing in standard mode. However, the setting is always
effective. When underline mode is turned on, the printer does not underline 90°
clockwise-rotated. Double-width and double-height commands in 90° rotation mode enlarge characters in
the opposite directions from double-height and double- width commands in normal
mode. n = 0
ESC !, ESC -
ESC W xL xH yL yH dxL dxH dyL dyH Set printing area in page mode
Code:
Range: Description:
Notes:
ASCII ESC W xL xH yL yH dxL dxH dyL dyH Hex 1B 57 xL xH yL yH dxL dxH dyL dyH Decimal 27 87 xL xH yL yH dxL dxH dyL dyH 0 xL, xH, yL, yH, dxL, dxH, dyL, dyH ≤ 255 (except dxL = dxH = 0 or dyL = dyH = 0) The horizontal starting position, vertical starting position, printing area width, and printing area height are defined as x0, y0, dx (inch), dy (inch), respectively. Each setting for the printing area is calculated as follows:
x0 = [(xL + xH × 256) × (horizontal motion unit)] y0 = [(yL + yH × 256) × (vertical motion unit)] dx = [dxL + dxH × 256) × (horizontal motion unit)] dy = [dyL + dyH × 256) × (vertical motion unit)] The printing area is set as shown in the figure below.
If this command is input in standard mode, the printer executes only internal flag
operation. This command does not affect printing in standard mode. If the horizontal or vertical starting position is set outside the printable area, the printer
stops command processing and processes the following data as normal data. If the printing area width or height is set to 0, the printer stops command processing and
processes the following data as normal data.
This command sets the position where data is buffered to the position specified by ESC
T within the printing area.
If (horizontal starting position + printing area width) exceeds the printable area, the
30
Loading...
+ 76 hidden pages