Browse
(440) 299-7778
Menu
(440) 299-7778
One-year parts and labor warranty30-day money-back guaranteeEnglishEspañolContact

The text of a manual · part 6 of 14

A795 Two-Color Thermal Receipt Printer User Guide: Programming Supplement, pages 51 to 60

Pages 51 to 60 of 136

The original document is the PDF (980 KB). 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 Axiohm A795

Page 51

Revision E May 2005

A795 User Guide: Programming Supplement

51

Chapter 4: Programming commands

Set relative print position ASCII ESC \ n1 n2 Hexadecimal 1B 5C n1 n2 Decimal 27 92 n1 n2 Value of n:

To move to the right:

To move the relative starting position right of the current position:

Determine the value of n by multiplying the number of columns to move right of the current position by 10 (standard) or 8 (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.

n = Number of dots to be moved right of the current position 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. To move the relative starting position left of the current position: n = Number of dots to be moved left of the current position n1 = Remainder after dividing (65,536-n) by 256 n2 = Integer after dividing (65,536-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 (standard) or 8 (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

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 Related information

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. Compatibility information (A795 receipt vs. A793 receipt)

There is a difference in the normal behavior of this command in A793 emulation mode as compared to the original A793. The difference exists when the command is used to move to the left. The A793 processes the whole print string prior to putting it in the buffer for the print head. This method of processing allows the A793 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. In order to improve the speed of printing, the A795 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. This command also functions differently in the A793 emulation when used in graphics: n x 2 = Number of dots to be moved from the beginning of the line when this command is followed by a graphic command.

Page 52

52

A795 User Guide: Programming Supplement

Revision E May 2005

Chapter 4: Programming commands

Select justification ASCII ESC a n Hexadecimal 1B 61 n Decimal 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 according to the above table.

Related information

On the LEGACY emulation printer, this command is valid only at the beginning of a line. Range of n on A793 is 0–255 using low 2 bits only: 00 01 10 11 left aligned center right aligned center

Set left margin ASCII GS L nL nH Hexadecimal 1D 4C nL nH Decimal 29 76 nL nH Range of nL:

0–255

Printable Area 576 Dots

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 fourbyte 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.

Left Margin

Printing Area Width

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 53

Revision E May 2005

A795 User Guide: Programming Supplement Chapter 4: Programming commands

Set printing area width ASCII GS W nL nH Hexadecimal 1D 57 nL nH Decimal 29 87 nL nH Range of nL:

0–255

Printable Area 576 Dots

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.

Left Margin

Printing Area Width

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.

53

Page 54

54

A795 User Guide: Programming Supplement

Revision E May 2005

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. The commands describe operation for 80mm paper. If the printer supports 82.5mm paper, the dot spacing is the same but there are 640 printable dots rather than 576 printable dots on 80mm paper.

Select double-wide characters ASCII DC2 Hexadecimal 12 Decimal

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.

Exceptions

Double-wide characters may not be used in the same line with single or double-density graphics. Related information

This command is ignored in LEGACY emulation.

Select single-wide characters ASCII DC3 Hexadecimal 13 Decimal 19

Prints single-wide characters. Single-wide characters may be used in the same line with double-wide characters.

Related information

This command is ignored in LEGACY emulation.

Exceptions

Single-wide characters may not be used in the same line with single or double-density graphics.

Select 90 degree counter-clockwise rotated print ASCII ESC DC2 Hexadecimal 1B 12 Decimal 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. This command is ignored in LEGACY emulation.

Page 55

A795 User Guide: Programming Supplement

Revision E May 2005

55

Chapter 4: Programming commands

Select pitch (column width) ASCII ESC SYN n Hexadecimal 1B 16 n Decimal 27 22 n Value of n:

0 = Standard pitch 1 = Compressed pitch

Default:

0 (Standard pitch)

Related information

Look in Chapter 3: Programming the Printer, “Character appearance” for a description of both pitches.

Selects the character pitch for a print line. Formulas

This command and the select print modes command (1B 21 n) affect pitch selection.

The following table provides the print characteristics for both pitches on the receipt station.

This is ignored in LEGACY emulation and the parameter byte goes into the print buffer.

Pitch

Columns, 80mm Paper

Columns, CPI 82.5mm Paper

Standard

44

49

15.6

56

64

Compressed 20.3

Set right-side character spacing ASCII Hexadecimal Decimal Range of n:

ESC SP n 1B 20 n 27 32 n 0 – 32 (decimal)

Default:

0

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 standard mode the horizontal motion unit is used. 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.

Related information

This is ignored in LEGACY emulation and the parameter byte goes into the print buffer. In the A793 emulation, the command and parameter byte are ignored.

Page 56

56

A795 User Guide: Programming Supplement

Revision E May 2005

Chapter 4: Programming commands

Select print mode ASCII ESC ! n Hexadecimal 1B 21 n Decimal 27 33 n Value of n:

Pitch selection (standard, compressed, double high, or double wide.)

Value of n

Exceptions

Refer to the table in other column for exceptions. Related information

Bit1

Function

0

1

Bit 0

Pitch2 (See chart below)

Standard pitch

Compressed pitch

Look in Chapter 3: Programming the Printer, “Character appearance” for a description of standard and compressed character pitches.

Bit 3

Emphasized mode Canceled

Set

The bits in this command perform the same function as the stand-alone functions:

Bit 4

Double-high

Canceled

Set

Bit 5

Double-wide

Canceled

Set

Bit 7

Underlined mode Canceled

Set

1B 16 n 1B 45 n 1B 47 n 12 13 1B 2D n

1

Bits 1, 2 and 6 are not used.

Select pitch Emphasized Double-strike Double-wide Single-wide Underline

2

Standard and compressed pitch cannot be used together in the same line. Default:

0 (for bits 0, 3, 4, 5, 7)

This command and select pitch (column width) command (1B 16 n) affect pitch selection. Pitch

Columns, Columns, 80 mm paper 82.5 mm paper

CPI

Standard

44

49

15.6

Compressed 56

64

20.3

Selects the print mode: standard, compressed, emphasized, underlined, double-high, or double-wide.

Select or cancel user-defined character set ASCII ESC % n Hexadecimal 1B 25 n Decimal 27 37 n Value of n:

0 = Code Page 437 1 = User Defined (RAM) 2 = Code Page 850

Range of n:

0–2

Default:

0 (Code Page 437)

Selects the character set. When an undefined RAM character is selected, the current active ROM code page character is used. Look in Chapter 3: Programming the Printer, “Character appearance” for the character sets.

Exception:

The character sets cannot be used together on the same line. Related information

In LEGACY emulation, the low order bit of n is used to select the user-defined character set and the current active ROM code page is not affected.

Page 57

A795 User Guide: Programming Supplement

Revision E May 2005

57

Chapter 4: Programming commands

Define user-defined character set ASCII ESC & s c1 c2 n1 d1 ... nn dn] Hexadecimal 1B 26 s c1 c2 n1 d1 ... nn dn] Decimal 27 38 s c1 c2 n1 d1 ... nn dn] Values and ranges:

