~HQ
~HQ

~HQ

The
~HQ
command group causes the printer to send information back to the host.

Host Query

Format:
~HQquery-type
Parameter
Details
query-type
For detailed examples of these parameters, see ~HQ Examples.
Values:
  • ES =
    requests the printer’s status - see Table 1 and Table 2
  • HA =
    hardware address of the internal wired print server
  • JT =
    requests a summary of the printer’s printhead test results
  • MA =
    maintenance alert settings
  • MI =
    maintenance information
  • OD =
    odometer
  • PH =
    printhead life history
  • PP =
    printer’s Plug and Play string
  • SN =
    printer’s serial number
  • UI =
    USB product ID and BDC release version
Default:
must be an accepted value or the command is ignored
Comments:
The response to the
~HQ
command starts with STX, a CR LF is inserted between each line, and the response ends with ETX.
Error Flags (~HQES)
Error Flags
Flag
Group 2
Group 1     (X = Value can be any hexadecimal number [0-9, A-F])
Nibbles 16-9
Nibble 8
Nibble 7
Nibble 6
Nibble 5
Nibble 4
Nibble 3
Nibble 2
Nibble 1
No Error
0
00000000
0
0
0
0
0
0
0
0
Error Present
1
00000000
X
X
X
X
X
X
X
X
Printhead Thermistor Open
1
00000000
X
X
X
X
X
2
X
X
Invalid Firmware Config.
1
00000000
X
X
X
X
X
1
X
X
Printhead Detection Error
1
00000000
X
X
X
X
X
X
8
X
Bad Printhead Element
1
00000000
X
X
X
X
X
X
4
X
Motor Over Temperature
1
00000000
X
X
X
X
X
X
2
X
Printhead Over Temperature
1
00000000
X
X
X
X
X
X
1
X
Cutter Fault
1
00000000
X
X
X
X
X
X
X
8
Head Open
1
00000000
X
X
X
X
X
X
X
4
Ribbon Out
1
00000000
X
X
X
X
X
X
X
2
Media Out
1
00000000
X
X
X
X
X
X
X
1
Clear Paper Path Failed
1
1
00000000
X
X
X
X
8
X
X
X
Paper Feed Error
1
1
00000000
X
X
X
X
4
X
X
X
Presenter Not Running
1
1
00000000
X
X
X
X
2
X
X
X
Paper Jam during Retract
1
1
00000000
X
X
X
X
1
X
X
X
Black Mark not Found
1
1
00000000
X
X
X
8
X
X
X
X
Black Mark Calibrate Error
1
1
00000000
X
X
X
4
X
X
X
X
Retract Function timed out
1
1
00000000
X
X
X
2
X
X
X
X
Paused
1
00000000
X
X
X
1
X
X
X
X
1. This error flag is supported only on KR403 printers.
Warning Flags (~HQES)
Error Flags
Flag
Group 2
Group 1     (X = Value can be any hexadecimal number [0-9, A-F])
Nibbles 16-9
Nibble 8
Nibble 7
Nibble 6
Nibble 5
Nibble 4
Nibble 3
Nibble 2
Nibble  1
No Warning
0
00000000
0
0
0
0
0
0
0
0
Warning Present
1
00000000
X
X
X
X
X
X
X
X
Paper-near-end Sensor
1
1
00000000
X
X
X
X
X
X
X
8
Replace Printhead
1
00000000
X
X
X
X
X
X
X
4
Clean Printhead
1
00000000
X
X
X
X
X
X
X
2
Need to Calibrate Media
1
00000000
X
X
X
X
X
X
X
1
Sensor 1 (Paper before head)
1
1
00000000
X
X
X
X
X
X
1
X
Sensor 2 (Black mark)
1
1
00000000
X
X
X
X
X
X
2
X
Sensor 3 (Paper after head)
1
1
00000000
X
X
X
X
X
X
4
X
Sensor 4 (loop ready)
1
1
00000000
X
X
X
X
X
X
8
X
Sensor 5 (presenter)
1
1
00000000
X
X
X
X
X
1
X
X
Sensor 6 (retract ready)
1
1
00000000
X
X
X
X
X
2
X
X
Sensor 7 (in retract)
1
1
00000000
X
X
X
X
X
4
X
X
Sensor 8 (at bin)
1
1
00000000
X
X
X
X
X
8
X
X
1. This error flag is supported only on KR403 printers.

~HQ Examples

This section provides detail examples of all the available parameters.
Example:
This example shows how to request the printer’s status.
To request the printer’s status, type
~HQES
The printer responds with data similar to this:
PRINTER STATUS ERRORS: 1 00000000 00000005 WARNINGS: 1 00000000 00000002
In this example, the Printer Status resolves to these conditions:
  • The cover/printhead is open (value = 4).
  • Media is out or not loaded into the printer (value = 1).
  • The printhead needs to be cleaned (value = 2).
  • Error nibble 1 is equal to 5 when the error status values are added together (4 + 1).
