HP PCL/PJL reference - Printer Job Language Technical Reference Manual
11-24 Programming Tips for Using PJL EN
To keep the I/O interface from timing out, the application can either
send data to the printer more frequently than the timeout setting or
can cause the printer to use a different setting by sending a PJL JOB
command. When I/O-switching printers receive the PJL JOB
command, the printer uses an I/O timeout value equal to ten times the
TIMEOUT environment variable setting or five minutes, whichever is
greater. (If the application sends the PJL JOB command, the
application should send a PJL EOJ command at the end of the job.)
Old Printer Status Readback Responses
Applications need to be designed to handle receiving printer status
readback responses that were generated because of an action
performed by a different application. For example, a word processing
application may send a query to the printer, but because the user
turned off the host computer, the application never got a chance to
retrieve the response from the printer before the host computer was
turned off. When another application, or even the same application at
a later time, queries the printer, the first response is the response to
the word processing application's query.
The currently executing application should accept old printer status
readback responses and discard them until the expected response is
received. Applications should include unique information as part of
the ECHO command, such as the current time and date and a
random number, so that the application can resynchronize with printer
status readback responses.
There is also a chance the PJL ECHO response will never by sent by
the printer, due to overflowing of the printer's response data buffer as
discussed in the following section.
Response Data Buffer Overflow
The printer contains a limited amount of memory. It is possible for an
application to fill all available printer memory with printer status
readback responses that have not yet been sent to the host computer,
simply by sending many queries and never accepting the responses
from the printer. Also, if an application enables unsolicited status and
never accepts responses, the printer's response data buffer can
overflow. The printer limits the amount of memory allotted to hold
responses, and when that memory is full (and the host has not
recently accepted any responses), the printer discards all future
responses until the host accepts the currently queued responses in
the printer.