Wincor Nixdorf TH320, TH420 Programmer's Manual

TH
320/TH420
Two-Color Thermal / Impact Hybrid Printer
Programmers Guide
We
would like to know
your opinion on this publication. Please send us a copy of this page
if you have any constructive criticism on:
- the contents
- the layout
- the product We would like to thank you in advance
for your comments. With kind regards, Wincor Nixdorf International GmbH RD PD1 Rohrdamm 7 D-13629 Berlin
Your opinion:

TH320 / TH420, Programmers Guide, Edition December 2010

Co
pyright © Wincor Nixdorf I nternational Gm bH, 2010
The reproducti on, tra nsmission or u s e of this document or its con t ents is not per mitted without express
authority. Offenders will be liable for damages. All rights, in cludi ng righ t s created by patent g rant o r
registration of a utility model or design, are reserved.
Delivery subject to availability; technical modifications possible.
Cont
ents
Printer Status and Indicators 1
Startup diagnostics 1 Runtime Diagnostics 1 Remote Diagnostics 2 Indicators 3
Moving from the A756 to the TH320 4
Moving from the A756, A758 and TH420 to the TH320 (Slip Differences): 5
Commands 6
Emulation Commands 6
Set Printer ID Mode 6 Set Printer ID 6 Set Printer Emulation 6
TH320 Configuration Commands 7
Select Slip lines per inch 7 Select TH320 Narrow Slip Configuration Option to Ignore n Leading Spaces 7 Select TH320 Narrow slip 51 –column Compressed Print Option 7 Select TH320 Delete Slip Trailing Spaces Option 8 Select TH320 (21 and 25-line) Rotated Slip Print Options 8 Select TH320 Slip Stop Options 8 TH320 Configurable Slip Commands 9
Moving from A756/A758 to TH320 10
Two-color commands 10
Programming the Printer 12
Overview of Printing Characteristics 12 Character appearance 12 Receipt character specification 12 Print zones 13
Print zones for receipt station 80 mm paper 13 Print zones for slip station TH320 13 Print Zones for Slip, Validation TH320 14 Print zones for slip station TH420 15
Rotated printing commands 16
Command Descriptions 17
Command conventions 17 Printer actions 17
Clear printer 17 Close form 18 Open form 18 Perform partial knife cut 18 Return home 18 Select peripheral device (for multi-drop) 18 Initialize printer 19 Set slip paper eject length 19 Select receipt or slip for printing; slip for MICR read 19 Select receipt or slip for setting line spacing 20 Select paper sensors to output paper end signals 20 Select sensors to stop printing 20 Enable or disable panel button 21 Set slip paper waiting time 21 Generate pulse to open cash drawer 21 Release Paper 22 Set current color 22 Select slip station 22 Select receipt station 22 Select cut mode and cut paper 23
m Fe
ed and cut mode 23 Set paper type 23 Set interpretation of “Set current color” command 24 Print test form 24
Print and paper feed 25
Print and feed paper one line 25 Print and eject slip 25 Print and carriage return 25 Feed n print lines 25 Feed n dot rows 26 Print 26 Print and feed paper 26 Print and reverse feed paper 26 Print and feed n lines 27 Print and reverse feed n lines 27 Reverse feed n lines 27 Reverse feed n dots 27
Vertical and horizontal positioning 28
Horizontal tab 28 Add n extra dot rows 28 Set column 30 Set absolute starting position 30 Set vertical line spacing to1/6 inch 30 Set vertical line spacing 31 Set horizontal tab positions 31 Set relative print position 32 Select justification 33 Set left margin 33 Set horizontal and vertical minimum motion units 34 Set printing area width 35 Turn smoothing mode on/off 36
Text characteristics commands 36
Select double-wide characters 36 Select single-wid e characters 36 Select 90 degree counter-clockwise rotated print 37 Select pitch (column width) 37 Set right-side character spacing 38 Select print mode 38 Select or cancel user-defined character set 39 Define user-defined character set 39 Select or cancel underline mode 40 Copy character set from ROM to RAM 41 Cancel user-defined character 41 Select or cancel emphasized mode 41 Select double-strike 42 Cancel double-strike 42 Select or cancel italic print 42 Select international character set 43
Select character code table 43
Selector cancel 90 degree clockwise rotated print 43 Selector cancel upside-down print mode 44 Select character size 44 Selector cancel white/black reverse print mode 45 Reverse color text mode 45 Text strike - through mode 46 Select super script or subscript modes 46
Graphics 46
Download BMP logo 46 Select bit image mode 47
Se
lect double-density graphics 48 Select the current logo (downloaded bit image) 49 Define downloaded bit image 49 Print downloaded bit image 50 Print raster monochrome graphics 51 Print raster color graphics 51 Print raster color graphics 51 Download logo image 52 Apply shading to logo 52 Merge watermark mode 53 Monochrome shade mode 53 Color shade mode 53 Logo print with color plane swap 54 Form and merge real-time surround graphic 54 Save graphics buffer as logo 55 Background logo print mode 55 Shade and store logo 55 Logo print with knife cut 56 Apply margin message mode 56 Set temporary max target speed 57 Set colorization 57 Set attribute mapping 60 Convert 6-dots/ mm bitmap to 8-dots/ mm bitmap 61 Enable constant speed logos 62 Allocate extra RAM for character build 62
Status Command 63
Transmit peripheral device status 63 Transmit paper sensor status 64 Transmit printer ID 64 Transmit printer ID, remote diagnostic extension 65 Transmit Status 68 Slip paper status (n = 3 or n = 51) 70
Real-time commands 71
Send Printer Software Version 72
Busy line and fault conditions 73
Real-time status transmission 73 Real-time request to printer 75 Real-time printer status transmission 76 Real-time commands disable 76
Unsolicited status mode 77
Select or cancel unsolicited status mode (USM) 77
Recognizing data from the printer 79 Barcodes 80
Select printing position of HRI characters 80 Select pitch of HRI characters 80 Select bar code height 80 Print barcode 81 Set GS1DataBar (RSS) parameters 83 Print GS1DataBar (RSS), data length specified 83 Print GS1DataBar (RSS barcode), null terminated 84 Select PDF 417 parameters 84 Select bar code width 85
Page mode 86
Print and return to standard mode 86 Cancel print data in page mode 86 Print data in page mode 86 Select page mode 87 Select standard mode 88 Select print direction in page mode 88
Se
t print area in page mode 89 Set absolute vertical print position in page mode 90 Set relative vertical print position in page mode 90
Macros 91
Select or cancel macro definition 91 Execute macro 92
MICR commands (TH320 MICR models only) 93
Read MICR data and transmit 93 Transmit last MICR read 93
MICR parsing 93
Define parsing format, save in NVRAM 93 Define parsing format, do not save permanently 94 Parsing parameter string options 94 Sample parsing formats 95 Check serial number 97 Loading the exception table 98 Exception table entry format 98 Maintaining the exception table 100
User data storage 100
Write to user data storage 100 Read from user data storage 100 Read from non-volatile memory 100 Write to non-volatile memory (NVRAM) 101 Select memory type (SRAM/flash) where to save logos or user-defined fonts 101 Flash memory user sectors allocation 101 Erase user flash sector 102 User storage status 103
Flash download 104
Switch to flash download mode 104 Return boot sector firmware part number 104 Return segment number status of flash memory 105 Select flash memory sector to download 105 Get firmware CRC 105 Return microprocessor CRC 105 Erase all flash contents except boot sector 106 Return main program flash CRC 106 Erase selected flash sector 106 Erase all flash contents except boot sector 106 Download to active flash sector 107 Download paper type description 107 Reset firmware 108 Return paper type description 108
Appendix 109
Commands listed by hexadecimal code 109 Character Sets 113
Character code 437: USA, Standard Europe 113 Codepage 737 (Greek) 114 Codepage 850 (Multilingual) 115 Codepage 852 (Slavic) 116 Codepage 857 (Turkish) 117 Codepage 858 (with Euro symbol) 118 Codepage 860 (Portuguese) 119 Codepage 862 (Hebrew) 120 Codepage 863 (French Canadian) 121 Codepage 865 (Nordic) 122 Codepage 866 (Cyrillic) 123 Codepage 1252 (Windows Latin 1) 124 Codepage 1251 (Cyrillic) 125 Codepage 1255 (Hebrew) 126
El
ectronic Journal 127
Electronic Journal Storage Commands 129
1F 0A C1 Enable Auto Journal Mode 129 1F 0A C2 Disable Auto Journal Mode 129 1F 0A C3 Clear Journal 129 1F 0A C4 Print Journal 129 1F 0A C5 Return Journal Status 129 1F 0A C6 Return Journal Flash Size 129 1F 0A C7 Write Journal RAM Data to Flash 130 1F 0A C8 Enable Direct Journal Mode 130 1F 0A C9 Disable Direct Journal Mode 130 1F 0A CA Electronic Journal NOP 130 1F 0A CB Electronic Journal Data scope 130
Print Journal Entry Mode 131
Print Journal Entry considerations in Auto Journal Mode 131 Print Journal Entry considerations in Direct Journal Mode 131
Entry Mode Commands 132
1F 0A D1 Enter Print Journal Entry Mode 132 1F 0A D2 Exit Print Journal Entry Mode 132 1F 0A D3 Move to End of Journal (most recent entry) 132 1F 0A D4 Move to Start of Journal (least recent entry or first line) 132 1F 0A D5 Move to next Journal entry (towards more recent entry) 132 1F 0A D6 Move to previous Journal entry (towards less recent entry) 132 1F 0A D7 n Move back n lines (towards less recent) 133 1F 0A D8 n Move forward n lines (towards more recent) 133 1F 0A D9 n Print n Lines 133 1F 0A DA Print Journal Entry (knife cut to knife cut) 133 1F 0A DB Enable Journal Cut 133 1F 0A DC Disable Journal Cut 133
TH420: Additional Features 134
Comparison to A756 135 Comparison to A756 135 Two-color commands (comparison A758 to TH420) 136 Colorization commands 137 Width Specifications 137 Emulation Modes 138 Status 139
TH
320/TH420 Programmers Guide