Top of Character s = 3, the number of bytes (vertically) in the character cell c = the ASCII codes of the first (c1) and last (c2) characters respectively d1 d4 MSB 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 d2 d5 dn for both c1 and c2 n = the number of dot columns for the nth character as specified by n1 ... nn d3

LSB n = 1–16 d = the column data for the nth character as specified by d1 ... dn

The number of bytes for a character cell is s x n1. 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. User-defined characters are available until power is turned off or the initialize printer command (1B 40) is received.

Select or cancel underline mode ASCII ESC - n Hexadecimal 1B 2D n Decimal 27 45 n Value of n:

Any invalid byte (s, c1, c2, n1) aborts the command. Related information

See 1D 22 n (select memory type) to save user-defined characters

This command and the Select Print Mode(s) command (1B 21) turn underline on and off in the same way. Exceptions

Decimal Hex 0, 48

30

= Cancel underline

1, 49 2, 50

31 32

= Select underline mode = Select double mode thickness underline mode Default:

dn

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.

This command is ignored if n is out of the specified range.

Page 58

58

A795 User Guide: Programming Supplement

Revision E May 2005

Chapter 4: Programming commands

Related information

In A793 emulation, this command is unrecognized and the parameter n is put into the print buffer.

Copy character set from ROM to RAM ASCII ESC : 0 0 0 Hexadecimal 1B 3A 30 30 30 Decimal 27 58 0 0 0 Default:

