The Developer's Guide to Gimp-Print
Prev | Chapter 5. ESC/P2 | Next

# Remote Mode Commands

The following description of remote commands comes out of an examination of the sequences used by the printer utilities bundled with the Windows drivers for the ESC740, and from other sources (some Epson manuals, experimentation, analysis of print files). It is largely speculative as these commands are not all documented in the Epson documentation we have access to. Generally, newer manuals provide more thorough documentation.

Remote command mode is entered when the printer is sent the following sequence:

    ESC (R BC=8 00 R E M O T E 1

Remote mode commands are then sent, and terminated with the following sequence:

    ESC 00 00 00

All remote mode commands must be sent before the initial ESC (G command is sent.

This introductory sequence is then followed by a sequence of commands. Each command is constructed as follows:

1. Two ASCII bytes indicating the function

2. A byte count (two bytes, little-endian) for the parameters

3. Binary parameters, if any

This is a list of all remote commands we have seen:

ESC/P2 Remote Mode Commands

NC BC=2 00 00

  Print a nozzle check pattern.

VI BC=2 00 00

  On my 740, prints the following, probably “version information”:

      W01286 I02382\r\n

* AI BC=3 00 00 00

  Prints a “printer ID”. On one 870, prints the following:

      51-51-50-51-49-48\r\n

  The Windows driver has a text entry field where this number can be entered, but its purpose is unknown.

* LD BC=0

  Load printer defaults from NVRAM, DIP switches, and/or ROM. This apparently does not load factory defaults per se, but any settings that are saved. This is commonly used right at the end of each print job after the ESC @ printer reset command.

* CH BC=2 00 xx

  Perform a head cleaning cycle. The heads to clean are determined by parameter xx:

  Table 5-5. Head cleaning parameters

  xx | Description
  --- | ---
  `00` | Clean all heads
  `01` | Clean black head
  `02` | Clean color heads

  While xx = `00` is likely supported by all printers, xx = `01` and `02` are not.

* DT BC=3 00 xx 00

  Print an alignment pattern. There are three patterns, which are picked via the choice of xx. Pattern `0` is coarse, pattern `1` is medium, and pattern `2` is fine.

* DA BC=4 00 xx 00 yy

  Set results for the alignment pattern. xx is the pattern (`1`--`3`); yy is the best choice from the set (`1`--`7` or `1`--`15`). This does not save to NVRAM, so when the printer is powered off, the setting will be lost.

* SV BC=0

  Save the current settings to NVRAM.

* RS BC=1 01

  Reset the printer.

* IQ BC=1 01

  Get ink quantity. This requires direct access to the printer port. The return looks like

      IQ:KKCCMMYY

  or

      IQ:KKCCMMYYccmm

  (for 4-color and 6-color printers respectively), where each pair of digits are hexadecimal representations of percent.

The following two commands have been observed on an STP 870.

* IR BC=2 00 xx

  Function unknown. This command has been observed on an STP 870 with xx=`03` at the start of a job and xx=`02` at the end of a job (where it is followed by an LD command). When in roll mode, the values change to xx=`01` at the start of a job and xx=`00` at the end of a job.

* FP BC=3 00 pos[2]

  Specify the horizontal left margin in units of 1/360 inch. The default value for pos is `0`. For borderless printing on printers that support it, a value of `-80` (`FFB0h`) should be used.

The commands below are partially documented in the Stylus Pro 9000 manual. Much of this information is interpreted; none is tested.

* SN BC=3 00 xx yy

  Select Mechanism Sequence. xx controls which sub-operation is performed. xx=`00` selects the “Feed paper sequence setting”. yy can take on the following values (on the STP 870, at any rate):

  Table 5-6. Media types

  yy | Media type
  --- | ---
  `0` | Default
  `1` | Plain paper
  `2` | Postcards
  `3` | Film (photo quality glossy film, transparencies)
  `4` | Envelopes
  `5` | Plain paper (fast load)
  `6` | Back light film (although this has been observed with heavyweight matte paper)
  `7` | Matte paper (observed with 360 dpi inkjet paper, and photo quality inkjet paper)
  `8` | Photo paper

  Experimentation suggests that this setting changes details of how the printers' cut sheet feeder works, presumably to tune it for different types of paper.

  xx=`01` controls the platen gap setting; yy=`00` is the default, yy=`1` or `2` are higher settings.

  xx=`02` controls paper loading speed (yy=`0` is normal, `1` is fast, `2` is slow). It appears that `1` is used when printing on “plain paper”, “360dpi ink jet paper” or “ink jet transparencies”, and yy=`00` for all other paper type settings.

  xx=`07` controls duplex printing for printers with that capability (yy=0 is default, for non-duplex printing; `1` is front side of the paper, and 2 is back side).

  xx=`09` controls zero margin printing on the printers with the capability of printing zero-margin on all sides (Stylus Photo 780/790, 890, and 1280/1290). yy=`0` is the default; `1` enables zero margin printing.

* PP BC=3 00 xx yy

  Set Paper Path. xx=`2` indicates manual feed, xx=`3` is for roll paper. yy selects “paper path number”.

* AC BC=2 00 xx

  Set Auto Cutting State. xx=`0` selects auto cutting off, xx=`1` selects auto cutting on, and xx=`2` indicates horizontal print page line on. It appears that with auto cutting on, roll paper is cut automatically at the point a formfeed character is sent. The formfeed character is normally used to eject a page; with this turned on, it also cuts the roll paper. Horizontal print page line on prints a narrow line of black dots at the position the paper should be cut manually.

* DR BC=4 00 xx DT2

  Set Drying Time. xx=`00` sets the drying time “per scan” (per pass?); xx=`01` sets the drying time per page. DT indicates the drying time, which is in seconds if page mode is used and in milliseconds if scan mode is used. DT must not exceed 3600 seconds in per-page mode and 10000 milliseconds in per-scan mode.

* IK BC=2 00 xx

  Select Ink Type. xx=`00` selects dye ink. Pigment ink is apparently selected by xx=`01`. This probably does not apply to the consumer-grade printers.

* PZ BC=2 00 xx

  Set Pause After Printing. xx=`00` selects no pause after printing; xx=`01` selects pause after printing. If turned on, the printer is paused after the page is ejected (by the FF byte). If cutting is turned on, the printer is paused after the cutting or printing of the horizontal cut line.

* EX BC=6 00 00 00 00 0x14 xx

  Set Vertical Print Page Line Mode. xx=`00` is off, xx=`01` is on. If turned on, this prints vertical trim lines at the left and right margins.

* EX BC=6 00 00 00 00 0x05 xx

  Set Roll Paper Mode. If xx is `0`, roll paper mode is off; if xx is `1`, roll paper mode is on.

* EX BC=3 00 xx yy

  Appears to be a synonym for the SN command described above.

* PH BC=2 00 xx

  Select Paper Thickness. Set the paper thickness xx in .1 mm units. This must not exceed `0x10` (1.6 mm). If the thickness is set “more than” .6 mm (which probably means “at least” 0.6 mm, since the other case reads “less than 0.5 mm”), the platen gap is set high irrespective of the SN command.

* PM BC=2 00 00

  Function unknown. Used on the STC 3000 at least when using roll feed, and on the STP 870 in all print files analysed to date.

* ST BC=2 00 xx

  Epson's STP 750/1200 programming guide refers to the ST command as “Set printer state reply”. If xx is `0` or `2`, the printer will not send status replies. If xx is `1` or `3`, the printer will send status replies. The status replies consist of state, error codes, ink leve, firmware version, and warning status.

  The actual reply is documented as

      @BDC ST\r
      ST: xx;
      [ER: yy;]
      IQ: n1n2n3n4;
      [WR: w1,w2...;]
      RV: zz;
      AI:CW:02kkccmmyy, MI:mm
      [TC:tttt;]
      INK:...;
      \f

  (\r is carriage return; \n is newline; \f is formfeed.)

  ST is the printer status:

  Table 5-7. Printer status codes

  Status code | Description
  --- | ---
  `00` | Error
  `01` | Self-test
  `02` | Busy
  `03` | Waiting while printing
  `04` | Idle
  `07` | Cleaning/filling ink heads
  `08` | Not yet initialized/filling heads

  ER, if provided, is the error status:

  Table 5-8. Printer error codes

  Error code | Description
  --- | ---
  `00` | Fatal Error
  `01` | Interface not selected
  `04` | Paper jam
  `05` | Out of ink
  `06` | Paper out
  `0D` | Paper gap error
  `10` | Maintenance request
  `11` | Tear-off mode selected
  `12` | Double feed error
  `1C` | Cutter position error
  `1D` | Cutter jam
  `1E` | Ink color error
  `23` | Ink combination error

  IQ is the amount of ink left, as a (decimal!) percentage expressed in hexadecimal. The values are black, cyan, magenta, and yellow. 6 and 7 color printers usually specify two or three additional values for light cyan, light magenta, and gray. However, some low end 6-color printers specify only four values.

  For printers with different ink cartridge options, the following additional values may appear:

  Table 5-9. Printer additional ink codes

  Ink code | Description
  --- | ---
  `NA` | Ink cartridge is not inserted
  `RE` | Ink cartridge information cannot be read
  `WE` | Ink cartridge information cannot be written
  `CI` | Ink cartridge is inserted, but has not been read

  WR, if provided, is the warning status:

  Table 5-10. Printer warning codes

  Warning code | Description
  --- | ---
  `10` | Black ink low (Photo black on printers using UltraChrome® ink)
  `11` | Cyan
  `12` | Magenta
  `13` | Yellow
  `14` | Light cyan (presumably)
  `15` | Light magenta (presumably)
  `17` | Gray (with UltraChrome-compatible printers)
  `18` | Matte black 1 (UltraChrome)
  `19` | Matte black 2 (UltraChrome)

  RV is the firmware revision (one byte ASCII).

  AI is actuator information. These are two byte ASCII codes that indicate ``ink weight rank ID'' of KCMY, respectively.

  TC, if provided, is the total time of cleaning or ink filling (?).

  RC, if provided, is the firmware revision.

  INK: and MI are not documented.

* SM BC=2 00 xx

  Set Status Reply Rate. xx is the repeat interval in seconds. If xx is `0`, the status is returned only when the printer's state changes.

* ST BC=1 01

  Reply Printer Status. The reply is formatted as follows:

      @BDC PS\r\nST:xx;\f

  \r is carriage return; \n is newline; \f is formfeed). If xx (the reply value) is `0` or `2`, automatic status update is disabled; if `1` or `3`, it is enabled.

* SM BC=1 01

  Reply Printer Status Rate. The reply is formatted as follows:

      @BDC PS\r\nST:xx;\f

  \r is carriage return; \n is newline; \f is formfeed). See SM BC=2 above for the meaning of the return value.