Printer Status and Indicators

The TH320/TH420 printers perform a number of diagnostics that provide useful information about the operating status of the printers. Th e fol l ow in g diag no s ti c te s t s a re ava il ab le .
Startup diagnostics
Performed during the printer’s startup cycle.
Runtime diagnostics
Performed during normal p rinter operati on.
Remote diagnostics
Maintained during normal operation and reported in the print test.
The printer ca n be co nfigured with the fol l owing settings and functions through the configura tion
menu that is printed on the receipt. For more information on configuring the printer, see TH320 and TH420 U ser Gui de s “Printer configuration”. Communication interfaces Diagnostic modes RS-232c settings Printer emulations/software options Hardware options

Startup diagnostics

When the printer receives power or performs a hardware reset, it automatically performs the startup diagnostics (also known as l evel 0 diagn osti cs) during the sta rtup cy cle. The following diagnostics are performed:
Turn off motors and solenoids.
Perform boot CRC check of the firmware ROM, test external SRAM, test EEPROM, and test main
program CRC. Failure causes Startup Diagn ostics to stop; the pri nter be e ps and the lig h t flashes a set number of times, indicating the nature of the failure. The table in the “Indicators” section (pa ge
16) describes the specific to n e a nd li g ht seq uen ce s.
Check if paper is present. Return the knife to the home position.
Failure causes a fault condition. The table in the “Indicators” section (page 16) describes the specific tone and light sequences.
Check if receipt cover is closed
Failure does not interrupt the startup cycle.
When the startup diagnostics are complete, the printer makes a two-tone beep (low then high frequency), the paper feed button is enabled, and the printer is ready for normal operation. If the printer has not been turned on before, or a new EEPROM has been installed, the default values for the printer functions will be loaded into the EEPROM during startup diagnostics.

