The text of a manual · part 6 of 16
A760 Two-Color Thermal/Impact Hybrid Printer User Guide: Programming Supplement, pages 49 to 58
Pages 49 to 58 of 154
The original document is the PDF (2.3 MB). This is its text as extracted, unedited; tables and drawings read best in the PDF, and each page heading opens it at that page.
For the TPG A760
Page 49
Revision F January 2010
A760 User Guide: Programming Supplement
49
Chapter 4: Programming commands
Set relative print position ASCII Hexadecimal Decimal
ESC \ n1 n2 1B 5C n1 n2 27 92 n1 n2
Value of n:
Related information
To move the relative starting position right of the current position by n dots:
The values for n1 and n2 are two bytes in low byte, high byte word orientation.
If the set horizontal and vertical minimum motion units command (1D 50) is used to change the horizontal and vertical minimum motion unit, the parameters of this command (set relative print position) will be interpreted accordingly. For more information, see the description of the set horizontal and vertical minimum motion units command (1D 50) in this document.
To move the relative starting position left of the current position by n dots:
Compatibility information (A760 receipt vs. A756 receipt)
n1 = Remainder after dividing (65,536–n) by 256 n2 = Integer after dividing (65,536–n) by 256
There is a difference in the normal behavior of this command in A758 emulation and A760 native modes, as compared to the original A756. The difference exists when the command is used to move to the left. The A756 processes the whole print string prior to putting it in the buffer for the printhead. This method of processing allows the A756 to backup in the print string and replace characters and their associated attributes when a “Set relative print position” command instructs the printer to move the print position to the left.
n1 = Remainder after dividing n by 256 n2 = Integer after dividing n by 256
The values for n1 and n2 are two bytes in low byte, high byte word orientation. Moves the print starting position the specified number of dots either right (up to the right margin) or left (up to the left margin) of the current position. The print starting position is reset to the first column after each line. Formulas
To move to the left: Determine the value of n by multiplying the number of columns to move left of the current position by 10 (slip or receipt standard pitch) or 8 (receipt compressed pitch). The example shows how to set the relative position two columns in standard pitch (10 dots per column) to the left of the current position. 2 x 10 = 20 dots (two columns to be moved left of the current position) 65,536–20 = 65516 65,516/256 = 255, remainder of 236 n1 = 236, n2 = 255
To move to the right: Determine the value of n by multiplying the number of columns to move right of the current position by 10 (slip or receipt standard pitch) or 8 (receipt compressed pitch). The example shows how to set the relative position two columns in standard pitch (10 dots per column) to the right of the current position. 2 x 10 = 20 dots (two columns to be moved left of the current position) 20/256 = 0, remainder of 20 n1 = 20, n2 = 0
In order to improve the speed of printing, the A758 emulation and A760 moves the data into a buffer for the printhead 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. This behavior can be used to an application’s advantage to provide the ability to create compound characters on the receipt station.
Page 50
50
Revision F January 2010
A760 User Guide: Programming Supplement Chapter 4: Programming commands
Select justification ASCII Hexadecimal Decimal
ESC a n 1B 61 n 27 97 n
Value of n:
0, 48 = Left aligned 1, 49 = Center aligned 2, 50 = Right aligned
Range of n:
0–2, 48–50
Default:
0 (Left aligned)
Specifies the alignment of characters, graphics, logos, and bar codes on the receipt station. Exception
This command is valid only when input at the beginning of a line.
Set left margin ASCII Hexadecimal Decimal
GS L nL nH 1D 4C nL nH 29 76 nL nH
Range of nL:
0–255
Range of nH:
0–255
Default:
576 dots (the maximum printable area)
Formulas
Sets the left margin of the printing area. The left margin is set to ((nH X 256) + nL) times horizontal motion unit) inches. The horizontal motion units are set by the set horizontal and vertical minimum motion units command (1D 50), described in this manual. The width of the printing area is set by the set printing area width command (1D 57), which follows this command. See the set printing area width command in this document for a description of that command. If the setting exceeds the printable area, the maximum value of the printable area is used. The maximum printable area is 576 dots. See the illustration. To set the left margin to one inch at the default horizontal motion unit of 1/203 inches, send the four-byte string: GS L 203 0
Or, to set the left margin to two inches at the default horizontal motion unit of 1/203 units per inch, send the four-byte string: GS L 150 1
Where 2 inches = 406/203, and 406 = (1 X 256) + 150.
�����������������������
���� ������
������������� �����
Exceptions:
The command is effective only at the beginning of a line. This command is ignored if the line buffer is not empty, and only effects the receipt interface.
Page 51
Revision F January 2010
A760 User Guide: Programming Supplement
51
Chapter 4: Programming commands
Set printing area width ASCII Hexadecimal Decimal
GS W nL nH 1D 57 nL nH 29 87 nL nH
Range of nL:
0–255
Range of nH:
0–255
Default:
576 dots (the maximum printable area)
Sets the width of the printing area. If the setting exceeds the printable area, the maximum value of the printable area is used. The width of the printing area is set to ((nH X 256) + nL) times horizontal motion unit) inches. The horizontal motion units are set by the set horizontal and vertical minimum motion units command (1D 50). 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. Formulas
To set the width of the printing area to one inch at the default horizontal motion unit of 1/203 inches, send the four-byte string: GS W 203 0
Or, to set the width of the printing area to two inches at the default horizontal motion unit of 1/203 units per inch, send the four-byte string: GS W 150 1
Where 2 inches = 406/203, and 406 = (1 X 256) + 150.
�����������������������
���� ������
������������� �����
Exceptions
This command is effective only at the beginning of a line. If the setting exceeds the printable area, the maximum value of the printable area is used. The maximum printable area is 576 dots. See the illustration.
Page 52
52
Revision F January 2010
A760 User Guide: Programming Supplement Chapter 4: Programming commands
Text characteristics commands These commands control what the printed information looks like, selection of character sets, definition of custom-defined characters, and setting of margins. The commands are described in order of their hexadecimal codes.
Select double-wide characters ASCII Hexadecimal Decimal
DC2 12 18
Prints double-wide characters. The printer is reset to single-wide mode after a line has been printed or the clear printer (0x10) command is received. Double-wide characters may be used in the same line with single-wide characters.
Select single-wide characters ASCII Hexadecimal Decimal
DC3 13 19
Prints single-wide characters. Single-wide characters may be used in the same line with double-wide characters.
Select 90 degree counter-clockwise rotated print ASCII Hexadecimal Decimal
ESC DC2 1B 12 27 18
Rotates 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.
Exceptions
This command is valid only at the beginning of a line. Rotated print and non-rotated print characters cannot be used together in the same line. Related information
See “Summary of rotated printing” in this document.
Select pitch (column width) ASCII Hexadecimal Decimal
ESC SYN n 1B 16 n 27 22 n
Value of n:
0 = Standard pitch 1 = Compressed pitch
Pitch
Receipt Columns
Receipt CPI
Slip Columns
Slip CPI
Default:
0 (Standard pitch)
Standard
44
15.6
66
13.9
Selects the character pitch for a print line.
Compressed 56
20.3
80
17.1
Formulas
Related information
The following table provides the print characteristics for both pitches on the receipt and slip station.
Look in Chapter 3: Programming the Printer, “Character appearance” for a description of both pitches.
Page 53
Revision F January 2010
A760 User Guide: Programming Supplement
53
Chapter 4: Programming commands
Set right-side character spacing ASCII Hexadecimal Decimal
ESC SP n 1B 20 n 27 32 n
Range of n:
0 – 32 (decimal)
Default:
0
Sets the right side character spacing to [ n x horizontal or vertical motion units]. Values for this command are set independently in standard and paper mode. The units of horizontal and vertical motion are specified by the set horizontal and vertical minimum motion units (1D 50 …) command. Changes in the horizontal or vertical units do not affect the current right side character spacing. When the horizontal or vertical motion unit is changed by the set horizontal and vertical minimum motion units (1D 50 …) command the value must be in even units and not less than the minimum amount of horizontal movement.
In page mode the horizontal or vertical motion unit differs and depends on the starting position of the printable area. When the starting printing position is the upper left or lower right of the printable area (set by select print direction in page mode, 1B 54 n) the horizontal motion unit (x) is used. When the starting printing position is the upper right or lower left of the printable area (set by select print direction in page mode, 1B 54 n) the vertical motion unit (y) is used. Exception
This is ignored in A756 emulation mode and is only valid on the receipt station.
In standard mode the horizontal motion unit is used.
Select print mode ASCII Hexadecimal Decimal
ESC ! n 1B 21 n 27 33 n
Value of n:
Pitch selection (standard, compressed, double-high, or double-wide.)
Value of n Bit
Function
0
1
Bit 0
Pitch2 (See chart below)
Standard1 pitch
Compressed pitch
Bit 3
Emphasized mode
Canceled
Set
Bit 4
Double-high2
Canceled
Set
Bit 5
Double-wide
Canceled
Set
Bit 7
Underlined mode
Canceled
Set
Bits 1, 2 and 6 are not used. Standard and compressed pitch cannot be used together in the same line. 1
Double-high character cannot be used with normal character in the same line, nor can they be used on the slip station. 2
Default:
0 (for bits 0, 3, 4, 5, 7)
Selects the print mode: standard, compressed, double-high, or double-wide. Pitch
Receipt Station
Receipt CPI
Slip Station
Slip CPI
Standard
44
15.6
66
13.9
Compressed 56
20.3
80
17.1
Related information
The bits in this command perform the same function as the stand-alone functions: 1B 16 n 1B 45 n 1B 47 n 12 13 1B 2D n
Select pitch Emphasized Double-strike Double-wide Single-wide Underline
Page 54
54
Revision F January 2010
A760 User Guide: Programming Supplement Chapter 4: Programming commands
Select or cancel user-defined character set ASCII Hexadecimal Decimal
ESC % n 1B 25 n 27 37 n
Value of n:
0 = Code Page 437 1 = User Defined (RAM) 2 = Code Page 850
Range of n:
0–2
Selects the character set. When an undefined RAM character is selected, the code page 437 character is used. Look in Chapter 3: Programming the Printer, “Character appearance” for the character sets.
Default:
0 (Code Page 437)
Exception:
The character sets cannot be used together on the same line.
Define user-defined character set ASCII Hexadecimal Decimal
ESC & s c1 c2 [character 1 data] ... [character k data] 1B 26 s c1 c2 [character 1 data] ... [character k data] 27 38 s c1 c2 [character 1 data] ... [character k data]
Values and ranges: Receipt:
Slip:
s = 3, the number of bytes (vertically) in the character cell c = the ASCII codes of the first (c1) and last (c2) characters respectively c = the ASCII codes of the first (c1) and last (c2) characters respectively c1 = Hex 20–FF (20 is always printed as a space) c2 = Hex 20–FF (20 is always printed as a space) To define only one character, use the same code for both c1 and c2 k = c2 – c1 + 1 = the number of characters to be defined in this command string [character i data] = [ni d1 ... d(3 x ni)] for 1 ≤ i ≤ k 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 ... dn Each character is defined by 12 bytes (only bytes 2–11 are printed.)
ni = the number of dot columns for the ith character, 1 ≤ ni ≤ 16
Each byte is one 7-dot high column (full- or half-dot column.)
d = the dot data for the characters
Overlapped dots are not printed.
The number of bytes for the ith character cell is 3 x ni.
The data must contain [(c2 - c1 + 1) x 12] bytes. (See illustration on top of next page.)
The bytes are printed down and across each cell. Defines and enters downloaded characters into RAM. The command may be used to overwrite single characters. Userdefined characters are available until power is turned off or the initialize printer command (1B 40) is received. Any invalid byte (s, c1, c2, n1) aborts the command. Related information
See 1D 22 n (select memory type where to save user-define fonts.)
Defines and enters downloaded characters into RAM or flash. The command may be used to overwrite single characters. User-defined characters are available until power is turned off or the initialize printer command (1B 40) is received. Any invalid byte (s, c1, c2, n1) aborts the command. User-defined character sets for both slip and receipt may be used at the same time. The command clears bit image logo data from RAM. The illustration on the next page provides a sample of a character cell. Related information
See 1D 22 n (select memory type where to save user-define fonts.)
Page 55
Revision F January 2010
A760 User Guide: Programming Supplement
55
Chapter 4: Programming commands
-
-
Select or cancel underline mode ASCII Hexadecimal Decimal
ESC - n 1B 2D n 27 45 n
Decimal Hex 0, 48 30 = Cancel underline mode 1, 49 31 = Select underline mode 2, 50 32 = Select double thickness underline mode
This command and the select print mode(s) command (1B 21) turn underline on and off in the same way.
Default:
This command is only available in A758 emulation and A760 native mode.
Value of n:
0 (Cancel underline mode)
Turns underline mode on or off. Underlines cannot be printed for spaces set by the horizontal tab, set absolute start position, or set relative print position commands.
Exceptions
This command is ignored if n is out of the specified range.
Copy character set from ROM to RAM ASCII Hexadecimal Decimal
ESC : 0 0 0 1B 3A 30 30 30 27 58 48 48 48
Default:
Code page 437
Copies characters in the active ROM set to RAM. Use this command to re-initialize the user-defined character set. Code page 437 is copied by default at initialization. This command is ignored if current font is the user font.
Related information
To modify characters in one of the character set variations, such as rotated print, select one of the rotated print commands, copy to RAM, then use the define user-defined character set command (1B 26).
Page 56
56
Revision F January 2010
A760 User Guide: Programming Supplement Chapter 4: Programming commands
Cancel user-defined character ASCII Hexadecimal Decimal
ESC ? n 1B 3F n 27 63 n
Value of n:
Specified character code.
Exceptions
Range of n:
32–255
This command is ignored if n is out of range or if the userdefined character is not defined.
Cancels the pattern defined for the character code specified by n. After the user-defined character is canceled, the corresponding pattern from code page 437 is printed.
Select or cancel emphasized mode ASCII Hexadecimal Decimal
ESC E n 1B 45 n 27 69 n
Value of n:
0 (bit 0) not selected 1 (bit 0) selected
Exceptions
(When 0 and 1 are the least significant bit, LSB)
Only the lowest bit of n is effective. Emphasized printing cannot be used with bit-images or downloaded bit-images.
Range of n:
0–255
Related information
Default:
0 (bit 0)
This command and the select print mode(s) command (1B 21) function identically.
Starts or stops emphasized printing on slip and receipt. In emphasized mode on the slip, each line is printed twice to improve penetration of multipart forms and increase print contrast. The second pass is printed the same direction as the first to ensure accuracy of the overprint. Printing speed decreases due to the second printing pass.
Select double-strike A756 emulation
A760 native mode
ASCII Hexadecimal Decimal
ESC G 1B 47 27 71
ESC G n 1B 47 n 27 71 n
Value of n:
0 = Off 1 = On (When 0 and 1 are the least significant bit, LSB)
Default:
0 (Off )
Turns double-strike mode on for the slip station. Overprints a second pass of the print line on the slip station to improve penetration of multipart forms and increase print contract. The second pass is printed the same direction as the first to ensure accuracy of the overprint. The printer is reset to the standard print mode after a clear printer (0×10) command is received.
Exceptions
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 A760 native mode, the command takes a parameter to enable and disable it. Related information
Printer output is the same as in emphasized mode.
Page 57
Revision F January 2010
A760 User Guide: Programming Supplement
57
Chapter 4: Programming commands
Cancel double-strike ASCII Hexadecimal Decimal
ESC H 1B 48 27 72
Turn off double-strike mode on the slip station in A756 emulation mode.
This command is ignored in the A758 emulation mode and A760 native mode. This command works on both slip and receipt stations.
Select or cancel italic print ASCII Hexadecimal Decimal
ESC I n 1B 49 n 27 73 n
Value of n:
0 = Off 1 = On (When 0 and 1 are the least significant bit, LSB)
Default:
0 (Off )
Turns italic print mode on or off. This command is only available A758 emulation and A760 native modes.
Italic print mode is available for built-in, user-defined characters. This command only works on the receipt station. Exceptions
Only the lowest bit of n is valid. This command is only valid for the receipt station in A758 emulation and A760 native modes.
Select international character set ASCII Hexadecimal Decimal
ESC R n 1B 52 n 27 82 n or or or
ESC t n 1B 74 n 27 116 n
Value of n: A760 native mode
A756 emulation
0 = Code Page 437
0 = Code Page 437
1 = Code Page 850
Not 0 = Code Page 850
2 = Code Page 852 3 = Code Page 860 4 = Code Page 863 5 = Code Page 865 6 = Code Page 858 7 = Code Page 866 8 = Code Page 1252 9 = Code Page 862 10 = Code Page 737, Greek (only in A760 native mode) 12 = Code Page 857 Default:
0 (Code Page 437)
Selects the character set to be used. Look in “Appendix B: Resident Character Sets” for the character sets. There are two codes for this command (see select international character set, 1B 74 n). Both codes perform the same function. Exception
The character sets cannot be used together on the same line. Related information
This command may also be known as select character code table.
Page 58
58
Revision F January 2010
A760 User Guide: Programming Supplement Chapter 4: Programming commands
Select character code table See the previous command, select international character set.
Select or cancel 90 degree clockwise rotated print ASCII Hexadecimal Decimal
ESC V n 1B 56 n 27 86 n
Value of n:
0 = Cancel 1 = Set
Default:
0 (Cancel)
Rotates characters 90 degrees clockwise. The command remains in effect until the printer is reset or until a clear printer (0x10) or rotated print (1B 12) command is received. See summary of rotated printing in this document.
Select or cancel upside-down print mode ASCII Hexadecimal Decimal
ESC { n 1B 7B n 27 123 n
Value of n:
0 = Cancel 1 = Set
Default:
0 (Cancel)
Prints 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. Only bit 0 is used. Bits 1–7 are not used. See summary of rotated printing in this document for more information.
Exceptions
The command is valid only at the beginning of a line. The rotated print command (1B 12) cancels this command.