Current active ROM code page

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.

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).

This command is ignored if current font is the user font.

Cancel user-defined character ASCII Hexadecimal Decimal

ESC ? n 1B 3F n 27 63 n

Value of n:

Specified character code.

Range of n:

32–255

Cancels the pattern defined for the character code specified by n. After the user-defined character is canceled, the corresponding pattern from current active ROM code page is printed.

Exceptions

This command is ignored if n is out of range or if the user-defined character is not defined.

Select or cancel emphasized mode

Default:

ASCII ESC E n Hexadecimal 1B 45 n Decimal 27 69 n

Starts or stops emphasized printing. The printer is reset to the standard print mode after a clear printer (0x10) command is received.

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

0 (Off)

Related information

This command and the select print mode(s) command (1B 21) function identically. They should have the same setting when used together. In A793 emulation, this command is unrecognized and the parameter byte is put into the print buffer.

Page 59

Revision E May 2005

A795 User Guide: Programming Supplement

59

Chapter 4: Programming commands

Select or cancel double-strike ASCII ESC G n Hexadecimal 1B 47 n Decimal 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 or off. Identical to emphasized mode. The printer is reset to the standard print mode after a clear printer (0x10) command is received.

Exceptions

Only the lowest bit of n is effective. 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. Related information

This command and the select print mode(s) command (1B 21) function identically. They should have the same setting when used together. In A793 emulation, this command is unrecognized and the parameter byte is put into the print buffer.

Select or cancel italic print ASCII ESC I n Hexadecimal 1B 49 n Decimal 27 73 n Value of n:

Default:

0 = Off 1 = On

Exceptions

Only the lowest bit of n is valid.

(When 0 and 1 are the least significant bit, LSB)

Related information

0 (Off)

This command is recognized in A795 native mode and A794 emulation.

Turns italic print mode on or off. The printer is reset to the standard print mode after a clear printer (0x10) command is received.

In A793 and LEGACY emulations, the parameter byte is put into the buffer.

Page 60

60

A795 User Guide: Programming Supplement

Revision E May 2005

Chapter 4: Programming commands

Select international character code ASCII Hexadecimal Decimal

ESC R n 1B 52 n 27 82 n

Value of n: A795 native mode emulation

A793 emulation

Application Compatible Escape Command (1B 52 n only)

0 = Code Page 437

0 = Code Page 437

0 = U.S.A.

1 = Code Page 850

Not 0 = Code Page 850

1 = France

2 = Code Page 852

2 = Germany

3 = Code Page 860

3 =-U.K.

4 = Code Page 863

4 = Denmark I

5 = Code Page 865

5 = Sweden

6 = Code Page 858

6 = Italy

7 = Code Page 866

7 = Spain

8 = Code Page 1252

8 = Japan

9 = Code Page 862

9 = Norway

10 = Code Page 737, Greek (only in A795 native mode) Default:

0 (Code Page 437)

Selects the character set to be used. Look in “Appendix B: Resident Character Sets” in the A795 User Guide 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.

Related information

The LEGACY emulation selection applies only to the command “Select international character code” (1B 52 n). The LEGACY emulation generates the same as A795 native mode for the command “Select international character set table” (1B 74 n).

Select or cancel 90 degree clockwise rotated print ASCII ESC V n Hexadecimal 1B 56 n Decimal 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.