zpl.tools
CommandsNetwork

~HS - Host Status Return

Returns comprehensive printer status information to host

~HS - Host Status Return

Overview

The ~HS command returns comprehensive printer status information in three formatted data strings. Provides real-time status of communication settings, paper condition, buffer status, errors, and temperature for printer monitoring and management.

Syntax

~

Parameters

None

Description

  • Returns three data strings with status info
  • Each string enclosed in STX/ETX markers
  • Includes paper, buffer, temperature status
  • Communication and diagnostic information
  • Processed immediately

Return Format

String 1:

<STX>aaa,b,c,dddd,eee,f,g,h,iii,j,k,l<ETX><CR><LF>

String 1 Fields

FieldMeaningRange
aaaCommunication settings (decimal)000-999
bPaper out flag0=OK, 1=Out
cPause flag0=Running, 1=Paused
ddddLabel length in dots0-9999
eeeFormats in buffer000-999
fBuffer full0=OK, 1=Full
gDiagnostics mode0=Off, 1=On
hPartial format0=No, 1=Yes
iiiReserved000
jCorrupt RAM0=OK, 1=Bad
kUnder temperature0=OK, 1=Under
lOver temperature0=OK, 1=Over

Communication Settings Decoding

The aaa field is binary-encoded decimal:

  • Baud rate
  • Data bits
  • Parity
  • Stop bits
  • Handshaking

Convert to binary for detailed decoding.

Examples

Request Status

~

Returns:

<STX>125,0,0,0812,0003,0,0,0,000,0,0,0<ETX><CR><LF>

Interpretation:

  • Communication: 125 (detailed settings)
  • Paper: OK
  • Pause: Running
  • Label length: 812 dots (4 inches)
  • Formats queued: 3
  • Buffer: Not full
  • Diagnostics: Off
  • Partial format: None
  • RAM: OK
  • Temperature: Normal (both OK)

Error Condition

~HS

Returns:

<STX>125,1,0,0812,0000,0,0,0,000,0,0,0<ETX><CR><LF>

Shows paper out condition (b=1).

Status Flags

Paper Status (b)

  • 0 = Paper OK
  • 1 = Paper Out

Pause Status (c)

  • 0 = Running/Ready
  • 1 = Paused

Buffer Status (f)

  • 0 = Space available
  • 1 = Buffer full

Memory Status (j)

  • 0 = RAM OK
  • 1 = Configuration lost/corrupted

Temperature Status

  • k = Under temperature (abnormally cold)
  • l = Over temperature (abnormally hot)

Usage Scenarios

Monitor Printer State

Send: ~HS
Check: Paper status, buffer status, errors
Action: Respond to paper out, pause conditions

Error Detection

1. Request ~HS
2. Check j (RAM), k (temp), l (temp) flags
3. Detect and log errors
4. Alert if corruption detected

Queue Management

~
  • ~HI - Host Identification
  • ^HV - Host Verification
  • ~WC - Print Configuration Label

See Also