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 9 of 14

A795 Two-Color Thermal Receipt Printer User Guide: Programming Supplement, pages 81 to 90

Pages 81 to 90 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 81

Revision E May 2005

A795 User Guide: Programming Supplement

81

Chapter 4: Programming commands

The operational theory of this command is that if (input character attributes) AND (original) = (original); then (output character attributes) = ([original] XOR [input character attributes]) OR (substituted). The 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. 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. Any mappings utilizing compressed and/or double-wide attributes will effect the length of a line and could cause unintended line wraps. Mappings containing doublehigh attributes could cause unintended receipt lengths.

Related information

This command is utilized in the TPG, Inc. LogoEZ® utility. The utility can be used to pre-configure new printers with a default colorization setup without requiring any application changes. The default setup was designed to provide a general level of colorization features that would not affect the printer operation. You can expand beyond the default features of the utility by modifying the application at the host. However, do not attempt to modify the settings within the utility. f = 1: s = 1H a = 30H f = 2: s = 32H r = 19H f = 3: s = 1H r = 7H t = 1H f = 4: s = 30H a = A0H

When both attribute mappings are set, processing is perform in order sequence. When two text attribute substitutions contain conflicting dependent remappings, the result is undefined.

Convert 6-dots/mm bitmap to 8-dots/mm bitmap ASCII

AX EOT n

Hexadecimal 1F 04 n Decimal 31 04 n Value:

0 = Off 1 = On (When 0 and 1 are the LSB)

Default:

0 (Off)

Selects or cancels 6-dot/mm emulation mode.

When the 6-dot/mm emulation is selected, logos and graphics are expanded horizontally and vertically during download to emulate their size on a 6-dot/mm printer. The horizontal positioning commands also emulate positioning on a 6-dot/mm printer.

