beautypg.com

Querying the printer, Overview, Sending queries – Datamax-O'Neil microFlash 2te Quick Reference Programming Guide User Manual

Page 45: Interpreting query replies, Query formats

background image

41

Querying the
Printer

Overview

The printer can return a lot of information to the host. It can give some status of its current

state as well as the current configuration. This is all done through a series of query

commands that can be issued to the printer. Not all queries are available in all printers, and

some queries are available in later versions of printer firmware; however, all queries are of

the same form and contain 6 bytes (0x1b, "{" or 0x7b, TWO LETTER QUERY, "?" or 0x3f, and

"}" or 0x7d):

ESC {?}

Sending Queries

Queries can be sent to the printer using the infrared link or the RS-232 data link. The

printer's reply to a query returns information about the printer or the print request.

Interpreting Query Replies

Replies to queries are enclosed in left ({) and right (}) brackets. The unique two-letter query

command is returned followed by an exclamation mark (!) and data. Data is returned as a list

of parameters. Each parameter contains identifiers, followed by a colon (:), followed by the

data. Each parameter is separated from the next by a semicolon (;). For download queries

such as the Fonts query and the Graphics query, information for each download contains a

series of parameters, each of those parameters/data sets are separated by a comma (,) and
each download is separated by a semicolon (;).

Query Formats

All queries are based on the above format. For information on specific queries, see “Query

Commands” on page 42

.

Tip: The order in which the query replies are returned changes. When interpreting

query replies, search a specific query character within the query reply. The tables on

the following pages document query commands and the query-specific replies. Use

the tables on the following pages as a guideline when entering and interpreting

queries.

Query Format:

ESC {Query?}

Reply Format:

{Query!Query1:Reply1;...QueryN:ReplyN}

Function:

The word Query in the query format specified above is

replaced by a specific command. For example, {BT?} is

a query designed to return information about the

printer's battery.

This manual is related to the following products: