Wincor Nixdorf TH320 Programmer's Manual

Wincor Nixdorf TH320 Programmer's Manual

Two-color thermal / impact hybrid printer
Hide thumbs Also See for TH320:
Table of Contents

Advertisement

TH320/TH420
Two-Color Thermal / Impact Hybrid Printer
Programmers Guide

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the TH320 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Summary of Contents for Wincor Nixdorf TH320

  • Page 1 TH320/TH420 Two-Color Thermal / Impact Hybrid Printer Programmers Guide...
  • Page 2 - 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...
  • Page 3 Copyright © Wincor Nixdorf International GmbH, 2010 The reproduction, transmission or use of this document or its contents is not permitted without express authority. Offenders will be liable for damages. All rights, including rights created by patent grant or registration of a utility model or design, are reserved.
  • Page 4: Table Of Contents

    Printer Status and Indicators Startup diagnostics Runtime Diagnostics Remote Diagnostics Indicators Moving from the A756 to the TH320 Moving from the A756, A758 and TH420 to the TH320 (Slip Differences): Commands Emulation Commands Set Printer ID Mode Set Printer ID Set Printer Emulation...
  • Page 5 m Feed and cut mode Set paper type Set interpretation of “Set current color” command Print test form Print and paper feed Print and feed paper one line Print and eject slip Print and carriage return Feed n print lines Feed n dot rows Print Print and feed paper...
  • Page 6 Select double-density graphics Select the current logo (downloaded bit image) Define downloaded bit image Print downloaded bit image Print raster monochrome graphics Print raster color graphics Print raster color graphics Download logo image Apply shading to logo Merge watermark mode Monochrome shade mode Color shade mode Logo print with color plane swap...
  • Page 7 Set absolute vertical print position in page mode Set relative vertical print position in page mode Macros Select or cancel macro definition Execute macro MICR commands (TH320 MICR models only) Read MICR data and transmit Transmit last MICR read MICR parsing Define parsing format, save in NVRAM...
  • Page 8 Electronic Journal Electronic Journal Storage Commands 1F 0A C1 Enable Auto Journal Mode 1F 0A C2 Disable Auto Journal Mode 1F 0A C3 Clear Journal 1F 0A C4 Print Journal 1F 0A C5 Return Journal Status 1F 0A C6 Return Journal Flash Size 1F 0A C7 Write Journal RAM Data to Flash 1F 0A C8...
  • Page 9: Printer Status And Indicators

     The printer can be configured with the following settings and functions through the configuration menu that is printed on the receipt. For more information on configuring the printer, see TH320 and TH420 User Guides “Printer configuration”. Communication interfaces Diagnostic modes...
  • Page 10: Remote Diagnostics

    Programmers Guide TH320/420 Remote Diagnostics Remote diagnostics (sometimes called level 3 diagnostics) 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.
  • Page 11: Indicators

    TH320/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 status, error light (to there are of the paper feed button)
  • Page 12: 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.
  • Page 13: Moving From The A756, A758 And Th420 To The Th320 (Slip Differences)

    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: ...
  • Page 14: Commands

    Programmers Guide TH320/420 Commands Emulation Commands Set Printer ID Mode Code (Hexadecimal) 1F 03 0C n This command is ignored Set Printer ID Code (Hexadecimal) 1F 03 25 0F n This command sets the printer ID response to the Printer ID command (1D4901)
  • Page 15: Th320 Configuration Commands

    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. Select 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.
  • Page 16: Select Th320 Delete Slip Trailing Spaces Option

    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.
  • Page 17: Th320 Configurable Slip Commands

    TH320/TH420 Programmers Guide TH320 Configurable Slip Commands Code Command Hexadecimal 1F032601 n Enables or disables the 1B 2110 command Double high slip character print command (1B 21) Disabled Enabled 1F032602 n Enables or disables the 1B20 n command Slip character right side spacing command (1B 20 n)
  • Page 18: Two-Color Commands

    Programmers Guide TH320/420 Moving from A756/A758 to TH320 Two-color commands The following table details the list of commands related to two-color printing and functionality that was not available on the A756 or the A758. Hexadecimal ASCII Description 1B 72 m...
  • Page 19 TH320/TH420 Programmers Guide Hexadecimal ASCII Description User storage status 1D 97 GS 0x87 n m o Shade and store logo 1D 9A GS 0x9A 1DGS Logo print with knife cut 1D 9B Apply margin message mode l n m o...
  • Page 20: Programming The Printer

    For this reason, “related” commands may not be listed adjacent to one another. The TH320 (TH320) standard command set allows it to work with software written for WN or other POS compliant printers.
  • Page 21: Print Zones

    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. Print 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.
  • Page 22: Print Zones For Slip, Validation Th320

    Print 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...
  • Page 23: Print Zones For Slip Station Th420

    TH320/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 •...
  • Page 24: Rotated Printing Commands

    Programmers Guide TH320/420 Rotated printing commands Three commands control the rotation of printing. The table shows the combinations of set/cancel 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 command is effective.
  • Page 25: Command Descriptions

    TH320/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.
  • Page 26: Close Form

    Programmers Guide TH320/420 Close form ASCII: Hexadecimal: Decimal: 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.
  • Page 27: Initialize Printer

    TH320/TH420 Programmers Guide Selects the device to which the host computer sends data. Exception This command is ignored. Initialize printer ASCII ESC @ Hexadecimal 1B 40 Decimal 27 64 Default: Character pitch: 15.6 CPI Column width: 44 characters Extra dot rows:...
  • Page 28: Select Receipt Or Slip For Setting Line Spacing

    Stop receipt on receipt low Stop slip if trailing edge uncovered Stop slip if leading edge uncover Stop validation print if trailing edge uncovered (TH320 only) Determines 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.
  • Page 29: Enable Or Disable Panel Button

    TH320/TH420 Programmers Guide Enable 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.
  • Page 30: Release Paper

    Programmers Guide TH320/420 Release Paper 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.
  • Page 31: Select Cut Mode And Cut Paper

    If m is out of the specified range, the command is ignored. m Feed and cut mode 0, 48 Full cut (no extra feed). Partial cut on the TH320. 1, 49 Partial cut (no extra feed). Feeds paper to cutting position + (n times vertical motion unit), and cuts the paper.
  • Page 32: Set Interpretation Of "Set Current Color" Command

    00 will cause 1B7200 to printed and all other values to print black. This command defines how to interpret the 1B 72 command for legacy environments. It provides a method to resolve any differences in the definition of command 1B 72 between the TH320 native mode and earlier implementations in other printers.
  • Page 33: Print And Paper Feed

    The number of lines to feed at current line height setting. Range of n: 0–127 in A756 emulation 0–255 in A756 emulation and TH320 native mode Feeds the paper n lines at the current line height without printing. Ignored on receipt if current line is...
  • Page 34: Feed N Dot Rows

    203 inch Slip - n/ 72 inch Range of n: 0–127 in A756 emulation 0–255 in A758 emulation and TH320 native mode Feeds paper dot rows without printing. If the print buffer is empty the receipt moves rows. Print...
  • Page 35: Print And Feed N Lines

    A756 emulation mode 0 – 255 TH320 native mode Reverses the paper feed in the slip station by n lines at the current spacing. The next character feed command returns the paper feed back to the normal feed direction. This command is ignored if slip is not the selected station.
  • Page 36: Vertical And Horizontal Positioning

    Programmers Guide TH320/420 Vertical and horizontal positioning The horizontal positioning commands control the horizontal print positions of characters on the receipt and slip. Horizontal tab ASCII Hexadecimal Decimal Moves the print position to the next tab position set by the set horizontal tab positions (1B 44 n1 n2 ... 00) command.
  • Page 37 TH320/TH420 Programmers Guide Receipt Station Extra rows Lines per inch Dot rows 8.47 8.13 7.81 7.52 7.25 7.00 6.77 6.55 6.35 6.16 5.98 5.81 5.64 Slip Station Extra rows Lines per inch Dot rows 10.29 9.00 8.00 7.20 6.55 6.00 5.54...
  • Page 38: Set Column

    Programmers Guide TH320/420 Set column ASCII ESC DC4 n Hexadecimal 1B 14 n Decimal 27 20n Value of n: Receipt- 1 – 44= Standard pitch 1 – 56= Compressed pitch Slip - 1 – 66= Standard pitch 1 – 80= Compressed pitch Default of n: Print the first character of the next print line in column n.
  • Page 39: Set Vertical Line Spacing

    TH320/TH420 Programmers Guide Set vertical line spacing ASCII ESC 3 n Hexadecimal 1B 33 n Decimal 27 51n Value of n: Receipt- n/ 406 inch Slip - n/ 144 inch Range of n: 0 – 255 Default: Receipt- 0.13 inch (3.37 mm or 7.52 lines per inch, 3 extra dot rows) Slip - 0.14 inch (7.20 lines per inch, 3 extra dot rows)
  • Page 40: Set Relative Print Position

    In order to improve the speed of printing, the TH320 moves the data into a buffer for the print head when it receives it. When the “Set relative print position” command contains a move to the left, this causes the new data to overstrike the previous data.
  • Page 41: Select Justification

    0 (Left aligned) Specifies the alignment of characters, graphics, logos, and bar codes. The command can be enabled or disabled for the slip. Default is disabled for the slip on TH320, and enabled on TH320 MICR France. Exception This command is valid only when input at the beginning of a line.
  • Page 42: Set Horizontal And Vertical Minimum Motion Units

    Vertical The command can be enabled or disabled for the slip. Range of x: 0 – 255 Default is disabled for the slip on TH320, and enabled on TH320 MICR France. Range of y: 0 – 255 Default of x: Receipt: 203 Slip: 140 This command is ignored if the line buffer is not empty.
  • Page 43: Set Printing Area Width

    The width of the printing area follows the set left margin command (1D 4C). See the set left margin command (10 4C …) earlier in this document for a description. The command can be enabled or disabled for the slip. Default is disabled for the slip on TH320, and enabled on TH320 MICR France.
  • Page 44: Turn Smoothing Mode On/Off

    Programmers Guide TH320/420 Turn smoothing mode on/off ASCII GS b Hexadecimal 1D 62 n Decimal 29 98 n Range 0<=n<=255 Default n = 0 Description Turns smoothing mode on or off.  When the LSB of n is 0, smoothing mode is turned off.
  • Page 45: Select 90 Degree Counter-Clockwise Rotated Print

    TH320/TH420 Programmers Guide Select 90 degree counter-clockwise rotated print ASCII ESC DC2 Hexadecimal 1B 12 Decimal 27 18 Rotate characters 90 degrees counter-clockwise. The command remains in effect until the printer is reset or until a clear printer (0x10), select or cancel upside down print (1B 7B) or cancel rotated print (1B 56) command is received.
  • Page 46: Set Right-Side Character Spacing

    Slip Default is standard pitch on TH320 and compressed pitch on model TH320 MICR France. The double-high command can be enabled or disabled for the slip. Default is disabled for the slip on TH320, and enabled on the model TH320 MICR France.
  • Page 47: Select Or Cancel User-Defined Character Set

    TH320/TH420 Programmers Guide Related information The bits in this command perform the same function as the stand-alone functions: 1B 16 n Select pitch 1B 45 n Emphasized 1B 47 n Double-strike Double-wide Single-wide 1B 2D n Underline Select or cancel user-defined character set...
  • Page 48: Select Or Cancel Underline Mode

    Programmers Guide TH320/420 Slip: c = the ASCII codes of the first (c1) and last (c2) characters respectively c1 = Hex 20–FF c2 = Hex 20–FF To define only one character, use the same code for both c1 and c2 d = the column data for the nth character as specified by d1 ...
  • Page 49: Copy Character Set From Rom To Ram

    TH320/TH420 Programmers Guide Copy character set from ROM to RAM ASCII ESC : 0 0 0 Hexadecimal 1B 3A 30 30 30 Decimal 27 58 48 48 48 Default Codepage 437 Copies characters in the active ROM set to RAM. Use this command to re-initialize the user-defined character set.
  • Page 50: Select Double-Strike

    The settings do not apply in page mode, However they can be set or cleared in page mode. Double-strike printing cannot be used with bit-images or downloaded bit-images. This command functions the same as A756 when the printer is in A756 emulation mode. In TH320 native mode, the command takes a parameter to enable and disable it.
  • Page 51: Select International Character Set

    1B 52 n 1B 74 n Decimal 27 82 n 27 116n Value of n: TH320 native mode A756 emulation 0 = codepage 437 (USA, Standard Europe) 0 = codepage 437 1 = codepage 850 (Multilingual) Not0 = codepage 850...
  • Page 52: Selector Cancel Upside-Down Print Mode

    Programmers Guide TH320/420 Selector cancel upside-down print mode ASCII ESC { n Hexadecimal 1B 7B n Decimal 27 123n Value of n 0 = Cancel 1 = Set Default 0 (Cancel) Print upside-down characters. The character order is inverted in the buffer so text is readable. The command remains in effect until the rotated print (1B 12) command is received.
  • Page 53: Selector Cancel White/Black Reverse Print Mode

    TH320/TH420 Programmers Guide The select print mode (1B 21 n) command can also select or cancel double-width and double-height modes. However, the setting of the last received command is effective. Exceptions If n is out of the defined range, this command is ignored. This command is only valid for the receipt station.
  • Page 54: Text Strike - Through Mode

    Programmers Guide TH320/420 Text strike - through mode ASCII GS 0 x 85 m n Hexadecimal 1D8 D nm Decimal 29 141nm Value of m 0 = retain same color as the character itself 1 = black 2 = paper color...
  • Page 55: Select Bit Image Mode

    TH320/TH420 Programmers Guide To downloaded BMP file to save it as a logo, send the hexadecimal code 1B followed by the whole BMP file. The printer decodes the BMP file header and will save the image data after checking important...
  • Page 56: Select Double-Density Graphics

    Programmers Guide TH320/420 Slip Station Value of m Mode No. of dots (vertical) No. of dots (horizontal) 8-Dot single-density 8 (72 DPI) 210 (70 DPI) 8-Dot double-density 8 (72 DPI) 420 (140 DPI) 32, 33 Not available on slip In single density, one byte (8-dots) is printed in each full dot column. In double-density, one byte is printed in each half/full dot column, but adjacent horizontal dots (overlapping dots) are not printed.
  • Page 57: Select The Current Logo (Downloaded Bit Image)

    TH320/TH420 Programmers Guide Select the current logo (downloaded bit image) ASCII GS # n Hexadecimal 1D23n Decimal 2935n Range of n: 0 – 255 Default Selects a color or monochrome logo to be defined or printed. The active logo n remains in use until this command is sent again with a different logo n.
  • Page 58: Print Downloaded Bit Image

    Programmers Guide TH320/420 Value of n1 Value of n2 Value of d 1–56 (8xn1= number of 1–64 (number of vertical bytes) Bytes of data horizontal dot columns) (printed down, then across) *The number of bytes sent is represented by the following formula: n = 8 x n1x n2 (n1 x n2 must be less than or equal to 4608).
  • Page 59: Print Raster Monochrome Graphics

    TH320/TH420 Programmers Guide Print raster monochrome graphics ASCII GS 0x82 n 1…..n72 (576 dots) for 80 mm paper, or n80 (640 dots) for 82.5 mm paper Hexadecimal 1D 82 n 1…..n72 (576 dots) for 80 mm paper, or n80 (640 dots) for 82.5 mm paper Decimal 29 130 n 1…..n72 (576 dots) for 80 mm paper, or n80 (640 dots) for 82.5 mm paper...
  • Page 60: Download Logo Image

    Programmers Guide TH320/420 Download logo image ASCII GS 0x84 m n 1 n2 d 1…..dx , x = (n1 * n2*8 ) * m Hexadecimal 1D 84 m n 1 n2 d 1…..dx , x = (n1 * n2*8 ) * m Decimal 29 132 m n 1 n2 d 1…..dx , x = (n1 * n2*8 ) * m...
  • Page 61: Merge Watermark Mode

    TH320/TH420 Programmers Guide Merge watermark mode ASCII GS 0x8 C n m Hexadecimal 1D 8C n m Decimal 29 140n m Default 0 (off) This command will insert the logo m as a repeated background image, similar to printing a visible watermark, into the print stream.
  • Page 62: Logo Print With Color Plane Swap

    Programmers Guide TH320/420 would normally be printed to the other color. The parameter m specifies the shading effect and has an initial value of 0 which signifies no effect. m specifies the percentage of shading, 0 <= m <= 100.
  • Page 63: Save Graphics Buffer As Logo

    TH320/TH420 Programmers Guide Example: Create different size stars and an ellipse around a block of text. The graphics buffer is at a frozen state at printer initialization or reset, with blank data in it. Each the time this command is given, the current color and shade mode values (if any) are used for the surround graphic, and may be changed before any subsequent surround graphics and/or printing output.
  • Page 64: Logo Print With Knife Cut

    Programmers Guide TH320/420 Logo print with knife cut ASCII GS 0x9B m n Hexadecimal 1D 9B m n Decimal 29 155 m n Value of m: Standard size Double wide Double high Double high/wide Value of n: 01 - FF (Hex)
  • Page 65: Set Temporary Max Target Speed

    TH320/TH420 Programmers Guide should take place from the left side or the right side. A left side merge followed by a right side merge (or vice-versa) must be issued, with the latter side merge command setting the toggle switch = 1 or 2 will create the desired left –...
  • Page 66 Programmers Guide TH320/420 f = 0 turn off all colorization functions (default). No other parameters are required. f = 1 link print logo after knife cut – equivalent to printing a transaction header graphic. Example: Print logo (#F0) after a knife-cut with “s” dot row spacing before the logo and “a” dot row spacing after the logo (1F 03 16 01 s p).
  • Page 67 TH320/TH420 Programmers Guide  skip “s” dot rows (=15 s command). When both watermark and margin message merging are defined, the respective “s” values are treated independently. The same value should be used to start watermark and margin message at the same place.
  • Page 68: Set Attribute Mapping

    If m = 0 then no substitution takes place. The command is available only in TH320 native mode. Once attributes have been defined and enabled they can be used in any emulation mode. TH320 native mode must be used to turn the feature off.
  • Page 69: Convert 6-Dots/ Mm Bitmap To 8-Dots/ Mm Bitmap

    TH320/TH420 Programmers Guide In the tables you will see that there are 7 input attributes and 9 outputs. It is expected that the alternate color attribute will be used most. For example, when the alternate color attribute is combined with the reverse substitution attribute, the result is white characters on a color background. The color reverse attribute without alternate color will print black text on a color background.
  • Page 70: Enable Constant Speed Logos

    Programmers Guide TH320/420 Enable constant speed logos ASCII US { n Hexadecimal 1F 7B n Decimal 31 123 n Value: 0 = disabled 1 = enabled This command allows the firmware to determine the optimal speed to print a logo. It is set prior to downloading the logo and reset after the logo has been downloaded.
  • Page 71: Status Command

    Unlike the A756, that had a dedicated connector and resultant dedicated status reporting for each cash drawer, the TH320 has a single connector that shares data reporting from either cash drawer. When either cash drawer is open, an open status for both drawers is reported by the printer.
  • Page 72: Transmit Paper Sensor Status

    Transmits the printer ID specified by n as follows: Printer ID Specification ID (Hexadecimal) 1, 49 Printer model ID WN TH320 0 x 2B (TH320) 0 x 2A (TH420) 0 x 28 (A758) 0 x 26 (A756) 0 x 2C (TH320) 2, 50 Type ID...
  • Page 73: Transmit Printer Id, Remote Diagnostic Extension

    TH320/TH420 Programmers Guide Type ID (n = 2) Off/On Decimal Function No two-byte character code installed. Two-byte character code installed. No knife installed. Knife installed. Undefined. No MICR installed. MICR installed. Not used. Fixed to Off. Undefined Undefined Not used. Fixed to Off.
  • Page 74 Programmers Guide TH320/420 The table that follows describes the variables. The first item group in the table includes an example of data to send and to receive, Data sent from the host to write to NVRAM must contain all digits required by the remote diagnostic item. All data must be ASCII.
  • Page 75 TH320/TH420 Programmers Guide...
  • Page 76: Transmit Status

    Programmers Guide TH320/420 Transmit Status ASCII GS r n Hexadecimal 1D 72 n Decimal 29 114 n Value of n 1, 49 = printer status 2, 50 = cash drawer status 3, 51 = slip paper status 4, 52 = Flash memory user sector status Range of n 1–4...
  • Page 77 Unlike the A756, that had a dedicated connector and resultant dedicated status reporting for each cash drawer, TH320/420 have a single connector that shares data reporting from either cash drawer. When either cash drawer is open, an open status is reported by the printer.
  • Page 78: Slip Paper Status (N = 3 Or N = 51)

    Programmers Guide TH320/420 Slip paper status (n = 3 or n = 51) Value of byte Slip Status returned There is no more printing space on the current slip, or the slip paper is not selected. 1 to 8 Remaining print area on the current slip, in number of lines, at the currently set line spacing, when the trailing edge sensor has become uncovered.
  • Page 79: Real-Time Commands

    TH320/TH420 Programmers Guide Real-time commands The real time commands provide an application interface to the printer even when the printer is not handling other commands:  Real-time status transmission: GS (Hex 1D) sequence and DLE (Hex 10) sequence  Real-time request to printer: GS (Hex 1D) sequence and DLE (Hex 10) sequence ...
  • Page 80: Send Printer Software Version

    Programmers Guide TH320/420 Moving data through the buffer Applications should not let the buffer fill up with real time commands when the printer is busy at the RS-232c interface. A busy condition at the RS-232c interface can be determined by bit 3 of the response to 1D 05, or 1D 04 1, or 10 04 1.
  • Page 81: Busy Line And Fault Conditions

    Unlike the A756, that had a dedicated connector and resultant dedicated status reporting for each cash drawer, TH320/420 have a single connector that shares data reporting from either cash drawer. When either cash drawer is open, an open status is reported by the printer.
  • Page 82 Programmers Guide TH320/420 2 = Transmit RS-232c Busy Status Status Decimal Function Fixed to Off. Fixed to On. Receipt and cassette cover closed. Receipt and cassette cover open. Paper feed button is not pressed. Paper feed button is pressed. Fixed to On.
  • Page 83: Real-Time Request To Printer

    TH320/TH420 Programmers Guide Receipt paper adequate Receipt paper low Fixed to On. Receipt paper present Receipt paper exhausted Receipt paper present Receipt paper exhausted Fixed to Off. 5 = Transmit Slip Paper Status and 6=Transmit Validation Paper Status Status Decimal Function Fixed to Off.
  • Page 84: Real-Time Printer Status Transmission

    Unlike the A756, that had a dedicated connector and resultant dedicated status reporting for each cash drawer, the TH320 has a single connector that shares data reporting from either cash drawer. When either cash drawer is open, an open status is reported by the printer.
  • Page 85: Unsolicited Status Mode

    TH320/TH420 Programmers Guide Unsolicited status mode Select or cancel unsolicited status mode (USM) ASCII: GS a n Hexadecimal: 1D 61 n Decimal: 29 97 n Value of n: 0 turns mode off; any non-zero value turns mode on Default: 0 (USM disabled) Enables or disables automatic return of 4 status bytes whenever one or more of the listed changes occurs.
  • Page 86 Programmers Guide TH320/420 First Byte (Printer Information) Off/On Decimal Status for USM Not used. Fixed to off. Not used. Fixed to off. One or both cash drawers open. Both cash drawers closed. Not busy at the RS-232cinterface. Printer is busy at the RS-232cinterface.
  • Page 87: Recognizing Data From The Printer

    TH320/TH420 Programmers Guide Off/On Decimal Status for USM Not used. Fixed to Off. Slip leading edge sensor: paper present Slip leading edge sensor: no paper Slip trailing edge sensor: paper present Slip trailing edge sensor: no paper Not used. Fixed to off.
  • Page 88: Barcodes

    Programmers Guide TH320/420 Real-time response Response recognized by GS ENQ 1D 05 Binary Binary XOFF Binary Unsolicited status mode (USM) Response recognized by USM Byte 1 Binary USM Byte 2-4 Binary Barcodes These commands format and print bar codes and are described in order of their hexadecimal codes.
  • Page 89: Print Barcode

    TH320/TH420 Programmers Guide Print barcode First Variation Second Variation ASCII GS k m d1…dk NUL GS k m n d1…dn Hexadecimal 1D 6B m d1…dk00 1D 6B mnd1…dn Decimal 29 107 m d1 dk 0 29 107 m n d1…dn (0=End of command) Selects the bar code type and prints a bar code for the ASCII characters entered.
  • Page 90 Programmers Guide TH320/420 Second variation: length n specified at beginning of string. Except as noted 0 < n < 256 Barcode d 1...dn UPC-A 48–57 (ASCII numerals) Fixed length: 11, 12 UPC-E 48–57 Fixed length: 11, 12 JAN13 (EAN) 48–57...
  • Page 91: Set Gs1Databar (Rss) Parameters

    TH320/TH420 Programmers Guide Set GS1DataBar (RSS) parameters As of firmware 2.00. Setting of parameters for RSS barcode ASCII GS q a b c d e fL fH Hexadecimal 1D 71 a b c d e fL fH Decimal 29 113 a b c d e fL fH...
  • Page 92: Print Gs1Databar (Rss Barcode), Null Terminated

    Programmers Guide TH320/420 Print GS1DataBar (RSS barcode), null terminated As of firmware 2.00 ASCII GS k n d1... 00 Hexadecimal 1D 6B n d1... 00 Decimal 29 107 n d1... 00 Type GS1 Truncated GS1 Stacked GS1 Stacked Omni-directional GS1 Limited...
  • Page 93: Select Bar Code Width

    TH320/TH420 Programmers Guide There are three mutually exclusive sets of symbol patterns, or clusters, each having 929 distinct patterns. Because different clusters are used for adjacent rows, it is possible for the decoder to tell if the scanning path is crossing row boundaries without the use of separator bars.
  • Page 94: Page Mode

    TH320/420 Page mode Page mode is one of two modes that the TH320 printer uses to operate. Standard mode is typical of how most printers operate by printing data as it is received and feeding paper as the various paper feed commands are received.
  • Page 95: Select Page Mode

    TH320/TH420 Programmers Guide Select page mode ASCII ESC L Hexadecimal 1B 4C Decimal 27 76 Switches from standard mode to page mode. After printing has been completed either by the print and return to standard mode (FF) command or select standard mode (1B 53) the printer returns to standard mode.
  • Page 96: Select Standard Mode

    Programmers Guide TH320/420 Select standard mode ASCII ESC S Hexadecimal 1B 53 Decimal 27 83 Switch from page mode to standard mode. In switching from page mode to standard mode, data buffered in page mode are cleared, the printing area set by set print area in page mode (1B 57) is initialized and the print position is set to the beginning of the line.
  • Page 97: Set Print Area In Page Mode

    TH320/TH420 Programmers Guide Set print area in page mode ASCII ESC W n 1, n2 ...n8 Hexadecimal 1B 57 n 1, n2 ...n8 Decimal 27 87 n 1, n2 ...n8 Range of n: 0- 255 Default: Receipt Slip n 1–4=...
  • Page 98: Set Absolute Vertical Print Position In Page Mode

    Programmers Guide TH320/420 Receipt:  The maximum printable area in the x direction is 576/203 inches. Slip:  The maximum printable area in the x direction is 3 inches. Receipt and Slip:  The maximum printable area in the y direction depends on the available memory.
  • Page 99: Macros

    TH320/TH420 Programmers Guide Set the relative vertical print starting position from the current position. This command can also change the horizontal and vertical motion unit. The unit of horizontal and vertical motion is specified by this command. This command functions as follows, depending on the print starting position set by select print direction in page mode (1B 54): ...
  • Page 100: Execute Macro

    Programmers Guide TH320/420 Formulas The contents of the macro can be defined up to 2048 bytes. Exceptions If the macro definition exceeds 2048 bytes, excess data is not stored. Execute macro ASCII GS ^ r t m Hexadecimal 1D 5E r t m...
  • Page 101: Micr Commands (Th320 Micr Models Only)

    TH320 1B 01= read & transmit MICR, position for endorsement 1B 02 (TH320 only) TH320 1B 01= read & transmit MICR, position for endorsement TH320 1B 02 = wait for check, read & transmit MICR, position for endorsement Decimal 27 119 1 Default: All data returned Reads and transmits the MICR data and adds a carriage return (0x0D).
  • Page 102: Define Parsing Format, Do Not Save Permanently

    Programmers Guide TH320/420 d1 through dn are the parse string. The string must be CR terminated. If the string has invalid characters in it or is too long, the printer will store a null string, and unparsed MICR data will be returned.
  • Page 103: Sample Parsing Formats

    TH320/TH420 Programmers Guide Other parameters Error one digit returned Read OK Read error: bad character, empty, field invalid length, check digit in valid Status two digits returned No MICR data Mexican check Canadian check Error in transit number Error in account number...
  • Page 104 Programmers Guide TH320/420 ESC w pT 18 X A 04C <CR>  All characters in the transit number  All characters in the account number (up to 18) with spaces and dashes removed  Always four characters in the check number (zero-filled if check number is only three characters long) ...
  • Page 105: Check Serial Number

    TH320/TH420 Programmers Guide MICR characters ASCII Hexadecimal Numerics 0….9 0x30…. 0x39 Unrecognized character 0x3F Space 0x20 Amount symbol & 0x26 Dash symbol ‘ 0x27 “on us” symbol 0x28 Transit symbol 0x29 Once a parsing format is specified, the following values are returned:...
  • Page 106: Loading The Exception Table

    Programmers Guide TH320/420 If all of these searches fail to produce the distinct check serial number, and the check serial number field has been specified in the parsing parameter string options, no check serial number will be returned. If it is imbedded within the account number field, it will be returned as part of that variable length field.
  • Page 107 TH320/TH420 Programmers Guide Bits within byte Check serial # Character string Account# Character string Character string To ignore Example 1 t123456780t12349876543210o 1234 is the check serial # 9876543210 is the account # To load the second table entry, which starts at word 25, the transit number 123456780 would be stored in...
  • Page 108: Maintaining The Exception Table

    Programmers Guide TH320/420 0x1B0x730x840x4732 0x1B0x730x820x2433 0x1B0x730x000x0034. Maintaining the exception table Present contents of the exception table can be examined using the read NVRAM command: 0x1B 0x6A k This command reads and returns word k in NVRAM. When the exception table is full, a new entry can replace an older, less frequently used entry, by merely rewriting the words for that table entry.
  • Page 109: Write To Non-Volatile Memory (Nvram)

    TH320/TH420 Programmers Guide Read a two-byte word from location k in the history EEROM. The printer returns the word at the next available opportunity. Write to non-volatile memory (NVRAM) ASCII ESC s n1 n2 k Hexadecimal 1B 73 n1 n2 k...
  • Page 110: Erase User Flash Sector

    + n2 <= 5 (dec) (1 M) n1 + n2 <= 21 (dec) 15 (hex) (2M) The TH320 has been configured at the factory with 2M of flash memory. Note Flash memory is made up of user and program code. Therefore, the available flash memory space will vary with the amount of program code utilized.
  • Page 111: User Storage Status

    TH320/TH420 Programmers Guide User storage status ASCII GS 0x97 m n Hexadecimal 1D 97 m n Decimal 29 151 m n Value of m m specifies the type of stored object to be reported: m = 0 return the kilo bytes (1024) of free user RAM,...
  • Page 112: Flash Download

    Programmers Guide TH320/420 Flash download These commands are used to load firmware into the printer. The commands are listed in numerical order according to their hexadecimal codes. Each command is described and the hexadecimal, decimal, and ASCII codes are listed.
  • Page 113: Return Segment Number Status Of Flash Memory

    TH320/TH420 Programmers Guide Return segment number status of flash memory ASCII GS SOH Hexadecimal 1D 01 Decimal 29 1 Returns the size of the flash used. There may be 16 (1 Meg) or 32 (2 Meg) sectors in flash memory. This command assures that the firmware to be downloaded is the appropriate size for flash memory.
  • Page 114: Erase All Flash Contents Except Boot Sector

    Programmers Guide TH320/420 Erase all flash contents except boot sector ASCII GS SO Hexadecimal 1D 0E Decimal 29 14 Causes the entire flash memory to be erased. The printer returns ACK if the command is successful; NAK if it is unsuccessful.
  • Page 115: Download To Active Flash Sector

    TH320/TH420 Programmers Guide Download to active flash sector ASCII GS DC1 aL aH cL cH d 1… dn Hexadecimal 1D11 aLaHcLcHd1…dn Decimal 29 17 aL aH cL cH d1… dn Value of aL low byte of the address Value of aH: high byte of the address...
  • Page 116: Reset Firmware

    Programmers Guide TH320/420 Reset firmware ASCII GS (SPACE) Hexadecimal 1D FF Decimal 29 255 Ends the load process and reboots the printer. Before executing this command, the printer should have firmware loaded and external switches set to the runtime settings. Application software for downloading should prompt the user to set the external switches and confirm before sending this command.
  • Page 117: Appendix

    TH320/TH420 Programmers Guide Appendix Commands listed by hexadecimal code Code (hexadecimal) Command Horizontal tab Print and feed paper one line Print and eject slip Print and return to standard mode/ print and eject slip Print and carriage return Clear printer...
  • Page 118 Programmers Guide TH320/420 1B 43 n Set slip paper eject length 1B 44 [n] k 00 Set horizontal tab positions 1B 45 n Select or cancel emphasized mode 1B 47 n Select double-strike 1B 48 Cancel double-strike 1B 49 n...
  • Page 119 TH320/TH420 Programmers Guide 1D 06 Get firmware CRC 1D 07 Return microprocessor CRC 1D 0E Erase all flash contents except boot sector 1D 0F Return main program flash CRC 1D 10 n Erase selected flash sector 1D 11 aLaHcLcHd 1…dn...
  • Page 120 Programmers Guide TH320/420 1D 8F m Return paper type description 1D 90 m x y o p q Form and merge real-time surround graphic 1D 91 n Save graphics buffer as logo 1D 92 n Background logo print mode 1D 97 mn...
  • Page 121: Character Sets

    TH320/TH420 Programmers Guide Character Sets Character code 437: USA, Standard Europe...
  • Page 122: Codepage 737 (Greek)

    Programmers Guide TH320/420 Codepage 737 (Greek)
  • Page 123: Codepage 850 (Multilingual)

    TH320/TH420 Programmers Guide Codepage 850 (Multilingual)
  • Page 124: Codepage 852 (Slavic)

    Programmers Guide TH320/420 Codepage 852 (Slavic)
  • Page 125: Codepage 857 (Turkish)

    TH320/TH420 Programmers Guide Codepage 857 (Turkish)
  • Page 126: Codepage 858 (With Euro Symbol)

    Programmers Guide TH320/420 Codepage 858 (with Euro symbol)
  • Page 127: Codepage 860 (Portuguese)

    TH320/TH420 Programmers Guide Codepage 860 (Portuguese)
  • Page 128: Codepage 862 (Hebrew)

    Programmers Guide TH320/420 Codepage 862 (Hebrew)
  • Page 129: Codepage 863 (French Canadian)

    TH320/TH420 Programmers Guide Codepage 863 (French Canadian)
  • Page 130: Codepage 865 (Nordic)

    Programmers Guide TH320/420 Codepage 865 (Nordic)
  • Page 131: Codepage 866 (Cyrillic)

    TH320/TH420 Programmers Guide Codepage 866 (Cyrillic)
  • Page 132: Codepage 1252 (Windows Latin 1)

    Programmers Guide TH320/420 Codepage 1252 (Windows Latin 1)
  • Page 133: Codepage 1251 (Cyrillic)

    TH320/TH420 Programmers Guide Codepages 1251 and 1255 are new for firmware 2.03 (TH320) and firmware 2.09 (TH420) or newer. Codepage 1251 (Cyrillic)
  • Page 134: Codepage 1255 (Hebrew)

    Programmers Guide TH320/420 Codepage 1255 (Hebrew)
  • Page 135: Electronic Journal

    TH320/TH420 Programmers Guide Electronic Journal The Electronic Journal feature is for use with an application connecting the printer to a legacy cash register via a smart cable or some other interpretive device. In particular it is for use when replacing a legacy printer which offered a journal print station.
  • Page 136 Programmers Guide TH320/420 Triggers that cause the journal flash buffer to be cleared are:  Clear Journal command (described below)  Flash Memory User Sectors Allocation command (0x1D 0x22 0x 55 n1 n2) reallocates flash memory. New Flash firmware is downloaded to the printer Exception Conditions in Auto Journal Mode When there isn’t enough memory available in the journal flash buffer, the printer beeps at each receipt...
  • Page 137: Electronic Journal Storage Commands

    TH320/TH420 Programmers Guide Electronic Journal Storage Commands 1F 0A C1 Enable Auto Journal Mode Commands and data printed on the receipt are also saved in the journal flash buffer. 1F 0A C2 Disable Auto Journal Mode Exits Auto Journal Mode. Data stored in the journal RAM buffer is written to the journal flash buffer.
  • Page 138: 0A C7

    Programmers Guide TH320/420 Journal flash buffer total size corresponds directly to this line on the diagnostics form: Flash Journal Size :nnnnkbytes Journal flash buffer used corresponds inversely to this line on the diagnostics form: Journal Unused :mmmm kbytes 1F 0A C7...
  • Page 139: Print Journal Entry Mode

    TH320/TH420 Programmers Guide Print Journal Entry Mode This feature allows an application to print selected information from the electronic journal flash buffer. There are two modes of saving information in the electronic journal flash buffer: Auto Journal Mode and Direct Journal Mode. It is expected that an application will use one or the other exclusively, depending on the information to be saved.
  • Page 140: Entry Mode Commands

    Programmers Guide TH320/420 Entry Mode Commands 1F 0A D1 Enter Print Journal Entry Mode In Print Journal Entry Mode, no commands other than the Journal Entry commands described below are permitted. Any other command forces exit from Print Journal Entry Mode.
  • Page 141: 0A D7 N

    TH320/TH420 Programmers Guide This command moves the journal flash buffer pointers to the beginning of the previous journal entry. If the pointers are already at the oldest journal entry, this command does nothing. Suitable for journal entries stored in Auto Journal Mode.
  • Page 142: Th420: Additional Features

    Programmers Guide TH320/420 TH420: Additional Features...
  • Page 143: Comparison To A756

    TH320/TH420 Programmers Guide Comparison to A756 The following table details the list of commands whose behavior differs among the A756, A758, and TH420 because of the physical differences of a 6 dots/mm head (A756) versus an 8 dots/mm head (A758 and TH420).
  • Page 144: Two-Color Commands (Comparison A758 To Th420)

    Programmers Guide TH320/420 Command Description Difference between previous products and new product emulation mode. 1B 61 n Select justification This command does true dot resolution alignment for centering versus character- aligned centering. 1D 2A n1 n2 d1...dn] Define downloaded bit image...
  • Page 145: Colorization Commands

    TH320/TH420 Programmers Guide Hexadecimal ASCII Description 1D 8C n m GS 0x8C n m Merge watermark mode 1D 8D n m GS 0x8D n m Text strike through mode 1D 8E m nL nH d1...dn GS 0x8E m nL nH d1...dn...
  • Page 146: Emulation Modes

    Programmers Guide TH320/420 Emulation Modes The TH420 printer may be operated in a number of different emulation modes. However, printing characteristics and defaults may differ, depending on the desired mode. For instance, two-color paper and commands and features are available only in TH420 native mode.
  • Page 147: Status

    TH320/TH420 Programmers Guide Status Batch mode Code (hexadecimal) Command 1B 75 0 Transmit peripheral device status (RS-232c printers only) 1B 75 n Request alternate status (A756 emulation only) 1B 76 Transmit paper sensor status 1D 49 n Transmit printer ID...
  • Page 148 Programmers Guide TH320/420 Select peripheral device (for multi-drop) ASCII ESC = n Hexadecimal 1B 3D n Decimal 27 61 n Value of n: 0 (bit 0), device not selected 1 (bit 0), device selected Default: 1 (bit 0), device selected Selects the device to which the host computer sends data.
  • Page 149 TH320/TH420 Programmers Guide Set colorization ASCII US ETX SYN f s p/t t Hexadecimal 1F 03 16 f s p/t t Decimal 31 03 22 f s p/t t Value of f: 0 = turn off all colorization features 1 = link print logo after knife cut...
  • Page 150 Programmers Guide TH320/420 f = 2 link watermark printing Example: Activate watermark printing using logo #F1 (1F 03 16 02 s r) with “s” being the skip distance in dot rows before activation and “r” is the distance in mm between atermark repetitions.
  • Page 151 TH320/TH420 Programmers Guide f = 4 link logo print before cut Prints a logo after the skip distance of “s” before a logo and “p” past a logo and performs a knife cut (1F 03 16 04 s p). Immediately before executing a knife-cut command, if s > 0, execute the following: •...
  • Page 152 Programmers Guide TH320/420 A word (2 bytes) is used to identify the attribute mapping, with “m” bits 0 – 6 identifying which original attributes should be mapped: Original attribute mapped table m bit on attribute mapped Bold Italic Reverse Underline...
  • Page 153 TH320/TH420 Programmers Guide input character’s original attributes are mapped to the substituted attributes, but any attributes not specified for mapping are unchanged. In the tables you will see that there are 7 input attributes and 9 outputs. It is expected that the alternate color attribute will be used most.
  • Page 154 Programmers Guide TH320/420 Batch mode For RS-232c printers, these commands enable the printer to communicate with the host computer following the selected handshaking protocol, either DTR/DSR or XON/XOFF. They are stored in the printer’s data buffer as they are received, and are handled by the firmware in the order in which they are received.
  • Page 155 TH320/TH420 Programmers Guide Alternate implementation The alternate implementation uses the DLE (0x10) sequences as implemented on other printers. An application using these DLE (0x10) sequences and the original A756 clear printer command (0x10) must distinguish for the printer between the new real time commands and the clear printer command by adding a NUL (0x00) to the clear printer command.
  • Page 157 TH320/TH420 Programmers Guide Wincor Nixdorf International GmbH D- 33094 Paderborn...

This manual is also suitable for:

Th420

Table of Contents

Save PDF