Enable constant speed logos ASCII US { n Hexadecimal 1F 7B n Decimal 31 123 n Value:

0 = disable 1 = enable

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.

In general, the “Set max target speed (1D A0 nl nh)” is the preferred command.

Page 82

82

A795 User Guide: Programming Supplement

Revision E May 2005

Chapter 4: Programming commands

Status Status command introduction The A795 has three methods of providing status to the application. These methods are through batch status commands, real time status commands and unsolicited status mode. An application may use one or more of these methods to understand the current status of the printer. A brief description of each of these methods follows. Batch status commands – These commands are sent to the printer and stored in the printer’s buffer. Once the printer has processed all the previous commands these commands are processed and the proper status is returned to the application. In the event a condition causes the printer to go BUSY, it stops processing commands from the printer buffer. If a batch status command remained in the buffer during this busy condition, it would not be processed. In fact, no batch commands are processed while the printer is in this state.

Unsolicited status mode – This mechanism allows the application developer to program the printer to automatically respond with a four byte status when certain conditions in the printer change. Please see the subsequent sections for a more detailed description of these status commands. At the end of this status commands section is a page entitled “Recognizing data from the printer”. This describes how to interpret what command or setting (in the case of unsolicited status mode) triggered a response from the printer.

Real-time commands – These commands are sent to the printer buffer. Periodically, when the printer has time, it scans the input buffer looking for these commands. When found by the printer, these commands are processed immediately. This gives the application the ability to query the printer when it is in a busy state in order to correct whatever fault has occurred.

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.

When a fault occurs, the printer will go busy at the RS-232C interface and not respond to any of the batch mode printer status commands. If the fault causing the busy condition can be cleared, such as by loading paper, or letting the thermal printhead cool down, the printer will resume processing the data in its receive buffer.

Page 83

A795 User Guide: Programming Supplement

Revision E May 2005

83

Chapter 4: Programming commands

Transmit peripheral device status (RS-232C printers only) ASCII ESC u 0 Hexadecimal 1B 75 0 Decimal 27 117 0 Value of returned byte:

Exceptions

Bit 0

Bit 1

1 = Drawer 1 Closed

1 = Drawer 2 Closed

0 = Drawer 1 Open

0 = Drawer 2 Open

Bits 2–7 are not used.

Unlike the A793, that had a dedicated connector and resultant dedicated status reporting for each cash drawer, the A795 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. Related information

Transmits current status of the cash drawers. One byte is sent to the host computer. In DTR/DSR protocol, the printer waits for DSR = SPACE. If a drawer is not connected, the status will indicate it is closed.

In LEGACY emulation, this command is ignored.

Request alternate status (A793 emulation only) ASCII ESC u n Hexadecimal 1B 75 n Decimal 27 117 n Value and Range of n: Value of n Function

Description

00

High = Open Low = Closed or Not Present

Drawer 1

01

Drawer 2

02

Paper Low High = Paper Out (Not Implemented. Low = Paper Present Interpreted as Paper Out.)

03

Paper Out (Default) High = Paper Out Low = Paper Present

>03

Ignored, No Change Printer Does Not Stay BUSY1

1

High = Open Low = Closed or Not Present

PAPER EXHAUST LINE is valid to indicate previously requested status.

This command allows the printer to inform the host when the data in the buffer has been processed. The PAPER EXHAUST line shows the status for the cash drawer or receipt paper as shown in the table. Status information is limited to what can be sent by the dedicated lines: BUSY, ACK, PAPER EXHAUST, and FAULT.

Page 84

84

A795 User Guide: Programming Supplement

Revision E May 2005

Chapter 4: Programming commands

Transmit paper sensor status ASCII ESC v Hexadecimal 1B 76 Decimal 27 118

Sends status data to the host computer. The printer sends one byte to the host computer when it is not busy or in a fault condition. In DTS/DSR protocol, the printer waits for DSR = SPACE.

Values: Status Byte (RS-232C) Bit Function

0 Signifies

1 Signifies

0

Receipt paper

Present

Low (only if paper low sensor is enabled)

1

Receipt cover

Closed

Open

2

Receipt paper

Present

Out

3

Knife position

Home position

Not home position

4

Not used

Fixed to zero

Fixed to zero

5

Temperature

In valid range

Too hot or too cold

6

Voltage

In valid range

Too high or too low

7

Not used

Fixed to zero

Fixed to zero

Related information

See busy line and fault conditions in the real time commands section of this document for details about fault condition reporting. In LEGACY emulation, this command is ignored.

Page 85

A795 User Guide: Programming Supplement

Revision E May 2005

85

Chapter 4: Programming commands

Transmit printer ID ASCII GS I n Hexadecimal 1D 49 n Decimal 29 73 n Value of n:

n = 4 or 52: Logo Definition

1, 49 = Printer model ID 2, 50 = Type ID 3, 51 = ROM version ID 4, 52 = Logo Definition

Bit

Off/On

Hex

Decimal

Function

0

Off

00

0

No logo downloaded (SRAM or Flash)

On

01

1

Logo downloaded (SRAM or Flash)

Off

00

0

Not Used. Fixed to Off.

Transmits the printer ID specified by n as follows: n

Printer ID

Specification

ID

1, 49 Printer model ID

A795

0x24

2, 50 Type ID

Installed options

Refer to below

3, 51 ROM version ID

ROM version

0x00

4, 52 Logo definition

Logo definition

Refer to next column

(Hexadecimal)

1–7 n = 2 or 50: Type ID Bit

Off/On

Hex

Decimal

Function

0

Off

00

0

No two-byte character code installed.

On

01

1

Two-byte character code installed.

Off

00

0

No knife installed.

On

02

2

Knife installed.

2

–

–

–

Undefined.

3

–

–

–

Undefined.

4

Off

00

0

Not used. Fixed to Off.

5

–

–

–

Undefined

6

–

–

–

Undefined

7

Off

00

0

Not used. Fixed to Off.

1

Transmits the printer ID specified by n. This command is a batch mode command; that is, the response is transmitted after all prior data in the receive buffer has been processed. There may be a time lag between the printer receiving this command and transmitting the response, depending on the receive buffer status.

Page 86

86

A795 User Guide: Programming Supplement

Revision E May 2005

Chapter 4: Programming commands

Transmit printer ID, remote diagnostics extension ASCII GS I @ n Hexadecimal 1D 49 40 n Decimal 29 73 64 n Values of n:

Refer to table

Range of n:

32–255 (not all defined, but reserved)

Eighteen remote diagnostic items are defined in the following table: eight printer ID items and ten printer tally items. A group of four remote diagnostic functions is assigned to each diagnostic item. Most of the diagnostic items are maintained in non-volatile memory (NVRAM), but some are maintained in read-only memory (ROM).

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. The printer returns all ASCII data. It is preceded by the parameter n to identify the diagnostic item and is followed by a carriage return (0D) to signify the end of the data. Each returned message is defined as: n + data + <CR>

The command performs the remote diagnostic function specified by n as described in the following table. Value of n ASCII

Hex

Dec

Remote diagnostic item

Function

Space

20

32

Serial #, 10 digit ASCII

Write to NVRAM Example, send 14 bytes to printer: GS I @ 0x20 1234567890

!

21

33

Serial #

Write to NVRAM, and print on receipt to verify Example, send 14 bytes to printer: GS I @ ! 1234567890 This will print on receipt: Serial # written: 1234567890

#

23

35

Serial #

Return Serial #, preceded by n to identify Printer returns 12 bytes in above example: #1234567890<CR>

$

24

36

Class/model #, 15 digit ASCII

Write to NVRAM

%

25

37

Class/model #

Write to NVRAM, and print on receipt to verify

‘

27

39

Class/model #

Return Class/model #, returns 17 bytes

+

2B

43

Boot firmware part #, 12 digit ASCII

Return Boot firmware part #, returns 14 bytes

/

2F

47

Boot firmware CRC, 4 digit ASCII

Return Boot firmware CRC, returns 6 bytes

3

33

51

Flash firmware part #, 12 digit ASCII

Return Flash firmware part #, returns 14 bytes

7

37

55

Flash firmware CRC, 4 digit ASCII

Return Flash firmware CRC, returns 6 bytes

Ç

80

128

Receipt lines tally, 8 digit ASCII numeric, max 99,999,999

Write to NVRAM Example, send 12 bytes to printer: GS I @ Ç00010000 To set receipt lines tally to 10,000

ü

81

129

Receipt lines tally

Write to NVRAM, and print on receipt to verify Example, send 12 bytes to printer:

GS I @ ü00010000 This will print on receipt: Receipt tally written: 10,000 continued...

Page 87

A795 User Guide: Programming Supplement

Revision E May 2005

Chapter 4: Programming commands

Value of n (continued) ASCII

Hex

Dec

Remote diagnostic item

Function

é

82

130

Receipt lines tally

Clear receipt lines tally to 0

â

83

131

Receipt lines tally

Return receipt lines tally, preceded by n to identify Printer returns 10 bytes in above example: â00010000<CR>

ä

84

132

Knife cut tally, 8 digit ASCII numeric, max 99,999,999

Write to NVRAM

à

85

133

Knife cut tally

Write to NVRAM, and print on receipt to verify

å

86

134

Knife cut tally

Clear knife cut tally to 0

ç

87

135

Knife cut tally

Return knife cut tally, returns 10 bytes

É

90

144

Hours on tally, 8 digit ASCII numeric, max 99,999,999

Write to NVRAM

æ

91

145

Hours on tally

Write to NVRAM, and print on receipt to verify

Æ

92

146

Hours on tally

Clear Hours on tally to 0

ô

93

147

Hours on tally

Return hours on tally, returns 10 bytes

ù

97

151

Boot firmware version

Return boot firmware version, returns 6 bytes

ú

A3

163

Flash firmware version

Return flash firmware version, returns 6 bytes

ñ

A4

164

Flash cycles tally, 8 digit ASCII numeric, max 99,999,999

Write to NVRAM

Ñ

A5

165

Flash cycles tally

Write to NVRAM, and print on receipt to verify a

A6

166

Flash cycles tally

Clear flash cycles cut tally to 0 o

A7

167

Flash cycles tally

Return flash cycles cut tally, returns 10 bytes

¿

A8

168

Knife jams tally, 8 digit ASCII numeric, max 99,999,999

Write to NVRAM

+

A9

169

Knife jams tally

Write to NVRAM, and print on receipt to verify

+

AA

170

Knife jams tally

Clear knife jams tally to 0

½

AB

171

Knife jams tally

Return knife jams tally, returns 10 bytes

¼

AC

172

Cover openings tally, 8 digit ASCII numeric, max 99,999,999

Write to NVRAM

¡

AD

173

Cover openings tally

Write to NVRAM, and print on receipt to verify

«

AE

174

Cover openings tally

Clear cover openings tally to 0 continued...

87

Page 88

88

A795 User Guide: Programming Supplement

Revision E May 2005

Chapter 4: Programming commands

Value of n (continued) ASCII

Hex

Dec

Remote diagnostic item

Function

»

AF

175

Cover openings tally

Return cover openings tally, returns 10 bytes

B2

178

Max temperature tally

Reset max temperature reached value

B3

179

Max temperature tally

Return max temperature reached since it was reset, returns 10 bytes

|

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 4, 52 = Flash memory user sector status

Transmits the status specified by n. This is a batch mode command which transmits the response after all prior data in the receive buffer has been processed. There may be a time lag between the printer receiving this command and transmitting the response, depending on the receive buffer status. When DTR/DSR RS-232C communications handshaking control is selected, the printer transmits the one byte response only when the host signal DSR indicates it is ready to receive data.

When XON/XOFF RS232C communications handshaking control is selected, the printer transmits the one byte response regardless of the host signal DSR. The status bytes to be transmitted are described in the three tables on the next page. Exceptions

Unlike the A793, that had a dedicated connector and resultant dedicated status reporting for each cash drawer, the A795 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 89

A795 User Guide: Programming Supplement

Revision E May 2005

89

Chapter 4: Programming commands

Printer status (n = 1 or n = 49)

Flash memory user sector status (n = 4 or n = 52)

Bit Off/On status

Hex Decimal Status for transmit

Bit Off/On Hex Decimal Status for transmit status

0

Off On

00 01

0 1

Paper present. Paper exhausted.

0

–

–

–

Undefined. Fixed to off.

1

–

–

–

Undefined. Fixed to off.

1

Off On

00 02

0 2

Cover closed. Cover open.

2

Off

00

0

User data storage write successful

2

Off On

00 04

0 4

Paper present. Paper exhausted.

On

04

4

3

–

–

–

Undefined.

User data storage write failed, specified area not erased.

4

Off

00

0

Not used. Fixed to off.

Off

00

0

Flash logo area adequate, definition stored

5

–

–

–

Undefined.

On

08

8

Flash logo area not adequate

6

–

–

–

Undefined. 4

Off

00

0

Not used. Fixed to off.

5

Off

00

00

No thermal user-defined characters written to flash.

On

20

32

Thermal user-defined characters written to flash.

6

Off

00

0

Not used. Fixed to off.

7

–

–

–

Undefined.

7

Off

00

0

3

Not used. Fixed to off.

Cash drawer status (n = 2 or n = 50) Bit Off/On status

Hex Decimal Status for transmit

0

Off

00

0

On

01

1

Off

00

0

On

02

2

One or both cash drawers open. Both cash drawers closed.

2

–

–

–

Undefined

3

–

–

–

Undefined

4

Off

00

0

Not used. Fixed to off.

5

–

–

–

Undefined.

6

–

–

–

Undefined.

7

Off

00

0

Not used. Fixed to off.

1

One or both cash drawers open. Both cash drawers closed.

Exceptions

When n is out of the specified range, the command is ignored.

Page 90

90

A795 User Guide: Programming Supplement

Revision E May 2005

Chapter 4: Programming commands

Send printer software version ASCII AX V Hexadecimal 1F 56 Decimal 31 86

The printer returns 8 bytes containing the boot and flash software version. The first 4 bytes returned are an ASCII string for the boot version.

The second 4 bytes are an ASCII string for the flash version. Example: For 1.234.56 (8 bytes), the boot version is 1.23 and the flash version is 4.56.

Real time commands The real time commands provide an application interface to the printer even when the printer is not handling other commands (RS-232C communication interface only): • 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 • Real time printer status transmission The batch mode printer status commands are placed in the printer’s data buffer as they are received and handled by the firmware in the order in which they were received. If the paper exhausts while printing data that was in the buffer ahead of the status command, the printer goes busy at the RS-232C interface and suspends processing the data in the buffer until paper is reloaded. This is true for all error conditions: knife home error, thermal printhead overheat, etc. In addition, there is no way to restart the printer after a paper jam or other error, when using batch mode status commands. The real time commands are implemented in two ways in order to overcome the limitations of batch mode status commands. Both implementations offer the same functionality; which one you choose depends on the current usage of your application.

Preferred implementation

Alternate implementation

For a new application the GS (1D) sequences are recommended to avoid possible misinterpretation of a DLE (0x10) sequence as a clear printer (0x10 0, ASCII DLE NUL) command.

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.

An application using these GS (1D) sequences, does not need to distinguish for the printer between the new real time commands and the clear printer command. This implementation is ideal for an existing A756 application that already uses the clear printer command or for a new application being developed.

An application using these DLE (0x10) sequences must also send the second byte of the sequence within 100 milliseconds of the first, to prevent the first byte being mistaken for a clear printer command.