Runtime Diagnostics

Runtime diagno stics (some time s call ed lev el 2 di agno stics) run d uring no rmal p rinte r operati on. When the following conditions occur, the printer automatically turns off the appropriate motors and disables printing to prevent damage to the printer:
Paper out Receipt cover open Knife unable to home Print head too hot Voltages out of range
The li g ht on th e operator panel will signal when these con d itions occur as well as indicate wh a t state or mode the printer is in.
1
Pr
Im
portant

Remote Diagnostics

Remote diagnostics (sometimes called level 3 d iagnostics) keeps track of the following tallies and prints them on the receipt during the print test. See the sample test printout on the next page. These tallies can be used to determine the printer’s state of health.
Model number Serial number CRC number Number of lines printed Number of knife cuts Number of hours the printer has been on Number of flash cycles Number of cutter jams Number of times the cover is opened Maximum temperature reached
Paper type can be changed in the configuration menu. Paper types and grades available:
Type 0 - Monochrome grades Type 1 - Two-color grades Type 4 - Two-color grades Type 5 - Two-color grades
When the printer is configured for USB this location will show the driver type.
En match your host computer, if not, enter the configuration menu to make changes.
ogrammers Guide TH320/420
WN T 55 Kanzaki P-310 RB Kanzaki P-310 BB Kanzaki P-320 RB
:
sure that the configuration settings
2
TH
320/TH420 Programmers Guide

Indicators

The printer communicates various conditions both visually, with two green lights or audibly, with a series of tones or beeps. The following table lists these indicators.
Green on-line, paper statu s , error l ight (to there are of t h e paper f eed butt o n )
Indicator Sequence Condition
Li
ght Continuous, flashing quickly Paper out
Cover open Knife unable to home
Li
ght Continuous, flashing slowly Paper is low (if paper low sensor is installed)
Print head too ho t Voltages out of range
To
ne Two-tone beep (low frequency, high
frequency)
Li
ght Single beep
and Tone Single light flash
Start up diagnostics completed successfully
Boot CRC test failure
Li
ght Double beep
and Tone Double light flash
Li
ght Triple beep
and Tone Triple light flash
Li
ght Four beeps
and Tone Four light flash
Li
ght Two-Tone beep
and Tone (high frequency, low frequency) Continuous flashing of light
Gr
een slip-in light (in front of the paper feed button)
In
dicator Sequence Condition
Li
ght Off No check or form inserted or are incorrectly inserted
Li
ght On (continuous) Check or form properly inserted
SRAM test failure
EEPROM test failure
Dynamic memory initialization failure
Main program CRC test failure or DIP switch is in on position indicating
Flash down load mode
Th
e printer is also able to communicate its status to the host application if the application has been
programmed to receive this information.
3
Pr
ma
tch A756. In text mode, the equivalent character position
In
A756 emulation mode, graphics are scaled to best match

Moving from the A756 to the TH320

