The text of a manual · part 11 of 14
A795 Two-Color Thermal Receipt Printer User Guide: Programming Supplement, pages 101 to 110
Pages 101 to 110 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 101
A795 User Guide: Programming Supplement
Revision E May 2005
101
Chapter 4: Programming commands
Select PDF 417 parameters ASCII GS p a b c d e f Hexadecimal 1D 70 a b c d e f Decimal 29 112 a b c d e f Value and Ranges: Value:
Ranges:
a, b =
Description: The ratio of bar height to symbol length.
a = height limit 1 to 10 b = width limit 1 to 100 c= rows limit 3 to 90
Number of rows in the matrix of code words.
d= columns limit 7 to 30
Number of columns in the matrix of code words.
e= x dimension limit 1 to 7
Width of a single module in dots.
f= y dimension limit 2 to 25
Height of the code word in dots.
Defaults:
a=1 b=2 c = 58 d=7 e=3 f = 10
PDF 417 is a multi-row, continuous, variable length symbology which has high data capacity. Each symbol has between 3 and 90 rows, with each row containing a start pattern, a left row indicator, 1 to 30 data characters, a right row indicator and a stop pattern. The number and length of the rows are selectable, which allows the aspect ratio to be adjusted to particular labeling applications. There are no separator bars between rows.
Each character has four bars and four spaces within 17 modules, and is assigned a value between 0 and 928. For this symbology, it is common to refer to these character values as “code words.” 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. (Select PDF 714 parameters-continued on the next page)
Page 102
102
A795 User Guide: Programming Supplement
Revision E May 2005
Chapter 4: Programming commands
Sample symbol description: Each PDF 417 symbol consists of 3 to 90 stacked rows surrounded on all four sides by a quiet zone. Each row contains: Data Character Start Pattern Code words Stop Pattern Left Row Indicator Right Row Indicator Code words Code words row 1
- row 2 - row 3 - row 4 - row 5 - row 6 1 Leading quiet zone
Related Information:
2 Start pattern
The “Set bar code width” command (1D 77 n) affects the x dimension and row height for PDF 417. See chart below.
3 Left row indicator characters (code words) 4 One to thirty data characters (code words) 5 Right row indicator character (code words)
n value x dimension row height
6 Stop pattern
2
2
7
7 Trailing quiet zone
3
3
10
The number of characters in a row and number of rows can be adjusted to vary the symbol’s overall aspect ratio to best fit an available space.
4
4
13
5
5
17
6
6
20
Each row has a left and right row indicator with a data region between. The left-most character in the top row of the data region is the total number of characters in the data region, excluding error correction characters. Characters within the data region are designed to be read from left to right, starting on the top row, immediately after the length-defining character. The maximum characters in the data region are 928.
Select bar code width ASCII GS w n Hexadecimal 1D 77 n Decimal 29 119 n Value of n:
2, 3, 4, 5, 6
Formulas
Default:
n=3 n/8mm (n/203 inch)
Sets the bar code width to n dots.
Page 103
Revision E May 2005
A795 User Guide: Programming Supplement
103
Chapter 4: Programming commands
Page mode Page mode is one of two modes that the A795 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 mode is different in that it processes or prepares the data as a “page” in memory before it prints it. Think of this as a virtual page. The page can be any area within certain parameters that you define. The page is printed using either the FF (0C) or the ESC FF (1B 0C) command. The select page mode command (1B 4C) puts the printer into page mode. Any commands that are received are interpreted as page mode commands. Several commands react differently when in standard mode and page mode. The descriptions of these individual commands in this chapter indicate the differences in how they operate in the two modes. These commands describe the 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.
Print and return to standard mode ASCII FF Hexadecimal 0C Decimal 12
When printing is completed, values for select print direction in page mode (1B 54n) and set print area in page mode (1B 57 n1, n2, …n8) and the position for buffering character data are set. Buffered data is not deleted from the printer.
The processed data is printed and the printer returns to standard mode. The developed data is deleted after being printed. For more information see page mode in this document. Exceptions
This command is enabled only in page mode.
Cancel print data in page mode ASCII CAN Hexadecimal 18 Decimal 24
Deletes all the data to be printed in the “page” area. Any data from the previously selected “page” area that is also part of the current data to be printed is deleted.
Exceptions
This command is only used in page mode.
Print data in page mode ASCII ESC FF Hexadecimal 1B 0C Decimal 27 12
Collectively prints all buffered data in the printing area.
Exceptions
After printing, the printer does not clear the buffered data and sets values for select print direction in page mode (1B 54 n) and set print area in page mode (1B 57 …), and sets the position for buffering character data.
This command is enabled only in page mode.
Page 104
104
A795 User Guide: Programming Supplement
Revision E May 2005
Chapter 4: Programming commands
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. The developed data is deleted after being printed. For more information see page mode in this document. This command sets the position where data is buffered to the position specified by select print direction in page mode (1B 54) within the printing area defined by set print area in page mode (1B 57).
The table below shows the difference in memory allocation in page mode when using monochrome and two-color paper. Two-color paper mode requires extra memory in order to differentiate between non-black and black. Paper type Total memory Area of allocated (kBytes) construction (mm) Monochome 40.5 paper
72 wide x 72 high
This command switches the settings for the following commands (which values can be set independently in standard mode and page mode) to those for page mode.
Two-color 81.0 (dots) paper
72 wide x 72 high 72 wide x 72 high (energy)
• Set right-side character spacing (1B 20)
Exceptions
• Select 1/6-inch line spacing (1B 32)
The command is enabled only when input at the beginning of a line.
• Set line spacing (1B 33) It is possible only to set values for the following commands in page mode. These commands are not executed.
The command has no effect if page mode has previously been selected.
• Select or cancel 90 degree clockwise rotation (1B 56) • Set counter-clockwise rotation (1B 12) • Select justification (1B 61) • Select or cancel upside-down printing (1B 7B) • Set left margin (1D 4C) • Set print area width (1D 57)
Select standard mode ASCII ESC S Hexadecimal 1B 53 Decimal 27 83
Switches 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. This command switches the settings for the following commands (the values for these commands can be set independently in standard mode and page mode) to those for standard mode:
• Set right-side character spacing (1B 20) • Select 1/6 inch line spacing (1B 32) • Set line spacing (1B 33) Standard mode is automatically selected when power is turned on, the printer is reset, or the initialize printer command (1B 40) is used. Exceptions
This command is effective only in page mode.
Page 105
A795 User Guide: Programming Supplement
Revision E May 2005
105
Chapter 4: Programming commands
Select print direction in page mode ASCII ESC T n Hexadecimal 1B 54 n Decimal 27 84 n Start position
Default:
0 = Upper left corner proceeding across page to the right (A) 1 = Lower left corner proceeding up the page (B) 2 = Lower right corner proceeding across page to the left (upside down) (C) 3 = Upper right corner proceeding down page (D)
Selects the printing direction and start position in page mode. See the illustration in previous column.
0
The command can be sent multiple times so that several different print areas, aligned in different print directions, can be developed in the printer’s page buffer before being printed using the print page mode commands (0C or 1B 0C). Exceptions
D
A
The command is valid only in page mode.
B
The command is ignored if the value of n is out of the specified range.
C
Value of n:
Page 106
106
A795 User Guide: Programming Supplement
Revision E May 2005
Chapter 4: Programming commands
Set print area in page mode ASCII ESC W n1, n2 ...n8 Hexadecimal 1B 57 n1, n2 ...n8 Decimal 27 87 n1, n2 ...n8 Range of n:
0-255
Default:
n1-4 = n5 = n6 = n7 = n8 =
0 64 2 64 2
Sets the position and size of the printing area in page mode. The command can be sent multiple times so that several different print areas, aligned in different print directions, can be developed in the printer’s page buffer before being printed using the print page mode commands (0C or 1B 0C). Formulas
(x0, y0)
dy
• x0 = [(n1 + n2 x 256) x (horizontal direction of the fundamental calculation pitch)] • y0 = [(n3 + n4 x 256) x (vertical direction of the fundamental calculation pitch)] • dx = [(n5 + n6 x 256) x (horizontal direction of the fundamental calculation pitch)] • dy = [(n7 + n8 x 256) x (vertical direction of the fundamental calculation pitch)] Keep the following notes in mind for this command. • The fundamental calculation pitch depends on the vertical or horizontal direction. • The maximum printable area in the x direction is 576/203 inches. • The maximum printable area in the y direction is 576/203 inches.
dx
See the illustration for a graphic representation of the printing area. For more information about the fundamental calculation pitch, see the set horizontal and vertical motion units command (1D 50).
Print Area
Maximum area specification in page mode (x0 + dx, y0 + dy)
The starting position of the print area is the upper left of the area to be printed (x0, y0). The length of the area to be printed in the y direction is set to dy inches. The length of the area to be printed in the x direction is set to dx inches. Use the equations to determine the Value of x0, y0, dx, and dy.
Maximizing the possible area in page mode consumes almost all of the free RAM. Without any free RAM, bitmap rotations and enlargements cannot be performed. Use the User Storage Status command (1D 97 m n) to determine the amount of free memory. Exceptions
The command is effective only in page mode.
Page 107
Revision E May 2005
A795 User Guide: Programming Supplement
107
Chapter 4: Programming commands
Set absolute vertical print position in page mode ASCII GS $ nL nH Hexadecimal 1D 24 nL nH Decimal 29 36 nL nH
Sets the absolute vertical print starting position for buffer character data in page mode. The absolute print position is set to [(nL + nH X 256) x (vertical or horizontal motion unit)] inches. The vertical or horizontal motion unit for the paper roll is used and the horizontal starting buffer position does not move. The reference starting position is set by select print direction in page mode (1B 54). This sets the absolute position in the vertical direction when the starting position is set to the upper left or lower right; and sets the absolute position in the horizontal when the starting position is set to the upper right or lower left. The horizontal and vertical motion unit are specified by the set horizontal and vertical minimum motion units (1D 50) command.
The set horizontal and vertical minimum motion units (1D 50) command can be used to change the horizontal and vertical motion unit. However, the value cannot be less than the minimum horizontal movement amount, and it must be in even units of the minimum horizontal movement amount. Formulas
[(nL + nH X 256) x (vertical or horizontal motion unit)] inches. Exceptions
This command is effective only in page mode. If the [(nL + nH X 256) x (vertical or horizontal motion unit)] exceeds the specified printing area, this command is ignored.
Set relative vertical print position in page mode ASCII GS \ nL nH Hexadecimal 1D 5C nL nH Decimal 29 92 nL nH Value
Formulas
The value for the horizontal and vertical movement cannot be less than the minimum horizontal movement amount, and must be in even units of the minimum horizontal movement amount.
The distance from the current position is set to [(nL + nH x 256) x vertical or horizontal motion unit] inches. The amount of movement is calculated only for the paper roll.
Sets 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.
When pitch n is specified to the movement downward: nL + nH x 256 = n
1. This command functions as follows, depending on the print starting position set by select print direction in page mode (1B 54):
When pitch n is specified to the movement upward: nL + nH x 256 – 65536 – N
2. When the starting position is set to the upper right or lower left of the printing area, the vertical motion unit (y) is used.. 3. When the starting position is set to the upper left or lower right of the printing area, the horizontal motion unit (x) is used.
When pitch n is specified to the movement upward (the negative direction), use the complement of 65536.
Exceptions
This command is used only in page mode, otherwise it is ignored. Any setting that exceeds the specified printing area is ignored.
Page 108
108
A795 User Guide: Programming Supplement
Revision E May 2005
Chapter 4: Programming commands
Macros These commands are used to select and perform a user-defined sequence of printer operations.
Select or cancel macro definition ASCII GS : Hexadecimal 1D 3A Decimal 29 58
Starts or ends macro definition. Macro definition begins when this command is received during normaloperation and ends when this command is received during macro definition. The macro definition is cleared, during definition of the macro when the execute macro (1D 5E) command is received. Normal printing occurs while the macro is defined. When the power is turned on the macro is not defined. The defined contents of the macro are not cleared by the initialize printer (1B 40), thus, the initialize printer (1B 40) command may be used as part of the macro definition.
If the printer receives a second select or cancel macro definition (1D 3A) command immediately after previously receiving a select or cancel macro definition (1D 3A) the printer remains in the macro undefined state. 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 Decimal 29 94 r t m Value of r:
The number of times to execute the macro.
Value of t: macro.
The waiting time for executing the
Executes a macro. After waiting for a specified period the printer waits for the paper feed button to be pressed. After the button is pressed, the printer executes the macro once. The printer repeats this operation the number of specified times.
When the macro is executed by pressing the paper feed button (m = 1), paper cannot be fed by using the paper feed button. Formulas
The waiting time is t x 100 ms for every macro execution. m specifies macro executing mode when the LSB (least significant bit) m = 0 The macro executes r times continuously at the interval specified by t when the LSB (least significant bit) of m = 1. Exceptions
If this command is received while a macro is being defined, the macro definition is aborted and the definition is cleared. If the macro is not defined or if r is 0, nothing is executed.
Page 109
Revision E May 2005
A795 User Guide: Programming Supplement
109
Chapter 4: Programming commands
User data storage Write to user data storage ASCII ESC ‘ m a0 a1 a2 d1 ... dm Hexadecimal 1B 27 m a0 a1 a2 d1 ... dm Decimal 27 39 m a0 a1 a2 d1 ... dm Value of m:
0 – 255
Writes m bytes of data to the user data storage flash page at the address specified. The printer waits for m bytes of data following the 3-byte address, addr.
If any of the memory locations addressed by this command are not currently erased, the command is not executed. Related information
Result of this write is returned in bit 2 of response to transmit status command 1D 72, n = 4.
Read from user data storage ASCII ESC 4 m a0 a1 a2 Hexadecimal 1B 34 m a0 a1 a2 Decimal 27 52 m a0 a1 a2 Value of m:
0 – 255
Reads m bytes of data from the user data storage flash page at the address specified.
Read from non-volatile memory ASCII ESC j k Hexadecimal 1B 6A k Decimal 27 106 k Range of k:
20 – 63 (decimal)
Reads a two-byte word from location k in the history EEROM. The printer returns the word at the next available opportunity.
Related information:
This is ignored in LEGACY emulation and the parameter byte goes into the print buffer.
Write to non-volatile memory (NVRAM) ASCII ESC s n1 n2 k Hexadecimal 1B 73 n1 n2 k Decimal 27 115 n1 n2 k Value of n1:
1st Byte
Value of n2:
2nd Byte
Range of k:
20 – 63 (decimal locations)
Writes the two-byte word, n1 n2, to location k in history EEROM.
Related information:
This is ignored in LEGACY emulation and the parameter bytes go into the print buffer.
Page 110
110
A795 User Guide: Programming Supplement
Revision E May 2005
Chapter 4: Programming commands
Select memory type (SRAM/flash) where to save logos or user-defined fonts ASCII GS “ n Hexadecimal 1D 22 n Decimal 29 34 n Value of n:
48 – 51 n = 51 (ASCII n = 3) HEX 33 n = 48 (ASCII n = 0) HEX 30
Loads active logo to RAM only. This is used to print a special logo but not have it take up flash memory. A logo defined following this command is not preserved over a power cycle. The printer disables interrupts while writing to flash. Any command that cause data to be written to flash should be followed by a 50 Msec delay to allow significant time for the write operation.
Loads user-defined characters to flash memory. An application must use this command to store userdefined characters in flash memory. Any user-defined characters defined following this command are stored in flash memory. A user-defined character cannot be redefined in flash memory. The flash memory page must be erased by an application before redefining userdefined characters. For more information, see the erase user flash sector (1D 40 n) command.
n = 49 (ASCII n = 1) HEX 31
Loads active logo to flash memory. This is the default condition for logo flash storage. A logo defined following this command is stored in flash memory.
Specifies whether to load the logos or user-defined characters to flash memory or to RAM (volatile memory). The selection remains in effect until it is changed via this command or until the power cycles.
n = 50 (ASCII n = 2) HEX 32
Related information
Loads user-defined characters to RAM only. This is the default condition for user-defined character storage. Any user-defined characters defined following this command are not preserved over a power cycle.
This command is recognized in A795 native mode. In A793 and LEGACY emulations, parameter bytes go into the print buffer.
Flash memory user sectors allocation ASCII GS “ U n1 n Hexadecimal 1D 22 55 n1 n2 Decimal 29 34 85 n1 n2 Default Value of n1:
1 (see below)
Default Value of n2:
1 (see below)
If n1 + n2 is greater than the maximum number of sectors available, the command is ignored.
n1 is the number of 64k sectors used for logos and user-defined characters.
Issuing this command with parameters different from current parameters will erase all sectors.
n2 is the number of 64k sectors used for user data storage.
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.
n1 + n2 <= 6 (dec) (1M) n1 + n2 <= 22 (dec) 16 (hex) (2M)