* ?? BC=xx y[1] … y[xx]

  Echo Parameters (perhaps better described as Echo Commands). The command string is executed (it would appear from the documentation), and the string sent is returned using a sequence similar to that described in the ST BC=1 and SM BC=1 commands. Note that in this case the number of bytes is variable!

* SM BC=2 00 02

  Function unknown. Used on the STC 3000 at least when using roll feed.

* JE BC=1 00

  Function unknown. On new printers (STC 740 or newer), this command should be sent after all data has been sent. If this command is not sent, and the printer is connected to a Windows system, the last page of the job will not print completely. The most likely explanation for for this is that the Windows driver typically puts the printer in 1284.4 packet mode, and this command has the effect of flushing the buffer in the printer.

* CO BC=8 00 cutter[1] page[1] unit[1] position[4]

  Specify paper cutting on Stylus Photo 2200 (and perhaps some other printers). cutter must be 0. page should be one of the following:

  Table 5-11. Paper cutting codes

  Code | Description
  --- | ---
  `0` | All pages
  `1` | First page only
  `2` | Last page only

  unit should be one of the following:

  Table 5-12. Paper cutting units

  Code | Description
  --- | ---
  `0` | 1/360 in.
  `1` | 1/720 in.
  `2` | 1/1440 in.

  This command should be used twice. The first CO command specifies where the page will be cut at the top, and the second specifies where the page will be cut at the bottom. This permits cutting both the top and the bottom of the page.

Prev | Home | Next
ESC/P2 | Up | Appropriate Remote Commands