The following table details the list of commands whose behavior differs between the A756 printer and the A758, TH420, and TH320 printers. This is due to the physical differences of the 6 dots/mm head in the A756 and the 8 dots/mm head in the A758, TH420 and TH320.
ogrammers Guide TH320/420
Command Description Difference between theA756 and the TH320.
15 n Fe
16 n Ad
1B 2
0 n Set right-side character
1B 2
4 n 1n2 Set absolute starting
1B 2
6 s c1 c2 n1 d1...nn dn] Define user-defined
1B 2
A mn 1n2d 1...dn Select bit image mode
1B 3
3 n Set line spacing This command uses n in terms of n/360 inches. Since the
1B 4
An Print and feed paper This command uses n in terms of n/360 inches. Since the
1B 5
9 n1 n2 d1...dn Select double-density
ed n dot rows This command will move the paper on the receipt in n/203
d n extra dot rows The dot rows will be measured in n/203 inches versus
spacing
position
character set
graphics
inch steps instead of n/152 inch steps.
n/152 inches. This command sets the right side spacing to “n” horizontal
motion units. By default, these units are in terms of 1/203 inches versus 1/152 inches.
For graphics commands, the position is scaled to best is
calculated.
Since the dots on the TH320 print head are smaller, user defined characters that were used on the A756 printers will appear smaller on the TH320 printer.
th
e size of the graphic in the A756 printer.
A756 had a fundamental step of 1/152 inch and the TH320 has
a fundamental step of 1/203 inch, the actual line
spacing will not exactly match there quested spacing.
A756 had a fundamental step of 1/152 inch and the TH320 has
a fundamental step of 1/203 inch, the actual line
spacing will not exactly match there quested spacing. In A756 emulation mode, the printer scales the graphics to
provide the best match.
1B 5
C n 1 n2 Set relative print position The parameter to this command is in units of dots. How
1B 6
1 n Select justification This command does true dot resolution alignment for
1D 2
An 1n2d 1. ..dn ] Define down loaded bit
1D2
Fm Print down loaded bit
4
image
image
ever, the command moves and aligns to character positions. In A756 emulation mode, this command shows many character positions to move based on the A756 character width in dots (10) versus the TH320 (13).
centering versus character- aligned centering.
In A756 emulation mode, this command scales the incoming data to provide a best match to the size of the image as it printed on A756.
In A756 emulation mode, this command scales the incoming data to provide a best match to the size of the image as it printed on A756.
TH
320/TH420 Programmers Guide

Moving from the A756, A758 and TH420 to the TH320 (Slip Differences):

The impact station print zone on the TH420 is 4. 7 inches wide and the print zone on the TH320 is 3.0 inches. To compensate for the narrower print zone on the TH320 the firmware will provide the following functionality:
For applications that currently use narrow forms using 42 or fewer columns, an option is provided to
delete x leading spaces. No application or form changes should be required.
For applications that use narrow forms using 51 or fewer columns, an option is provided to default to
compressed mode. No application or form changes should be required.
For applications using wide forms that p rint on less than 51 columns, options 1 and 2 above are
combined with the option to delete trailing spaces. There should be no changes required to the application but a new form will be required.
For applications using wide forms that print on more than 51 co lu mn s, th e d at a w i ll wrap to the ne x t
line. Modification of the application and the form is required if d at a wrapping is no t d esired. Impact Station Print Zone 4.7inches 3inches
Characters/row–Normal Mode 66 42 Characters/row–Compressed Mode 80 51
See Chapter “Programming the Printer” form or details about the slip print zones. Some commands have new functionality for the slip and can be configured to been able or disabled on the slip. Existing applications that use these functions on the receipt but not n the slip may need to be disabled manually for the slip. The default is disabled for the slip.
5
Pr

Commands

Emulation Commands

Se
Code (Hexadecimal) 1F 03 0C n This command is ignored
Se
Code (Hexadecimal) 1F 03 25 0F n This command sets the printer ID response to the Printer ID command (1D4901) n Printer ID
00 TH320 01 TH420 02 A758 03 A756
ogrammers Guide TH320/420
t Printer ID Mode
t Printer ID
Se
t Printer Emulation
Code (Hexadecimal) 1F 03 25 02 n n Emulation
00 Native 01 A756 limited emulation (See list of comments earlier in this chapter)
6
TH
320/TH420 Programmers Guide

TH320 Configuration Commands

