UPD Mail Archive: Re: UPD> completeness: Printer error/statu

Re: UPD> completeness: Printer error/status monitoring (Responses framework)

From: Jim Lo (Jim.Lo@eng.sun.com)
Date: Mon Dec 04 2000 - 17:32:23 EST

  • Next message: Hastings, Tom N: "UPD> PWG media size name mini-project"

    Hi,

    Another missing part in a printer description file format (including GPD) may be in the area of
    printer error/status messages monitoring. It is considered especially important for many new printers
    that support bi-directional USB (as opposed to traditional one-directional centronic parallel connection
    that depends on hardware signals for monitoring).

    For your reference, included is a document in an attempt to address this issue
    (its HTML version is also attached).

    I am not terribly familiar with this area which I consider tough because what we are trying to
    deal with is kind of drawing road maps (printer description files) by a simple tooling methord
    (the Responses framework) for many existing roads (printer languages) with not necessarily
    very regular shapes. The printer type that had been addressed in the document is PostScript.
    I also used a EPSON printer as my target try out in the document not only
    because I think it is rich and should be quite typical but also that there are simply no
    programming manuals available in public for many NEW printers. Anyone who like to give the
    framework a try with another printer or extend the framework if necessary would be
    helpful to move towards the design goal.

    Best regards

    Jim Lo
    Internet Appliance Group
    Sun Microsystems, Inc.

    PS. As you can see, the document is encoded for a demonstration purpose
        in terms of XPDO objects specified in my previous email.
    .....

    It would be nice to have a GUI on a host machine to monitor a target printer for its possible error conditions and
    working status changes especially when there is no LCD panel on the printer.
    It is especially important for printers supporting bi-directional I/O connectivity such as USB (Universal Serial
    Bus).
    Those printers usually provide a much richer set of device-dependent proprietary notification and enquiry messages
    compared to a hardware based interface for the traditional one-directional centronics parallel connection
    which provides a much limited set of less clearer error/status messages.

    This document provides a device independent way to describe device-dependent message formats
    so that most printer vendors can benefit from a common printer-decription-file-driven GUI services
    in a consistent way without having to write any line of C code for their device dependent messages.

    The Responses tag and all its predefined nested element tags
    are introduced to enable dynamic configuration,
    error, warning and progress enquiry and responses. They are all described in a unified format
    which is demonstrated by the following two examples for PostScript printers and
    EPSON inkjet printers respectively:

    <!-- -----Example 1: PostScript -->
    <Responses>
       <Status> <!-- solicited message -->
          <CmdEnableResponses str="{14}"/> <!-- PS: Ctrl-T to enable it for only once
          <!-- There is no CmdDisableResponses since it will be automatically disabled
               after being enabled and performance (i.e., only once) -->
          <ReplyFormat>
             <Prefix str="%%[ "/>
             <Postfix str=" ]%%"/>
             <Parameters>
                <State>
                   <Keyword str="status:"/>
                   <Separator str=";"/> <!-- optional; for multiple keywords separated in a list -->
                   <Init str="Initializing"/> <!-- During startup -->
                   <Wait str="Waiting"/> <!-- I/O wait while printing -->
                   <Idle str="Idle"/> <!-- No job in progress -->
                   <Busy str="Busy"/> <!-- While printing -->
                   <Error str="PrinterError"/> <!-- cf. the Error section below -->
                </State>
                <!-- custom parameters, if any... -->
             </Parameters>
          </ReplyFormat>
       </Status>

       <Error>
          <!-- Optional: The Fatal occurs when a fatal error is detected by the target printer -->
          <Fatal> <!-- A fatal error must be enclosed by the prefix and postfix strings, if available -->
              <Prefix str="%%[ Error: "/>
              <Postfix str=" ]%%"/>
          </Fatal>

          <!-- The Intervention occurs when a print job is started and the target printer has posted
               an error requiring intervention; when the problem is corrected,
               the print job is continued -->
          <Intervention>
             <!-- CmdEnableResponses and CmdDisableResponses are missing for unsolicited messages -->
             <ReplyFormat>
                <Prefix str="%%[ PrinterError: "/>
                <Postfix str=" ]%%"/>
                <Parameters>
                   <!-- Predefined -->
                   <PaperOut str="Paper Out"/> <!-- The starting Keyword substring for Paper Out -->
                   <PaperJam str="Paper Jam"/> <!-- The starting Keyword substring for Paper Jam -->

                   <!-- Custom -->
                   <entry str="InkOut">
                      <Keyword str="Toner Low"/>
                      <Name str="Toner Low"/> <!-- optional: to override the default display name -->
                   </entry> <!-- InkOut -->

                   <!-- Anything undefined in between the Prefix and the Postfix will be
                        displayed without localization -->
                </Parameters>
             </ReplyFormat>
          </Intervention>
       </Error>
    </Responses>

    <!-- -----Example 2: Non-PostScript EPSON low-cost printer -->
    <Responses>
       <Status>
          <CmdEnableResponses str="ST{020000}{01}"/>
              <!-- EPSON: Enables the Printer Status Reply periodically (every
                          few second) or when the printer status changes -->
          <CmdDisableResponses str="ST{020000}{00}"/>

          <ReplyFormat>
             <Prefix str="@BDC{20}ST{0D0A}"/>
             <Postfix str="{FF}"/>
             <Separator str=";"/> <!-- optional; for multiple parameters separated in a list -->
             <Parameters>
                <State>
                   <Keyword str="ST:"/>

                   <!-- predefined states -->
                   <Init> <!-- During startup -->
                      <Code str="{01}">
                      <Name str="State: Self Testing"/>
                         <!-- Optional; to override the default display string -->
                   </Init>
                   <Wait str="{03}"/> <!-- I/O wait while printing -->
                   <Idle str="{04}"/> <!-- No job in progress -->
                   <Busy str="{02}"/> <!-- While printing -->
                   <Error str="{00}"/> <!-- cf. the Error section below -->

                   <!-- Custom state -->
                   <entry name="CleaningTime">
                      <Name str="State: Cleaning or charging"/> <!-- required for a custom entry -->
                      <Code str="{07}"/>
                      <!-- cf. the CleaningTimeParameter below for its parameter
                           according to a naming convention: "CleaningTime" + "Parameter" -->
                   </entry> <!-- CleaningTime -->
                </State>

                <!-- Custom parameter: for the custom state CleaningTime
                     according to a naming convention: "CleaningTime" + "Parameter" -->
                <entry name="CleaningTimeParameter">
                   <Keyword str="TC:"/>
                   <Name str="Total Elapsed Time"/> <!-- required for a custom entry -->
                   <!-- If /Code is missing, all bytes in between the Keyword and the
                        Separator (or Postfix) will be used as the Code value
                        (In this particular case, there are four bytes ASCII codes that
                        indicate total time of cleaning in second unit) -->
                </entry> <!-- CleaningTimeParameter -->
             </Parameters>
          </ReplyFormat>
       </Status>

       <Error>
          <!-- There is no Fatal entry defined due to no fatal error for this printer
               If Error.Fatal is missing, all Error.Intervention message which
               are not defined will be considered fatal -->

          <!-- The Intervention occurs when a print job is started and the target printer has posted
               an error requiring intervention; when the problem is corrected,
               the print job is continued -->
          <Intervention>
             <CmdEnableResponses str="ST{020000}{01}"/>
                 <!-- EPSON: Enables the Printer Status Reply periodically (every
                             few second) or when the printer status changes -->
             <CmdDisableResponses str="ST{020000}{00}"/>
             <ReplyFormat>
                <Prefix str="@BDC{20}ST{0D0A}"/>
                <Postfix str="{FF}"/>
                <Separator str=";"/> <!-- optional; for multiple parameters separated in a list -->
                <Parameters>
                   <!-- predefined -->
                   <PaperOut str="ER:{06}"/>
                   <PaperJam str="ER:{04}"/>
                   <InkOut str="ER:{05}"/>

                   <!-- custom -->
                   <entry name="BlackInkLow">
                      <Keyword str="WR:"/>
                      <Separator str=","/> <!-- optional; for multiple code separated in a list -->
                      <Code str="{10}"/>
                      <Name str="Black ink low"/> <!-- required for custom ReplyFormat Parameter -->
                   </entry> <!-- BlackInkLow -->
                   <entry name="CyanInkLow">
                      <Keyword str="WR:"/>
                      <Separator str=","/> <!-- optional; for multiple code separated in a list -->
                      /Code <11>
                      <Name str="Cyan ink low"/> <!-- required for custom ReplyFormat Parameter -->
                   </entry> <!-- CyanInkLow -->

                   <!-- ... -->
                </Parameters>
             </ReplyFormat>
          </Intervention>
       </Error>
    </Responses>

    Note that the Responses entry is optional and is not used for a driver
    operating on a target printer locally connected with a non-bidirectional transport type
    (e.g., traditional one-directional parallel port).

    In case of operating in a non-bidirectional mode, commands that require responses from the
    printer will not be sent down. Instead, predefined hardware signals
    from a parallel port can be used but with much less comprehensive
    error/status messages to a human user as demonstrated below in terms
    of a Unix parallel port I/O interface whose function names should
    describe themselves:

       isPrinterTimedOut() => "Not Responding"
       isPaperOut() => "Out of Paper"
       isPrinterSelected() => "Off Line"
       isPrinterError() => "Error"

    Jim Lo (jim.lo@eng.sun.com)
    Internet Appliance Group
    Sun Microsystems, Inc.
    Last modified: Mon. Dec 04 2000 13:25:23 PDT


    The Responses framework for printer error/status messages handling

    It would be nice to have a GUI on a host machine to monitor a target printer for its possible error conditions and working status changes especially when there is no LCD panel on the printer. It is especially important for printers supporting bi-directional I/O connectivity such as USB (Universal Serial Bus). Those printers usually provide a much richer set of device-dependent proprietary notification and enquiry messages compared to a hardware based interface for the traditional one-directional Centronics parallel connection which provides a much limited set of less clearer error/status messages.

    This document provides a device independent way to describe device-dependent message formats so that most printer vendors can benefit from a common printer-decription-file-driven GUI services in a consistent way without having to write any line of C code for their device dependent messages.

    The Responses tag and all its predefined nested element tags are introduced to enable dynamic configuration, error, warning and progress enquiry and responses. They are all described in a unified format which is demonstrated by the following two examples for PostScript printers and EPSON inkjet printers respectively:

    <!-- -----Example 1: PostScript -->
    <Responses>
       <Status> <!-- solicited message -->
          <CmdEnableResponses str="{14}"/> <!-- PS: Ctrl-T to enable it for only once 
          <!-- There is no CmdDisableResponses since it will be automatically disabled 
               after being enabled and performance (i.e., only once) -->
          <ReplyFormat>
             <Prefix str="%%[ "/>
             <Postfix str=" ]%%"/>
             <Parameters>
                <State>
                   <Keyword str="status:"/>
                   <Separator str=";"/>        <!-- optional; for multiple keywords separated in a list -->
                   <Init str="Initializing"/>  <!-- During startup -->
                   <Wait str="Waiting"/>       <!-- I/O wait while printing -->
                   <Idle str="Idle"/>          <!-- No job in progress -->
                   <Busy str="Busy"/>          <!-- While printing -->
                   <Error str="PrinterError"/> <!-- cf. the Error section below -->
                </State>
                <!-- custom parameters, if any... -->
             </Parameters>
          </ReplyFormat>
       </Status>
    
       <Error>
          <!-- Optional: The Fatal occurs when a fatal error is detected by the target printer -->
          <Fatal> <!-- A fatal error must be enclosed by the prefix and postfix strings, if available -->
              <Prefix str="%%[ Error: "/>
              <Postfix str=" ]%%"/>
          </Fatal>
    
          <!-- The Intervention occurs when a print job is started and the target printer has posted
               an error requiring intervention; when the problem is corrected,
               the print job is continued -->
          <Intervention>
             <!-- CmdEnableResponses and CmdDisableResponses are missing for unsolicited messages -->
             <ReplyFormat>
                <Prefix str="%%[ PrinterError: "/>
                <Postfix str=" ]%%"/>
                <Parameters>
                   <!-- Predefined -->
                   <PaperOut str="Paper Out"/> <!-- The starting Keyword substring for Paper Out -->
                   <PaperJam str="Paper Jam"/> <!-- The starting Keyword substring for Paper Jam -->
    
                   <!-- Custom -->
                   <entry str="InkOut">
                      <Keyword str="Toner Low"/>
                      <Name str="Toner Low"/> <!-- optional: to override the default display name -->
                   </entry> <!-- InkOut -->
     
                   <!-- Anything undefined in between the Prefix and the Postfix will be 
                        displayed without localization -->
                </Parameters>
             </ReplyFormat>
          </Intervention>
       </Error>
    </Responses>
    
    <!-- -----Example 2: Non-PostScript EPSON low-cost printer -->
    <Responses>
       <Status>
          <CmdEnableResponses  str="ST{020000}{01}"/>
              <!-- EPSON: Enables the Printer Status Reply periodically (every
                          few second) or when the printer status changes -->
          <CmdDisableResponses str="ST{020000}{00}"/>
    
          <ReplyFormat>
             <Prefix str="@BDC{20}ST{0D0A}"/>
             <Postfix str="{FF}"/>
             <Separator str=";"/> <!-- optional; for multiple parameters separated in a list -->
             <Parameters>
                <State>
                   <Keyword str="ST:"/>
     
                   <!-- predefined states -->
                   <Init> <!-- During startup -->
                      <Code str="{01}">
                      <Name str="State: Self Testing"/>
                         <!-- Optional; to override the default display string -->
                   </Init>
                   <Wait  str="{03}"/>  <!-- I/O wait while printing -->
                   <Idle  str="{04}"/>  <!-- No job in progress -->
                   <Busy  str="{02}"/>  <!-- While printing -->
                   <Error str="{00}"/>  <!-- cf. the Error section below -->
     
                   <!-- Custom state -->
                   <entry name="CleaningTime">
                      <Name str="State: Cleaning or charging"/> <!-- required for a custom entry -->
                      <Code str="{07}"/>
                      <!-- cf. the CleaningTimeParameter below for its parameter
                           according to a naming convention: "CleaningTime" + "Parameter" -->
                   </entry> <!-- CleaningTime -->
                </State>
    
                <!-- Custom parameter: for the custom state CleaningTime
                     according to a naming convention: "CleaningTime" + "Parameter" -->
                <entry name="CleaningTimeParameter">
                   <Keyword str="TC:"/>
                   <Name str="Total Elapsed Time"/> <!-- required for a custom entry -->
                   <!-- If /Code is missing, all bytes in between the Keyword and the
                        Separator (or Postfix) will be used as the Code value
                        (In this particular case, there are four bytes ASCII codes that
                        indicate total time of cleaning in second unit) -->
                </entry> <!-- CleaningTimeParameter -->
             </Parameters>
          </ReplyFormat>
       </Status>
    
       <Error>
          <!-- There is no Fatal entry defined due to no fatal error for this printer
               If Error.Fatal is missing, all Error.Intervention message which 
               are not defined will be considered fatal -->
    
          <!-- The Intervention occurs when a print job is started and the target printer has posted
               an error requiring intervention; when the problem is corrected, 
               the print job is continued -->
          <Intervention>
             <CmdEnableResponses str="ST{020000}{01}"/>
                 <!-- EPSON: Enables the Printer Status Reply periodically (every
                             few second) or when the printer status changes -->
             <CmdDisableResponses str="ST{020000}{00}"/>
             <ReplyFormat>
                <Prefix str="@BDC{20}ST{0D0A}"/>
                <Postfix str="{FF}"/>
                <Separator str=";"/> <!-- optional; for multiple parameters separated in a list -->
                <Parameters>
                   <!-- predefined -->
                   <PaperOut str="ER:{06}"/>
                   <PaperJam str="ER:{04}"/>
                   <InkOut str="ER:{05}"/>
    
                   <!-- custom -->
                   <entry name="BlackInkLow">
                      <Keyword str="WR:"/>
                      <Separator str=","/> <!-- optional; for multiple code separated in a list -->
                      <Code str="{10}"/>
                      <Name str="Black ink low"/> <!-- required for custom ReplyFormat Parameter -->
                   </entry> <!-- BlackInkLow -->
                   <entry name="CyanInkLow">
                      <Keyword str="WR:"/>
                      <Separator str=","/> <!-- optional; for multiple code separated in a list -->
                      /Code <11>
                      <Name str="Cyan ink low"/> <!-- required for custom ReplyFormat Parameter -->
                   </entry> <!-- CyanInkLow -->
    
                   <!-- ... -->
                </Parameters>
             </ReplyFormat>
          </Intervention>
       </Error>
    </Responses>
    
    Note that the Responses entry is optional and is not used for a driver operating on a target printer locally connected with a non-bidirectional transport type (e.g., traditional one-directional parallel port).

    In case of operating in a non-bidirectional mode, commands that require responses from the printer will not be sent down. Instead, predefined hardware signals from a parallel port can be used but with much less comprehensive error/status messages to a human user as demonstrated below in terms of a Unix parallel port I/O interface whose function names should describe themselves:

       isPrinterTimedOut() => "Not Responding"
       isPaperOut() => "Out of Paper"
       isPrinterSelected() => "Off Line"
       isPrinterError() => "Error"
    
    Please Send Feedback To: Jim.Lo@Eng
    Internet Appliance Group
    Sun Microsystems, Inc.
    Last modified: Mon. Dec 04 2000 13:25:23 PDT



    This archive was generated by hypermail 2b29 : Mon Dec 04 2000 - 17:33:36 EST