This illustration identifies the printer status definitions:
1
Flag
2
Nibble 16-9
3
Nibble 8-4
4
Nibble 3
5
Nibble 2
6
Nibble 1
Example:
This example shows how the printer responds when the printer receives the
~HQES
command:
To see how the printer responds, type
~HQES
The printer responds with data similar to this:
PRINTER STATUS ERRORS: 1 00000000 0000000B WARNINGS: 0 00000000 00000000
In this example, the printer status resolves to the following conditions:
  • The cutter has a fault (value =
    8
    ).
  • Ribbon is out or not loaded into the printer (value =
    2
    ).
  • Media is out or not loaded into the printer (value =
    1
    ).
  • Error byte 1 is equal to
    B
    when the error status values are added together  (
    8 + 2 + 1 = hexadecimal B
    ).
Example:
This is an example of how to retrieve the hardware address of the internal wired print server.
To get the hardware address of the internal wired print server, type
~HQHA
The printer responds with data similar to this:
MAC ADDRESS 00:07:4d:2c:e0:7a
Example:
This is an example of how to request a summary of the printer’s printhead test results.
The
^JT
command is used to initiate printhead testing, set the testing interval, and set the element range to be tested. For more details see,^JT.
To request a summary of the printer’s printhead test, type
~HQJT
The printer responds with data similar to this:
PRINT HEAD TEST RESULTS 0,A,0000,0000,0000
When the printer has printed enough labels to trigger a printhead test, the initial data changes.
To request a summary of the printer’s printhead test, type
~HQJT
The printer responds with data similar to this:
PRINT HEAD TEST RESULTS: 0,A,0015,0367,0000
This illustration identifies the printhead test field definitions:
1
Element failure
2
Manual (M) or automatic (A) range
3
First test element
4
Last test element
5
Failure count
Example:
This is an example of how to use the maintenance alert query for the
~HQ
command.
To get the current settings, type
~HQMA
The printer responds with data similar to this:
~HQMA MAINTENANCE ALERT SETTINGS HEAD REPLACEMENT INTERVAL: 1 km HEAD REPLACEMENT FREQUENCY: 0 M HEAD CLEANING INTERVAL: 0 M HEAD CLEANING FREQUENCY: 0 M PRINT REPLACEMENT ALERT: NO PRINT CLEANING ALERT: NO UNITS: C
Example:
This is an example of how to use the maintenance information query for the
~HQ
command.
Note that the message is controlled by the
^MI
command.
To get the current settings, type
~HQMI
The printer responds with data similar to this:
MAINTENANCE ALERT MESSAGES CLEAN: PLEASE CLEAN PRINT HEAD REPLACE: PLEASE REPLACE PRINT HEAD
Example:
This is an example of how to use the odometer query for the
~HQ
command.
Note that the units of measure are controlled by the
^MA
command. Also, if the "Early Warning Maintenance State" is turned "ON" the printer response would also list LAST CLEANED and CURRENT PRINTHEAD LIFE counters.
To get the current settings, type
~HQOD
The printer responds with data similar to this:
PRINT METERS TOTAL NONRESETTABLE: 8560 " USER RESETTABLE CNTR1: 9 " USER RESETTABLE CNTR2: 8560 "
The units of measure are set to inches.
To change the units of measure to centimeters, type:
^XA^MA,,,,C ^XZ
The units of measure are set to centimeters.
a. To check the settings, type
~HQOD
The printer responds with data similar to this:
PRINT METERS TOTAL NONRESETTABLE: 21744 cm USER RESETTABLE CNTR1: 24 cm USER RESETTABLE CNTR2: 21744 cm
Example:
This is an example of how to use the printhead life query for the
~HQ
command.
Note that the units of measure are controlled by the
^MA
command.
To get the current settings, type
~HQPH
The printer responds with data similar to this:
LAST CLEANED: 257 " HEAD LIFE HISTORY # DISTANCE 1: 257 " 2: 1489 " 3: 7070 "
line 1
The current life of the print head.
lines 2–10
Tracks the measurement for each time the print head is changed. (The example only shows lines 2 and 3.)
Example:
This is an example of how to request the printer’s Plug and Play string.
To request the printer’s Plug and Play string, type
~HQPP
The printer responds with data similar to this:
PLUG AND PLAY MESSAGES MFG: Zebra Technologies CMD: ZPL MDL: GX420t
Example:
This is an example of how to retrieve the printer’s serial number.
To get the printer’s serial number, type
~HQSN
The printer responds with data similar to this:
SERIAL NUMBER 41A06440023
Example:
This is an example of how to retrieve the printer’s USB product ID and BCD release version.
To get the printer’s USB product ID and BCD release version, type
~HQUI
The printer responds with data similar to this:
USB INFORMATION PID: 0085 RELEASE VERSION: 15.01