Se
lect Slip lines per inch
Code (Hexadecimal) 1F 03 25 04 n This command sets the slip station lines per inch setting. n Line spacing
00 7.2 LPI 01 6.0 LPI
Select Narrow Slip Configuration Option to Ignore n Leading Spaces Code (Hexadecimal) Co
de (Hexadecimal) 1F 03 25 08 n This command is available so TH420 applications can ignore n leading spaces in a 42 - column line of text. Range of n 0x00 < n < 0x20 hexadecimal
0<n<32 decimal
n=24 decimal is equivalent to printing the right most 42 columns of the TH420 print zone (24+42=66). The first non-space in columns 1-n will stop ignoring leading spaces. Text over 42 columns will wrap to the next line.
Tab (0x09 ), set col u mn (0x1B0x14n), set absolute position (0x1B0x24NLNH), and set relative position (0x1B 0x5CNLNH) commands are handled with in the range of ignored leading spaces.
Se
lect TH320 Narrow Slip Configuration Option to Ignore n Leading Spaces
Code (Hexadecimal) 1F 03 25 09 n This command is available so TH420 applications can ignore n leading spaces in a 51-column line of
compressed text. Range of n 0x00< n <0x20 hexadecimal
0<n<32 decimal
n=29 decimal is equivalent to printing the right most 51 compressed columns of the TH420 print zone (29+51= 80). The first non-space in columns 1-n will stop ignoring leading spaces. Text over 51 columns will wrap to the next line. Tab (0x09), set column (0x1B0x14n), set absolute position (0x1B0x24NLNH), and set relative position (0x1B 0x5CNLNH) commands are handled with in the range of ignored leading spaces.
Se
lect TH320 Narrow slip 51 –column Compressed Print Option
Code (Hexadecimal) 1F 03 25 0A n When enabled, all normal text is printed in 51 – column compressed print.
This accommodates existing applications printing up to 51 columns on the slip station. The format will not match the A756/A758/TH420 exactly. This will not affect rotated print mode (see below).
n 51 - column compressed print option 00 Disable (default) 01 Enable
7
Pr
Se
Code (Hexadecimal) 1F 03 25 0B n When enabled, all trailing spaces on the slip will be deleted.
This accommodates existing applications that send trailing spaces to the slip by not wrapping the blank text to the next line.
The format will match the A756/A758/TH420 exactly, but a narrower form will be required. This command will not work for an application that relies on wrapping text to print a line. A print command is required. n Delete slip trailing spaces option 00 Disable (default) 01 Enable
Se
Code (Hexadecimal) 1F 03 25 0C n 21-line rotated text print accommodates existing applications, which print 21 or fewer rotated lines (as
read). The format will match the A756/A758/TH420 exactly. 25-line rotated text print accommodates existing applications, which print between 22 and 25 rotated lines (as read). The format will not match the A756/A758/TH420 exactly. An A756/A758/TH420 can print up to 33 rotated lines (as read), so those printing 26 or higher rotated lines, cannot be emulated on theTH320 printer.
n Rotated Print Options 00 21-line (default) 01 25-line
ogrammers Guide TH320/420
lect TH320 Delete Slip Trailing Spaces Option
lect TH320 (21 and 25-line) Rotated Slip Print Options
Se
lect TH320 Slip Stop Options
Code (Hexadecimal) 1F 03 0D n The TH420/A758/A756 mechanism has a positive slip stop for positioning a form at its top right corner.
Some applications rely on a form inserted to this slip stop to print on specific areas of the form. When the top right corner of the form is at the slip stop, the first print line is 0.7" below the top of form. Some applications rely on the operator manually positioning a form in order to print on specific areas of the form.
When n = 01 the form is repositioned to 0.7 inches below the top of the form The TH320 slip stop override option does not reposition an inserted form. (n = 00) The TH320 slip stop distance option is triggered at the slip selection command (0x1B 0x63 0x30 0x04) and positions an inserted form prior to print so that the first line of print will match a TH420/A758/A756.
n Slip Stop Option 00 No slip stop emulation 01 TH420 Slip Stop emulation (default)
8
TH
320/TH420 Programmers Guide
TH
320 Configurable Slip Commands
Code Hexadecimal
1F
032601 n Enables or disables the 1B 2110 command
Command
1F032602 n Enables or disables the 1B20 n command
1F032603 n Enables or disables the 1D50 x y command
1F032604 n Enables or disables the 1D4 C n L n Hand 1D57 n L n H commands
n Se
00 Disabled 01 Enabled
1F032605 n Enables or disables the 1B61 n command n Pr
n Do 00 Disabled 01 Enabled
n Sl 00 Disabled 01 Enabled
n Se 00 Disabled 01 Enabled
00 Disabled 01 Enabled
uble high slip character print command (1B 21)
ip character right side spacing command (1B 20 n)
t minimum units for the slip station command(1D 50 x y)
t left margin (1D 4C n L n H) and print width (1D 57 n L n H) on the slip station
commands
int justification on the slip station command (1B 61 n)
9
Pr

Moving from A756/A758 to TH320

Two-color commands

The following table details the list of commands related to two-color printing and functional i ty that was not available on the A756 or the A758.
ogrammers Guide TH320/420
Hexadecimal ASCII Description
1B 7
2 m ESC r m Set current color
1D A0
n 1DGS Set temporary maximum target speed
1D 2
3n GS # n Select current logo
1D 4
2n GS B n Select or cancel white/black reverse print mode
1D 2
An1n2d1–dm GS * n1 n2 d1 – dm Define downloaded bit image
1D 2
Fm GS / m Print downloaded bit image
1D 8
1mn GS 0x81 m n Set paper type
1D 8
2 n 1–n72/n80 GS 0x82n 1–n72/n80 Print raster monochrome graphics
1D 8
3n1–n144/n160 GS 0x83n1–n144/n160 Print raster color graphics
1D 8
4 nmn1n2d1dx GS 0x84 n m n1 n2 d1 dx Download logo image
1D 8
5mn GS 0x85 m n Reverse color text mode (two-color)
1D 8
6m GS 0x86 m Monochrome shade mode
1D 8
7m GS 0x87 m Color shade mode
1D 8
9nm GS 0x89 n m Logo print with color plane swap
1D 8
B n m o GS 0x8B n m o Apply shading to logo
1D 8
C nm GS 0x8C n m Merge water mark mode
1D 8
Dnm GS 0x8D n m Text strike through mode
10
1D 8
E mn Ln Hd 1...dn GS 0x8E m nL nH d 1...dn Download paper type description
1D 8
Fm GS 0x8F m Return paper type description
1D 9
0 m x y o p q GS 0x8A m x y o p q Form and print real time surround graphic
1D 9
1n GS 0x91 n Save graphics buffer as logo
1D 9
2n GS 0x92 n Back ground logo print mode
1D 9
7mn GS 0x87 m n
User storage status
TH
320/TH420 Programmers Guide
Hexadecimal ASCII Description
1D 9
7mn GS 0x87 m n
1D 9
Anmo GS 0x9A n m o
1D 9
B mn
1D 9
9 l n m o GS 0x9B l n m o
1F 0
3 16 05 n
1F 0
3 16 fm n o p q US ETX SYN Set Logo EZ ®surround graphics
1F 0
3 16 f s p/r t US ETX SYN f s p/r t
1F 0
3 17 a m s US ETX ETB a m s
1DGS Logo print with knife cut
US Set interpretation of “Set current color” command
User storage status
Shade and store logo
Apply margin message mode
Set colorization
Set attribute mapping
11
Pr

