HP PCL/PJL reference - Printer Job Language Technical Reference Manual

EN Programming Tips for Using PJL 11-21
Printer Status Readback Usage
Applications use printer status readback for two primary purposes
(although there are other uses): printer driver configuration and
monitoring device status. Since printer configuration does not change
often (i.e., the amount of installed printer memory does not change
frequently) using printer status readback to assist in initial
configuration (or when the printer's configuration changes) is
straightforward. If the application determines printer status readback
is unavailable (discussed in the “Determining If Printer Status
Readback is Available” section), the application can ask the user for
the information instead of querying the printer.
The other primary use for printer status readback is to allow
applications to monitor the state of the printer. In particular,
applications can inform the user when the printer requires
intervention (e.g. fill paper trays). If the application enables unsolicited
PJL device status, the printer will inform the application whenever the
printer's status changes. Since the printer informs the application
using unsolicited status, even when the printer is processing a print
job from a different I/O interface, the application gets timely printer
status information. If printer status readback is unavailable, the
application will not be able to provide the user with current printer
state information.
Another use for printer status readback is to determine what volatile
resources (e.g. soft fonts) are available in the printer right before a
print job is sent to the printer. If an application optimizes the printer
job using printer status readback (i.e., does not send soft fonts if the
printer already has the font), then if printer status readback is
unavailable, the application should assume worst case (i.e., the font is
not in the printer) when generating print jobs.
In summary, the application should be designed to take advantage of
printer status readback, if available, but still function if it is unavailable.
Determining If Printer Status Readback is Available
If the application sends a PJL ECHO command (preceded by the
Universal Exit Language command, of course) to the printer and
receives the expected response, then the application can assume
bi-directional communication with the printer is available and
supported solicited status queries will be answered in a timely
fashion.