The text of a manual · part 7 of 10
O'Neil Programming Language Reference Manual: Querying the Printer, pages 42 to 50
Pages 42 to 50 of 69, from O'Neil Programming Language Reference Manual
The original document is the PDF (2.1 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 O'Neil MicroFLASH 4T (MF4T) and Datamax MicroFLASH 4T (MF4T)
Page 42
Querying the Printer
4
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 {<TWO LETTER QUERY>?}
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 (;). 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 Formats 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.
All queries are based on the above format. For information on specific queries, see Query Commands on page 42.
O’Neil Programming Language Reference Manual
41
Page 43
Chapter 4: Querying the Printer
Query Commands Command
Format
Description
Status
ESC{ST?}
Returns information about the ability of the printer to print the next image and reports any errors from the last print request (for example, paper condition, command errors, buffer size and battery voltage).
43
Print Job Status
ESC{Sn?}
Verifies that the data delivered to the printer was printed without any mechanical errors such as a head jam or an out of paper condition.
45
Configuration
ESC{CF?}
Returns information about configuration options such as baud rate, default mode, and timeout.
47
Battery
ESC{BT?}
Returns current battery voltage, temperature, and condition.
49
Version
ESC{VR?}
Returns version number for firmware, boot code, and download files.
49
Memory
ESC{MY?}
Returns the amount of memory available, the amount of memory used, and the amount remaining.
50
Printhead
ESC{PH?}
Returns the type of printhead used and the number of dots across.
51
Infrared
ESC{IR?}
Returns infrared settings.
52
Font
ESC{FN?}
Returns a list of available fonts.
55
Graphics
ESC{GR?}
Returns a list of downloaded graphics.
56
Formats
ESC{FM?}
Returns a list of all formats.
57
802.11b/TCP/ IP
ESC{TC?}
Returns the current TCP/IP and 802.11b configuration (if applicable).
57
Bluetooth
ESC{BL?}
Returns the current Bluetooth configuration (if applicable).
59
Magnetic Card Configuration
ESC{MC?}
Returns the magnetic card configuration.
61
Magnetic Card Read
ESC{MR?}
Returns the magnetic card reader configuration.
62
Card Reader Status
ESC{RS?}
Returns data read for a swiped magnetic card.
63
Demand
ESC{DQ?}
Returns the remaining number of images.
65
Cancel
ESC{CN!}
Cancels all demand printing.
65
Reset
ESC{RE!}
Resets the printer.
65
Magnetic Card Data Zero
ESC{MR?}
Flashes the magnetic card data buffer to zero.
65
O’Neil Programming Language Reference Manual
Page
42
Page 44
Chapter 4: Querying the Printer
Status Query Status Query Query Format
ESC{ST?}
Reply Format
{ST!E:x;S:x;L:x;P:x;J:x;R:x;B:x;H:x}
Function
Returns information about the ability of the printer to print the next image and reports any errors from the last print request (for example, paper condition, command errors, buffer size and battery voltage). Note: If Job Status reporting is on, the printer automatically generates the Status query reply and sends it to the host.
Reply Example
{ST!E:N;S:I;L:D;P:P;J:N;R:62;B:O,H:O}
Reply Example Explanation
ST! - Reply to a status query. E:N; - There are no errors. S:I; - The printer is idle. L:D; - The paper release lever is down, ready to print. P:P; - Paper is present. J:N; - There is no head jam. R:62; - 62K bytes remain in the input buffer. B:O; - Acceptable battery voltage and temperature. H:O; - Printhead temperature in acceptable range.
Status Reply Explanation Query
Reply
Definition
E
N
N = No error*. For radio ready 2t/3l/4t printers, fixed as “N.”
E c c = Command error/invalid command
E d d= Data error (for example, an alpha character in a numericonly bar code)
E f f = Font not available
E g g = Global parameter error
E o o = Overrun buffer*
E p p = Field parameter error
E q q = Qmark not found*
E r r = Row/column error
E s s = Syntax error
S
C
C = Complete
S
I
I = Idle
S
K
K = Key pressed to cancel print job (available in Job Status only)
O’Neil Programming Language Reference Manual
43
Page 45
Chapter 4: Querying the Printer
S
O
O = Printer was off during print out (available in Job Status only)
S
P
P = Printing
S
T
T = Timeout (available in Job Status only)
L u,d
Lever = Up or Down
P
P,N
Paper = Present or Not present
J
J,N
Head jam condition: N = No head jam; J = A head jam has occurred and has not been cleared (press the feed button to clear the head jam).
R nm
RAM buffer size remaining (in K bytes). An empty input buffer is 40K bytes.
B
O,T,V
Battery condition: O = OK; T = out of temperature range; V = out of voltage range. For radio ready 2t/3l/4t printers, O/ V Only are available
H
O,T
Printhead temperature: O = OK; T = out of temperature range
* Rows marked with an asterisk (*) indicate Easy Print and Line Printer modes. Rows without an asterisk indicate Easy Print mode only.
O’Neil Programming Language Reference Manual
44
Page 46
Chapter 4: Querying the Printer
Print Job Status Query Print Job Status Query Query Format
ESC{Sn?}
Reply Format
{ST!E:x;N:x;S:x;L:x;P:x;J:x;R:x;B:x}
Function
Verifies data delivered to the printer was printed without any mechanical errors such as a head jam or an out of paper condition. n indicates the level of error reporting. The end of the print job is indicated by the Esc e command. n is defined as follows: bit 0 =Determines auto report status at the end of the job (when last line/form feed before ESC e is complete). bit 1 = Determines status if paper was out during printing. bit 2 = Determines status if there was a printhead jam during printing. bit 3 = Determines status when paper is loaded after a paper out condition and the red button is pressed during printing. bit 4 = Determines if printer times out during printing. bit 5 = Determines if forward/reverse buttons were pressed during printing. bit 6 = Cancels timeout. Printer always stays on (timeout set to 9999) but does not write to Flash. bit 7 = Reserved. Note 1: If all zeroes are specified for n, any active status messages set by an ESC s n command without an ESC e command are cancelled. Note 2: Cancelled timeouts are not written to Flash; therefore, the timeout returns to defaults if the printer is off or if the power is disconnected. Note 3: Timeouts can also be cancelled using the ESC t command. ESC s 0 or ESC e will not reinstate a timeout cancelled using the ESC t command.
Reply Example
{ST!E:N;S:I;L:D;P:P;J:N;R:40;B:O}
Reply Example Explanation
ST! - Reply to a print job status query. E:N; - There are no syntax/language errors. S:I; - The printer is idle. L:D; - The paper release lever is down, ready to print. P:P; - Paper is present. J:N; - There is no head jam. R:62; - 62K bytes remain in the input buffer. B:O; - Acceptable battery voltage and temperature.
O’Neil Programming Language Reference Manual
45
Page 47
Chapter 4: Querying the Printer
Print Job Status Reply Explanation Query
Reply
Definition
E
N
N = No error*
E c c = Command error/invalid command
E d d= Data error (for example, an alpha character in a numericonly bar code)
E f f = Font not available
E g g = Global parameter error
E o o = Overrun buffer*
E p p = Field parameter error
E q q = Qmark not found*
E r r = Row/column error
E s s = Syntax error
S
C c = Complete
S
I
I = Idle
S
K
K = Key pressed to cancel print job (available in Job Status only)
S
O
O = Printer was off during print out (available in Job Status only)
S
P
P = Printing
S
T
T = Timeout (available in Job Status only)
L u,d
Lever = Up or Down
P
P,N
Paper = Present or Not present
J
J,N
Head jam condition: N = No head jam; J = A head jam has occurred and has not been cleared (press the feed button to clear the head jam).
R nm
RAM buffer size remaining (in K bytes). An empty input buffer is 40K bytes.
B
O,T,V
Battery condition: O = OK; T = out of temperature range; V = out of voltage range
* Rows marked with an asterisk (*) indicate Easy Print and Line Printer modes. Rows without an asterisk indicate Easy Print mode only.
O’Neil Programming Language Reference Manual
46
Page 48
Chapter 4: Querying the Printer
Configuration Query Configuration Query Query Format
ESC{CF?}
Reply Format
{CF!L:x; B:x; P:x; N:x; H:x;D:x;Y:x;S:x;M:x;T:x;R:x}
Function
Displays configurable options. Available for all printers except as noted.
Reply Example
{CF!L:LP;B:096;P:N;N:8;H:B;D:+10%;Y:1;S:Y;M:Y;T:0060 ;R:65535}
Reply Example Explanation
CF! - Reply to a configuration query. L:LP; - The default mode is Line Printer. B:096; - The baud rate is 9600. P: N; - No parity is set. N:8; - There are 8 data bits. H:B; - Hardware and software handshaking are enabled. D:+10%; - The darkness (burn time) is set to +10%. Y:1; - The paper is 1 ply. S:Y; - The sound is on. M:Y; - The printhead centers during form feed. T:0060 - The timeout is set for 60 seconds. R:65535; - The printer never time outs.
O’Neil Programming Language Reference Manual
47
Page 49
Chapter 4: Querying the Printer
Configuration Reply Explanation Query
Reply
Definition
A
Y,N
Auto White Space Advance
L
LP, EZ
Default mode = Line Printer (ESC) or Easy Print (EZ), The following are available for radio ready 2t/3l/4t printers: EMC1 (Custom 1), EMC2 (Custom 2), EMC3 (Custom 3), EMP1 (PGL), EMZ1 (CP CL), EMZ2 (Cog),EMZ3 (ZPL).
B
012 (mf2/3), 024,048 (mf2/3), 096,192 (mf2/3), 384,576,115
Baud rate = 1200,2400, 4800, 9600, 19.2K, 38.4K, 57.6K, 115.2 k baud
P
N,E,O
Parity = None, Even, or Odd
N
7,8
Number of data bits = seven or eight
H
N,H,S,B
Handshaking = None(N), Hardware (H), Software (S), or Both Software and Hardware (B)
J
Y/N
EZ Print Job Status Report. Yes (Y) or No (No).
D
-25% ...+35%
Darkness = -25%, -20%, -15%, -10%, -05%, +10%, +15%, +20%, +25%, or +35%
F
Y/N
Form feed (act on FF) only available on radio ready 2t/3l/4t printers. Yes (Y) or No (N).
G
Y/N
Beep when charger connected. Yes (Y) or No (N).
Y
1,2
Paper ply = one or two
S
Y,N
Beeper sound = Y (beeper on) or N (beeper off)
M
Y,N
Centering of printhead on form feed: Y = Printhead centers during form feeding; N = Printhead remains where it last stopped during form feed.
T nnnn
Timeout value in seconds (9999 indicates printer never time outs)
R nn/NEVER
RF Power Timeout (only available on radio ready 2t/3l/4t printers). nn (minutes) or NEVER timeout.
U
0 to 4
Paper out beep (only available on radio ready 2t/3l/4t printers). 0=1 beep (not 0=5 beeps);1=one time; 2=rep every 15s;3=rep every 30s;4=rep every 60s.
TP
0/not 0
Test print. 0=Normal;Not 0 -Special.
O’Neil Programming Language Reference Manual
48
Page 50
Chapter 4: Querying the Printer
Battery Query Battery Query
Original MF2/MF3/ 2t/4t
Radio Ready 2t/3l/4t
Query Format
ESC{BT?}
Reply Format
{BT!V:x;T:x;CH:x}
Function
Returns current battery voltage and temperature.
Reply Example
{BT!V:6.8;T:+25.8C,CH:C, PS:B}
Reply Parameters
V:Voltage of single - n.n volts
X
X
V1 and V2: Voltage of each of two batteries- n.n volts (for V1); n.n volts (for V2)
X
X
VE: Voltage of battery eliminator - n.n volts
4t Only
4t Only nn.nC
Always returns NA
X
X
X
X (A/B are same in Thermal)
T: Temperature of battery (depends on battery type). CH:Charge - Y=Connected; N=Not connected. PS: Power Source - A=DC over battery;B=Battery over DC; C=Battery eliminator
Version Query Version Query Query Format
ESC{VR?}
Reply Format
{VR!F:x;B:x;D:x}
Function
Returns the version levels of firmware, boot code, and download file number.
Reply Example
{VR!F:4.09;C:5.25;B:2.05;D:1.0}
Reply Example Explanation
VR! - Reply to a version query. F:4:09; - The firmware (main program) version is 4.09. C:5.25; - The communication controller version is 5.25. B:2.05; - The boot code version is 2.05. D:1.0; - The download file version is 1.0.
O’Neil Programming Language Reference Manual
49