Programming the Printer

Overview of Printing Characteristics

Commands control all operations and functions of the printer. This includes selecting the s ize and placement of characters and graphics on the receipt or the slip and feeding and cutting the paper. The programming commands have been organized, in order of hexadecimal code within functional groups. For this reason, “related” commands may not be listed adjacent to one another.
The TH32 0 (TH3 20 ) sta nda rd co mma nd se t all ows it to work with software written for WN or other POS compliant printers. Any of the commands may be used in any combination to program a host computer to communicate with the printer (unless otherwise noted).
For the printer to operate properly within an Ethernet environment, a specific set of commands must be set.
Some commands listed and described here may not be implemented and are identified as “not implemented.” If received, they are ignored and not sent to the print buffer as data. Any non-legal commands have their parameter sent to the print buffer as data.
ogrammers Guide TH320/420

Character appearance

The appearance of text can be changed using the following print modes:
Standard Underlined Compressed Bold Double-high Reverse Double-wide Italic Upside-down Strike-through Rotated Scaled Shading

Receipt character specification

Standard
Characters per inch: 15.6 Characters per line: 44 Cell size: 13 × 24 dots
Compressed
Characters per inch: 20.3 Characters per line: 56 Cell Size: 10 × 24 dots
12
TH
320/TH420 Programmers Guide

Print zones

Pri
nt zones for receipt station 80 mm paper
Specifications of print zone for receipt station 80 m paper: 576 dots (addressable) @ 8 dots/mm, • Top margin to manual tear-off: centered on 80 mm 17.8 mm
(0.70 inches) Minimum margins for standard print: • Top margin to knife cut: 2.0 mm (.079 inches) 19.0 mm
(0.75 inches)
Note:
The application centers 44 standard character cells (13 × 24 dots), or 56 compressed character cells (10 × 24 dots), or 576 addressable bits of graphics across an 80 mm wide receipt. Minimum print line height is 24 dots for text or graphics. Standard print line spacing is 27 dots (i.e. 3 extra row dots). The TH320 adds a 27 dot high font, so standard print spacing is 30 dots.
Pri
nt zones for slip station TH320
The slip station prints characters (standard and compressed pitch) and graphics in a print zone of 77mm (3.0") wide on a slip or form.
Standard pitch: 42 characters (columns) per line Compressed pitch: 51 characters (columns) per line 21 rotated characters 210 adjacent bits of graphics 420 addressable positions
The print line height of 7x7 dot characters is 2.46 mm (.097"). With three-dot spacing, the print line height is 3.53mm (.139"). See the following illustration (not to scale). To print as close to the bo tt om of the slip as possible without the slip leaving the feed rollers, use the “Print and feed n lines” (1B 64 n) command, with n = 0.
13
Pr
Slip Print Zone
ogrammers Guide TH320/420
Pri
nt Zones for Slip, Validation TH320
Validation Format The TH320 has drop validation printing. The location of the first line of validation varies based on the table below:
Number of lines of validation @ 7.2 lpi Distance from bottom of form to top of first print line 14 lines 2.7 inches 10 lines 2.0 inches 6 lines 1.5 inches 4 lines 1.2 inches
14
TH
320/TH420 Programmers Guide
Print
zones for slip station TH420
The slip station prints characters (standard and compressed pitch) and graphics in a print zone of
120.7mm (4.752") wide on a slip or form.
• Standard pitch: 66 characters (columns) per line
• Compressed pitch: 80 characters (columns) per line The print line height of 7x7 dot characters is 2.46mm (.097"). With three-dot spacing, the print line height is 3.53mm (.139"). See the following illustration (not to scale). To print as close to the bottom of the slip as possible without the slip leaving the feed rollers, use the “Print and feed n lines” (1B 64 n) command, with n = 0.
15
Pr

Rotated printing commands

Three co mman d s cont rol the rotation o f p rin ti ng. The tab l e s how s the c o mbin ati on s o f se t/ can ce l upside down print, set/cancel rotated print (clockwise), and rotated print (counterclockwise). Rotated clockwise and rotated counterclockwise print commands are mutually exclusive: the setting of the last received comman d is e ffecti ve. Uni ntended conseque nces may re sult when rotated clockwise is mixed with other commands. The samples of the print show only the normal-size characters. Double-wide and double-high characters are printed in the same orientation. They may also be mixed on the same line.
Note:
The following print modes cannot be mixed on the same line:
Standard and compressed pitch Vertical (normal) and rotated Right-side u p and upside-down Single-high (normal) and double-high
ogrammers Guide TH320/420
Upside down (1B7Bn)
Ca
nceled Canceled Cleared
Rotated CW (1B56n)
Rotated CCW (1B12)
Resulting output
Ca
nceled Set X
Se
t Canceled X
Se
t Set X
X X Se
t
16
TH
320/TH420 Programmers Guide

Command Descriptions

Command conventions

The following information describes how each command is organized:
Name: Name of command. ASCII: The ASCII control code. Hexadecimal: The hexadecimal control code. Decimal: The decimal control code. Value: A description of the command operands. Range: The upper and lower limits oft the command operand. Default: The command operand default after printer reset. Description: Brief description and summary of the command. Formulas: Any formulas used for this command. Exceptions: Describes any exceptions to this command; for example, incompatible
commands.
Related information: Describes related information for this command; for example, bit information.

Printer actions

The printer function commands control the following basic printer functions and are d e s cribed in orde r of their hexadecimal codes:
Station select Cutting the paper Platen control Opening the cash drawe rs Resetting the printer
Cle
ar printer
ASCII DLE Hexadecimal 10 Decimal 16
Clears the print line buffer without printing and sets the printer to the following condition:
Receipt station is selected Double-wide command (0x12) is canceled Line spacing, p it ch, and use r-defined character sets are maintained at current selections (RAM is not
affected)
Single-wide, single-high, non-rotated, and left-aligned char ac ter s a re set Printing position is set to column one Slip platen is opened Slip printhead is homed Knife is homed
Exceptions In printers with the parallel interface, this command also returns paper exhaust to the paper status line if an alternate status has been requested. A DLE command followed by a 04 or 05 is interpreted as a “Real-time comm and.”
17
Pr
Clo
ASCII: DC1 Hexadecimal: 11 Decimal: 17
Close the feed roller and platen (forms compensation arm assembly). If the printer is reset or the Clear (0x10) is received, the feed roller and platen are opened. This command executes if the platen is already closed. This command is processed regardless of which station is selected.
Op
ASCII: CAN Hexadecimal 18 Decimal: 24
Open the feed roller and platen (forms compensation arm assembly) so that a form may be inserted (default position). Thi s co mmand has the same code as the Can ce l pr int d ata i n p age mod e command, which is only executed in page mode. This command execute s if the platen is already ope n. This command is processed r e g ardless of whi ch station is selected.
ogrammers Guide TH320/420
se form
en form
Pe
rform partial knife cut
ASCII SUB ESC m Hexadecimal 1A 1B6D Decimal 26 27109
Partially cuts the receipt, leaving 5 mm (0.20") of paper. This command is implemented the same as Full knife cut (19 and 1 B 69).
There are two codes (Hex 1A or 1B 6 D ) for this comma n d and both codes perform the same function.
Exceptions
Line feed is e xe cuted fi rst i f p rint bu ffer i s no t empty . This command is proc essed regardle s s of which statio n is selected.
Re
turn home
ASCII ESC < Hexadecimal 1B 3C Decimal 27 60
Moves the impact print head (unless already there) to the home position.
Related Information
The printer is able to detect carria g e motor jams, eliminating the need to home the pri n t head after e ach slip transaction.
Se
lect peripheral device (for multi-drop)
ASCII ESC = n Hexadecimal 1B 3D n Decimal 27 61n
Value of n: 0 (bit0), device not selected 1(bit0),device selected Default: 1 (bit0), device selected
18
TH
320/TH420 Programmers Guide
Selects the device to which the host computer sends data.
Exception
This command is ignored.
In
itialize printer
ASCII ESC @ Hexadecimal 1B 40 Decimal 27 64
Default: Character pitch : 15.6 CPI Column width: 44 characters Extra dot rows: 3 Character set: Codepage 437 Printing position: Colu mn One Single-wide, single-high, non-rotated, and left-aligned characters are set, and user-defined characters or logo graphics are cleared. (Flash memory is not affected.) Tabs reset to default. Receipt selection state is selected.
TH320: Slip set to 42 column pitch
Se
t slip paper eject length
ASCII ESC C n Hexadecimal 1B 43 n Decimal 27 67 n Value of n: 0 to 255
Exception
This command is ignored.
Se
lect receipt or slip for printing; slip for MICR read
ASCII ESC c 0 n Hexadecimal 1B 63 30 n Decimal 27 99 48 n
Value of n: 1, 2, 3 Receipt selected 4 Slip selected 8 Validation station selected Default of n: 1
Select the station for p rinting. When slip is selected, the prin ter w aits for the pape r to be inse rted. When slip has already been selected and the selection is changed, the form is opened.
If the station has already been selected and it is re-selected, no action takes place. Slip waiting time is configurable using the configuration menu and the wait time appears on the Diagnostic menu printout
Exceptions
Receiving the command discards unprinted data in the buffer, forcing a “beginning of line” state. When n is out of range this command is ignored.
19
Pr
Se
ASCII ESC c 1 n Hexadecimal 1B 63 31 n Decimal 27 99 49 n
Value of n: 1, 2, 3 Select receipt 4 Select Slip 8 Select validation Default of n: 1
Selects which station re ceives th e effect s of the followin g comman ds:
1. Select Default Line Spaci ng (1B 32)
2. Set Line Spacing (1B 33)
3. Add n extra dot r ows (16 n)
Exceptions
This command is ignored if n is out of range.
ogrammers Guide TH320/420
lect receipt or slip for setting line spacing
Se
lect paper sensors to output paper end signals
ASCII ESC c 3 n Hexadecimal 1B 63 33 n Decimal 27 99 51 n
This command is ignored.
Se
lect sensors to stop printing
ASCII ESC c 4 n Hexadecimal 1B 63 34 n Decimal 27 99 52 n
Value of n: Sensor status Default: 0
Bit Function
0,
1 Stop receipt on receipt low 4 Sto 5 Sto 7 Sto
p slip if trailing edge uncovered p slip if leading edge uncover p validation print if trailing edge uncovered (TH320
only)
De
termines which sensor stops printing on the respective station. The command does not affect the paper out status on the receipt station, which will automatically stop the printer when the paper is depleted.
20
TH
320/TH420 Programmers Guide
En
able or disable panel button
ASCII ESC c 5 n Hexadecimal 1B 63 35 n Decimal 27 99 53 n
Value of n: 0=Enable 1=Disable Default: 0 (Enable) Enables or disables the paper feed button. If the last bit is 0, the paper feed button is enabled. If the
last bit is 1, the paper feed button is disabled.
Related information
Functions that require the paper feed button (except for the execute macro [1D 5E r t m] command) cannot be used when it has been disabled with this command.
Se
t slip paper waiting time
ASCII ESC f m n Hexadecimal 1B 66 m n Decimal 27 102mn
Value of m: Not used Value of n: Tenths of seconds
The time that the printer waits for a slip to be inserted is set using the configuration menu. The default is forever, but it can be set to 1, 3, or 5 minutes using the configuration menu. “n” sets the time (n x 0.1 seconds) that the printer waits to close the platen and start printing once the slip has been inserted. The printer reads that a slip is inserted when the leading edge and trailing edge sensors are covered. The slip-in LED on the slip table is lit (green) when both sensors are covered. If a slip is not inserted in the time specified, the receipt station is selected for the next function. The times set by this command are used only by the command, “Select receipt or Slip for printing, Slip for MICR read” (1B 63 30 n), with n set to 04.
Ge
nerate pulse to open cash drawer
ASCII ESC p n p1 p2 Hexadecimal 1B 70 n p1 p2 Decimal 27 112 np1p2
Value of n: 00, 48 (Decimal) = Drawer1; 01, 49 (Decimal) = Drawer2
Value of p1: 0- 255 Value of p2: 0- 255
Sends a pulse to open the cash drawer.
Formulas
The value for either p1 or p2 is the hexadecimal number multiplied by 2 m sec to equal the total time. On-time = p1 (Hex) x 2 m sec Off-time = p2 (Hex) x 2 m sec
Related information
Off-time is the delay before the printer performs the next operation. Refer to cash drawer specifications for required on and off-time.
21
Pr
Re
ASCII ESC q Hexadecimal 1B 71 Decimal 27 113 Description
Releases the slip paper as follows: If receipt paper was selected, this command opens the platen to allow slip removal. If the slip was selected, the printer enters the paper removal waiting state after releasing the paper. After 2 seconds, it enters receipt paper mode.
Se
ASCII ESC r m Hexadecimal 1B 72m Decimal 27 114m
Default of m: 0 (monochrome) This command will set the current color to the color m for all character data that may follow this
command and all graphic objects (bit images) that have not been explicitly loaded as two-color. m = 0 (monochrome) is the initial value
m = 1 (two-color paper “primary color”, usually black) m = 2 (second color available from two-color paper)
The m values 0 and 1 will not have a distinguishable effect; 0 is the initial value and provides parameter value consistency with other commands.
Description
When the monochrome paper type command (00) is set, this command i s re cognized and re tained but has no effect. The monochrome paper selection (usually black) controls the output. When two-color paper is loaded and the two-color paper type comm and set, this command will designate which of the two colors will be used for everything not specified as having an explicit color parameter(s) such as color logos, side bars, surround graphics, background watermarks or color raster graphics.
Exception
After a power loss or reset the default value m=0 is reset.
ogrammers Guide TH320/420
lease Paper
t current color
Se
lect slip station
ASCII FS Hexadecimal 1C Decimal 28
Selects the slip station for printing or MICR
Se
lect receipt station
ASCII R S Hexadecimal 1E Decimal 30
Select the receipt slip station for all functions. The receipt station is default setting after the printer is initialized or the clear printer (0x10) command is received.
22
Loading...
+ 127 hidden pages