15 Scanner devices

15.1 Model for scanner devices

Scanner devices generate a digital representation of two- or three- dimensional objects (e.g. a page of text, a photograph, or a piece of art). This is accomplished by sensing the amount of light reflected from the object and generating the digital data. The digital data can then be sent across the SCSI bus to an initiator for further processing.

There are two types of scanners in use; in one type, the operations and functions of the scanner are fixed; in the other type, the operations and functions are programmable and need to be set up prior to being used for scanning objects.

The scanner device generates the data and transfers it in accordance with the commands received from the initiator. The contents of the data is vendor-specific; therefore, the initiator and the scanner must know how to use the contents of the data.

Scanners generate a digital image of an object in a two dimensional plane. The x-axis dimension is along the cross-scan direction that is perpendicular to the direction in which a scan occurs. The y-axis dimension is along the scan direction, and is parallel to the direction in which a scan occurs. The coordinates are measured from the upper left hand corner of the two dimensional plane. The x-axis measurement increases in a positive manner going from left to right. The left side of the two dimensional plane (i.e. where x equals zero) is called the base element line. The y-axis measurement increases in a positive manner going from top to bottom. The top side of the two dimensional plane (i.e. where y equals zero) is called the base line. The scanning range encompasses the area in which the scanner can operate, from the scan line and base line to the maximum x and y position. These conventions are adopted to aid in understanding the fields within the command descriptor blocks and parameters used for scanner devices. As such this is a conceptual model and may not accurately reflect the physical device.

The displacements used for positioning windows is independent of the resolution with which a window is scanned. The measurement of displacements is controlled by the scan measurement mode parameters.

In the event of a scanner automatic creation of sub-windows within a defined window (i.e. the auto bit in the DEFINE WINDOW parameters is one), one of the following responses is appropriate:

It may occur that a scanner device temporarily does not have resources available to manage a data transfer from the initiator or does not have data available to transfer to the initiator. One of the following responses is appropriate in such a case:

If the scanner device determines that an error or exception condition has occurred while executing the SCSI command from the initiator, a CHECK CONDITION status is returned. A REQUEST SENSE command can then be used to determine additional information regarding the error or exception condition.

15.2 Commands for scanner devices

The commands for scanner devices shall be as shown in table 277.

Table 277 - Commands for scanner devices

+=====================================-============-======-============+
|  Command name                       | Operation  | Type |  Subclause |
|                                     |   code     |      |            |
|-------------------------------------+------------+------+------------|
| CHANGE DEFINITION                   |    40h     |   O  |   8.2.1    |
| COMPARE                             |    39h     |   O  |   8.2.2    |
| COPY                                |    18h     |   O  |   8.2.3    |
| COPY AND VERIFY                     |    3Ah     |   O  |   8.2.4    |
| GET DATA BUFFER STATUS              |    34h     |   O  |  15.2.1    |
| GET WINDOW                          |    25h     |   O  |  15.2.2    |
| INQUIRY                             |    12h     |   M  |   8.2.5    |
| LOG SELECT                          |    4Ch     |   O  |   8.2.6    |
| LOG SENSE                           |    4Dh     |   O  |   8.2.7    |
| MODE SELECT(6)                      |    15h     |   O  |   8.2.8    |
| MODE SELECT(10)                     |    55h     |   O  |   8.2.9    |
| MODE SENSE(6)                       |    1Ah     |   O  |   8.2.10   |
| MODE SENSE(10)                      |    5Ah     |   O  |   8.2.11   |
| OBJECT POSITION                     |    31h     |   O  |  15.2.3    |
| READ                                |    28h     |   M  |  15.2.4    |
| READ BUFFER                         |    3Ch     |   O  |   8.2.12   |
| RECEIVE DIAGNOSTIC RESULTS          |    1Ch     |   O  |   8.2.13   |
| RELEASE UNIT                        |    17h     |   M  |  10.2.9    |
| REQUEST SENSE                       |    03h     |   M  |   8.2.14   |
| RESERVE UNIT                        |    16h     |   M  |  10.2.10   |
| SCAN                                |    1Bh     |   O  |  15.2.5    |
| SET WINDOW                          |    24h     |   M  |  15.2.7    |
| SEND                                |    2Ah     |   O  |  15.2.6    |
| SEND DIAGNOSTIC                     |    1Dh     |   M  |   8.2.15   |
| TEST UNIT READY                     |    00h     |   M  |   8.2.16   |
| WRITE BUFFER                        |    3Bh     |   O  |   8.2.17   |
|----------------------------------------------------------------------|
|Key:  M = command implementation is mandatory.                        |
|      O = command implementation is optional.                         |
+======================================================================+ 
All other operation codes for scanner devices are reserved for future standardization.

15.2.1 GET DATA BUFFER STATUS command

The GET DATA BUFFER STATUS command (see table 278) provides a means for the initiator to get information about the data buffer. Information is returned only for window identifiers for which a SCAN command has been received (see 15.2.5).

Table 278 - GET DATA BUFFER STATUS command

+=====-========-========-========-========-========-========-========-========+
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=====+=======================================================================|
| 0   |                           Operation code (34h)                        |
|-----+-----------------------------------------------------------------------|
| 1   | Logical unit number      |            Reserved               |  Wait  |
|-----+-----------------------------------------------------------------------|
| 2   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 3   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 4   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 5   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 6   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 7   | (MSB)                                                                 |
|-----+---                        Allocation length                        ---|
| 8   |                                                                 (LSB) |
|-----+-----------------------------------------------------------------------|
| 9   |                           Control                                     |
+=============================================================================+ 
A wait bit of zero indicates that the target shall respond immediately. A wait bit of one indicates that the target shall wait for image data to be available before returning scan status data.

The data buffer status data format is defined in table 279.

Table 279 - Data buffer status format

+=====-========-========-========-========-========-========-========-========+
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=====+=======================================================================|
| 0   | (MSB)                                                                 |
|-----+---                                                                 ---|
| 1   |                           Data buffer status length                   |
|-----+---                                                                 ---|
| 2   |                                                                 (LSB) |
|-----+-----------------------------------------------------------------------|
| 3   |                           Reserved                           |  Block |
|=====+=======================================================================|
|     |                           Data buffer status descriptor(s)            |
|=====+=======================================================================|
| 0   |                           Window identifier                           |
|-----+-----------------------------------------------------------------------|
| 1   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 2   | (MSB)                                                                 |
|-----+---                                                                 ---|
| 3   |                           Available data buffer                       |
|-----+---                                                                 ---|
| 4   |                                                                 (LSB) |
|-----+-----------------------------------------------------------------------|
| 5   | (MSB)                                                                 |
|-----+---                                                                 ---|
| 6   |                           Filled data buffer                          |
|-----+---                                                                 ---|
| 7   |                                                                 (LSB) |
+=============================================================================+ 
The data buffer status length indicates the length, in bytes, of the following scan status data that is available to be transferred during the DATA IN phase. The data buffer status length does not include itself. The data buffer status data transferred to the initiator includes zero or more data buffer status descriptors. Each descriptor returns information for the window specified by the window identifier.

The block bit specifies the buffering capabilities of the scanner. A block bit of one indicates that the data buffer is full and all image data must be transferred to the initiator before the scan operation resumes. A block bit of zero indicates that the data buffer is not full and scan operations can continue with the available data buffer space.

The available data buffer field indicates, in bytes, the amount of buffer available for transfers from the initiator. This field is valid only in scanners with the ability to accept data from an initiator for processing.

The filled data buffer field indicates the amount of image data in bytes available for transfer to the initiator.

15.2.2 GET WINDOW command

The GET WINDOW command (see table 280) provides a means for the initiator to get information about previously defined windows.

Table 280 - GET WINDOW command

+=====-========-========-========-========-========-========-========-========+
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=====+=======================================================================|
| 0   |                           Operation code (25h)                        |
|-----+-----------------------------------------------------------------------|
| 1   | Logical unit number      |              Reserved             | Single |
|-----+-----------------------------------------------------------------------|
| 2   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 3   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 4   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 5   |                           Window identifier                           |
|-----+-----------------------------------------------------------------------|
| 6   | (MSB)                                                                 |
|-----+---                                                                 ---|
| 7   |                           Transfer length                             |
|-----+---                                                                 ---|
| 8   |                                                                 (LSB) |
|-----+-----------------------------------------------------------------------|
| 9   |                           Control                                     |
+=============================================================================+ 
A single bit of one specifies that a single window descriptor shall be returned for the specified window identifier. A single bit of zero specifies that window descriptors be returned for all window identifiers that were defined by a SET WINDOWS command or by the target, if the automatic bit was set to one.

The GET WINDOW data shall consist of a header (see table 281) followed by one or more window descriptors. Each window descriptor specifies the location, size, and scanning method used for a window.

Table 281 - Get window data header

+=====-========-========-========-========-========-========-========-========+
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=====+=======================================================================|
| 0   | (MSB)                                                                 |
|-----+---                        Window data length                       ---|
| 1   |                                                                 (LSB) |
|-----+-----------------------------------------------------------------------|
| 2   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 3   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 4   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 5   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 6   | (MSB)                                                                 |
|-----+---                        Window descriptor length                 ---|
| 7   |                                                                 (LSB) |
+=============================================================================+ 
The window data length specifies the length in bytes of the following data that is available to be transferred. The window data length does not include itself. If the allocation length is not sufficient to return all the get window data, the window data length shall not be adjusted to reflect the truncation data.

The window descriptor length specifies the length in bytes of a single window descriptor. Each descriptor shall be of equal length. The first forty-eight bytes are defined in this International Standard and the remaining bytes in each descriptor are vendor-specific.

The window descriptors are defined in table 282.

Table 282 - Window descriptor bytes

+=====-========-========-========-========-========-========-========-========+
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=====+=======================================================================|
| 0   |                           Window identifier                           |
|-----+-----------------------------------------------------------------------|
| 1   |                           Reserved                           |  Auto  |
|-----+-----------------------------------------------------------------------|
| 2   | (MSB)                                                                 |
|-----+---                        X-Axis resolution                        ---|
| 3   |                                                                 (LSB) |
|-----+-----------------------------------------------------------------------|
| 4   | (MSB)                                                                 |
|-----+---                        Y-Axis resolution                        ---|
| 5   |                                                                 (LSB) |
|-----+-----------------------------------------------------------------------|
| 6   | (MSB)                                                                 |
|- - -+- - -                      X-Axis upper left                      - - -|
| 9   |                                                                 (LSB) |
|-----+-----------------------------------------------------------------------|
| 10  | (MSB)                                                                 |
|- - -+- - -                      Y-Axis upper left                      - - -|
| 13  |                                                                 (LSB) |
|-----+-----------------------------------------------------------------------|
| 14  | (MSB)                                                                 |
|- - -+- - -                      Window width                           - - -|
| 17  |                                                                 (LSB) |
|-----+-----------------------------------------------------------------------|
| 18  | (MSB)                                                                 |
|- - -+- - -                      Window length                          - - -|
| 21  |                                                                 (LSB) |
|-----+-----------------------------------------------------------------------|
| 22  |                           Brightness                                  |
|-----+-----------------------------------------------------------------------|
| 23  |                           Threshold                                   |
|-----+-----------------------------------------------------------------------|
| 24  |                           Contrast                                    |
|-----+-----------------------------------------------------------------------|
| 25  |                           Image composition                           |
|-----+-----------------------------------------------------------------------|
| 26  |                           Bits per pixel                              |
|-----+-----------------------------------------------------------------------|
| 27  | (MSB)                                                                 |
|-----+---                        Halftone pattern                         ---|
| 28  |                                                                 (LSB) |
|-----+-----------------------------------------------------------------------|
| 29  |  RIF   |                  Reserved         |      Padding type        |
|-----+-----------------------------------------------------------------------|
| 30  | (MSB)                                                                 |
|-----+---                        Bit ordering                             ---|
| 31  |                                                                 (LSB) |
|-----+-----------------------------------------------------------------------|
| 32  |                           Compression type                            |
|-----+-----------------------------------------------------------------------|
| 33  |                           Compression argument                        |
|-----+-----------------------------------------------------------------------|
| 34  |                                                                       |
|- - -+---                        Reserved                                 ---|
| 39  |                                                                       |
|-----+-----------------------------------------------------------------------|
| 40  |                                                                       |
|- - -+---                        Vendor-specific parameter byte(s)        ---|
| n   |                                                                       |
+=============================================================================+ 
The window identifier specifies the window defined by the window descriptor. A window is referenced by the window identifier during data transfers and parameter updates.

When used with the SET WINDOW command, an automatic (auto) bit of one indicates that the target is allowed to create sub-windows within the window specified. An auto bit of zero indicates that the target is not allowed to create sub-windows.

When used with the GET WINDOW command, an auto bit of zero indicates that the window was defined directly by the SET WINDOW command. A value of one indicates that the window was defined by the target. This is a sub-window within a window defined by a SET WINDOW command.

The window identifiers assigned by the target shall be unique and shall not be currently in use. The parameters for the sub-windows may be retrieved using the GET WINDOW command.

The x-axis resolution field specifies the resolution in the scan line direction. The unit of measure is picture elements (pixels) per inch. A value of zero specifies the default resolution.

The y-axis resolution field specifies the resolution in the base line direction. The unit of measure is scan lines per inch. A value of zero specifies the default resolution.

The x-axis upper left field specifies the x-axis coordinate of the upper left corner of the window. This coordinate is measured from the scan line using the target's current measurement unit divisor (see 15.3.3.1).

The y-axis upper left field specifies the y-axis coordinate of the upper left corner of the window. This coordinate is measured from the base line using target's current measurement unit divisor (see 15.3.3.1).

The window width field specifies the width of window in the scan line direction. The window width is measured using the target's current measurement unit divisor (see 15.3.3.1).

The window length field specifies the length of the window in the base line direction. The window length is measured using the target's current measurement unit divisor (see 15.3.3.1).

The brightness field specifies the level of brightness used to scan the object. A value of zero specifies the default brightness or automatic brightness control, if it is supported. Any other value indicates a relative brightness setting, with 255 being the highest setting, one being the lowest setting, and 128 being the nominal setting.

The threshold field specifies the threshold at which scan data is converted to binary data. A value of zero specifies the default threshold or automatic threshold control if it is supported. Any other value indicates relative threshold setting, with 255 being the highest setting, one being the lowest setting, and 128 being the nominal setting.

The contrast field specifies the level of contrast used to scan the object. A value of zero specifies the default contrast or automatic contrast control, if it is supported. Any other value indicates a relative contrast setting, with 255 being the highest setting, one being the lowest setting, and 128 being the nominal setting.

The halftone field specifies the level of halftone at which the scan data is converted to binary data. The values in this field are vendor- specific. The halftone field is used in conjunction with the image composition field.

The image composition field specifies the type of scan operation requested. The image composition is defined as shown in table 283.

Table 283 - Image composition codes

+=============-==========================================+
|    Code     |  Description                             |
|-------------+------------------------------------------|
|     00h     |  Bi-level black & white                  |
|     01h     |  Dithered/halftone black & white         |
|     02h     |  Multi-level black & white (gray scale)  |
|     03h     |  Bi-level RGB colour                     |
|     04h     |  Dithered/halftone RGB colour            |
|     05h     |  Multi-level RGB colour                  |
|  06h - FFh  |  Reserved                                |
+========================================================+ 
The bits per pixel field specifies the number of bits used to represent the intensity of a single colour.

A reverse image format (RIF) bit of zero indicates that white pixels are indicated by zeros and black pixels are indicated by ones. A RIF bit of one indicates that white pixels are to be indicated by ones and black pixels are to be indicated by zeros. The RIF bit is applicable only for images represented by one bit per pixel.

The padding type field specifies how the target shall pad the image data transmitted to the initiator if it is not an integral number of bytes. The padding type is defined in table 284.

Table 284 - Padding types

+=============-=================================+
|    Code     |  Description                    |
|-------------+---------------------------------|
|     00h     |  No padding                     |
|     01h     |  Pad with 0's to byte boundary  |
|     02h     |  Pad with 1's to byte boundary  |
|     03h     |  Truncate to byte boundary      |
|  04h - FFh  |  Reserved                       |
+===============================================+ 
The bit ordering field specifies the order in which data is transferred to the host from the window. The bit ordering specifies the direction of pixels in a scan line, the direction of scan lines within a window and the image data packing within a byte. The values in this field are vendor-specific.

The compression type and compression argument fields specify the compression technique to be applied to the image data (see table 285).

Table 285 - Compression types and arguments

+=============-===============================================-===============+
| Compression |  Description                                  |  Compression  |
|   code      |                                               |   argument    |
|-------------+-----------------------------------------------+---------------|
|     00h     |  No compression                               |   Reserved    |
|     01h     |  CCITT group III, 1 dimensional               |   Reserved    |
|     02h     |  CCITT group III, 2 dimensional               |   K factor    |
|     03h     |  CCITT group IV, 2 dimensional                |   Reserved    |
|  04h - 0Fh  |  Reserved                                     |   Reserved    |
|     10h     |  Optical character recognition (OCR)          |Vendor-specific|
|  11h - 7Fh  |  Reserved                                     |   Reserved    |
|  80h - FFh  |  Vendor-specific                              |Vendor-specific|
+=============================================================================+ 

15.2.3 OBJECT POSITION command

The OBJECT POSITION command (see table 286) provides positioning functions. Absolute as well as relative positioning is provided. A target shall return CHECK CONDITION status and set the sense key to ILLEGAL REQUEST if a positioning function is requested that is not supported.

Table 286 - OBJECT POSITION command

+=====-========-========-========-========-========-========-========-========+
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=====+=======================================================================|
| 0   |                           Operation code (31h)                        |
|-----+-----------------------------------------------------------------------|
| 1   | Logical unit number      |    Reserved     |      Position function   |
|-----+-----------------------------------------------------------------------|
| 2   | (MSB)                                                                 |
|-----+---                                                                 ---|
| 3   |                           Count                                       |
|-----+---                                                                 ---|
| 4   |                                                                 (LSB) |
|-----+-----------------------------------------------------------------------|
| 5   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 6   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 7   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 8   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 9   |                           Control                                     |
+=============================================================================+ 
The position function field specifies the requested function (see table 287).

Table 287 - Position function

+=============-========================+
|  Position   |  Description           |
|  function   |                        |
|-------------+------------------------|
|    000b     |  Unload object         |
|    001b     |  Load object           |
|    010b     |  Absolute positioning  |
|    011b     |  Relative positioning  |
|    100b     |  Rotate object         |
|    101b     |  Reserved              |
|    110b     |  Reserved              |
|    111b     |  Reserved              |
+======================================+ 

Any other value in the count field shall cause the target to position the object that number of units in the scan line direction. If there is no object loaded or if the specified y-axis displacement is not achieved, the target shall return CHECK CONDITION status and set the EOM bit to one and the sense key to MEDIUM ERROR.

A positive value in the count field shall cause the target to position the object that number of units in the scan line direction. If the scan range is exceeded, the target shall return CHECK CONDITION status. The EOM bit is set to one, the ILI bit is set to one, and the sense key is set to MEDIUM ERROR. The valid bit is set to one and the information bytes are set to the difference (residue) between the requested count and the actual number of units moved.

A negative value (e.g. twos complement notation) in the count field shall cause the target to position the object that number of units toward the base line. If there is no object loaded or if the specified y-axis displacement is not achieved, the target shall return CHECK CONDITION status and set the EOM bit to one and the sense key to MEDIUM ERROR. If the base line is encountered, the target shall position the object at the base line and return CHECK CONDITION status. The ILI bit is set to one and the sense key is set to MEDIUM ERROR. The valid bit is set to one and the information bytes are set to the difference (residue) between the requested count and the actual number of units moved.

The count field is used with the position function to specify the displacement of the object.

15.2.4 READ command

The READ command (see table 288) requests that the target transfer data to the initiator.

Table 288 - READ command

+=====-========-========-========-========-========-========-========-========+
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=====+=======================================================================|
| 0   |                           Operation code (28h)                        |
|-----+-----------------------------------------------------------------------|
| 1   | Logical unit number      |             Reserved                       |
|-----+-----------------------------------------------------------------------|
| 2   |                           Data type code                              |
|-----+-----------------------------------------------------------------------|
| 3   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 4   | (MSB)                                                                 |
|-----+---                        Data type qualifier                      ---|
| 5   |                                                                 (LSB) |
|-----+-----------------------------------------------------------------------|
| 6   | (MSB)                                                                 |
|-----+---                                                                 ---|
| 7   |                           Transfer length                             |
|-----+---                                                                 ---|
| 8   |                                                                 (LSB) |
|-----+-----------------------------------------------------------------------|
| 9   |                           Control                                     |
+=============================================================================+ 
The transfer data type distinguishes between the different types of data that may be transferred between the initiator and the target. The types of transfers are specified in table 289.

Table 289 - Data type codes

+=============-===================+
|    Code     |  Description      |
|-------------+-------------------|
|     00h     |  Image            |
|     01h     |  Vendor-specific  |
|     02h     |  Halftone mask    |
|     03h     |  Gamma function   |
|  04h - 7Fh  |  Reserved         |
|  80h - FFh  |  Vendor-specific  |
+=================================+ 
The data type qualifier field provides a means to differentiate data transfers of the same data type code. The values used in this field are vendor-specific.

The transfer length specifies the number of blocks the target shall transfer to the initiator during the DATA IN phase. The block size is the current block size in the mode parameters block descriptor (see 8.3.3). A transfer length of zero is not considered an error and no data shall be transferred.

If the target transfers less than transfer length blocks, a CHECK CONDITION status shall be returned. The ILI bit is set to one, the valid bit is set to one, and the information bytes are set to the difference (residue) between the requested transfer length and the actual number of blocks transferred.

This command shall be terminated with a status of RESERVATION CONFLICT if any reservation access conflict (see 10.2.10) exists, and no data shall be transferred.

15.2.5 SCAN command

The SCAN command (see table 290) requests the target begin a scan operation.

Table 290 - SCAN command

+=====-========-========-========-========-========-========-========-========+
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=====+=======================================================================|
| 0   |                           Operation code (1Bh)                        |
|-----+-----------------------------------------------------------------------|
| 1   | Logical unit number      |                  Reserved                  |
|-----+-----------------------------------------------------------------------|
| 2   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 3   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 4   |                           Transfer length                             |
|-----+-----------------------------------------------------------------------|
| 5   |                           Control                                     |
+=============================================================================+ 
The transfer length specifies the length in bytes of the window identifier list that shall be sent during the DATA OUT phase. A transfer length of zero indicates that no data shall be transferred. This condition shall not be considered an error.

The window identifier list consists of zero or more window identifiers, each of which specifies a window to be scanned.

15.2.6 SEND command

The SEND command (see table 291) transfers data from the initiator to the target.

Table 291 - SEND command

+=====-========-========-========-========-========-========-========-========+
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=====+=======================================================================|
| 0   |                           Operation code (2Ah)                        |
|-----+-----------------------------------------------------------------------|
| 1   | Logical unit number      |             Reserved                       |
|-----+-----------------------------------------------------------------------|
| 2   |                           Data type code                              |
|-----+-----------------------------------------------------------------------|
| 3   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 4   | (MSB)                                                                 |
|-----+---                        Data type qualifier                      ---|
| 5   |                                                                 (LSB) |
|-----+-----------------------------------------------------------------------|
| 6   | (MSB)                                                                 |
|-----+---                                                                 ---|
| 7   |                           Transfer length                             |
|-----+---                                                                 ---|
| 8   |                                                                 (LSB) |
|-----+-----------------------------------------------------------------------|
| 9   |                           Control                                     |
+=============================================================================+ 
The data type code and data type qualifier are defined in the READ command (see 15.2.4).

The transfer length specifies the number of blocks the target shall transfer from the initiator during the DATA OUT phase. The block size is the current block size in the mode parameters block descriptor (see 8.3.3). A transfer length of zero is not considered an error and no data shall be transferred.

This command shall be terminated with a status of RESERVATION CONFLICT if any reservation access conflict (see 10.2.10) exists, and no data shall be transferred.

15.2.7 SET WINDOW command

The SET WINDOW command (see table 292) provides a means for the initiator to specify one or more windows within the scanning range of the device.

Table 292 - SET WINDOW command

+=====-========-========-========-========-========-========-========-========+
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=====+=======================================================================|
| 0   |                           Operation code (24H)                        |
|-----+-----------------------------------------------------------------------|
| 1   | Logical unit number      |                  Reserved                  |
|-----+-----------------------------------------------------------------------|
| 2   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 3   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 4   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 5   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 6   | (MSB)                                                                 |
|-----+---                                                                 ---|
| 7   |                           Transfer length                             |
|-----+---                                                                 ---|
| 8   |                                                                 (LSB) |
|-----+-----------------------------------------------------------------------|
| 9   |                           Control                                     |
+=============================================================================+ 
The transfer length specifies the length, in bytes, of the data that shall be sent during the DATA OUT phase. A transfer length of zero indicates that no window parameters data shall be transferred. This condition shall not be considered an error.

The window parameters data shall consist of a header followed by one or more window descriptors. Each window descriptor specifies the location, size, and scanning method used for a window.

The set window data header is defined in table 293.

Table 293 - Set window data header

+=====-========-========-========-========-========-========-========-========+
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=====+=======================================================================|
| 0   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 1   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 2   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 3   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 4   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 5   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 6   | (MSB)                                                                 |
|-----+---                        Window descriptor length                 ---|
| 7   |                                                                 (LSB) |
+=============================================================================+ 
The window descriptor length specifies the length, in bytes, of a single window descriptor. Each descriptor shall be of equal length. The first 48 bytes are defined in this International Standard and the remaining bytes in each descriptor are vendor-specific.

See table 282 for the definition of a window descriptor.

15.3 Parameters for scanner devices

15.3.1 Diagnostic parameters

This subclause defines the descriptors and pages for diagnostic parameters used with scanner devices.

The diagnostic page codes for scanner devices are defined in table 294.

Table 294 - Diagnostic page codes

+=============-==================================================-============+
|  Page code  |  Description                                     | Subclause  |
|-------------+--------------------------------------------------+------------|
|     00h     |  Supported diagnostic pages                      |  8.3.1.1   |
|  01h - 7Fh  |  Reserved                                        |            |
|  80h - FFh  |  Vendor-specific pages                           |            |
+=============================================================================+ 

15.3.2 Log parameters

This subclause defines the descriptors and pages for log parameters used with scanner devices.

The log page codes for scanner devices are defined in table 295.

Table 295 - Log page codes

+=============-==================================================-============+
|  Page code  |  Description                                     | Subclause  |
|-------------+--------------------------------------------------+------------|
|     01h     |  Buffer over-run/under-run page                  |  8.3.2.1   |
|     03h     |  Error counter page (read) page                  |  8.3.2.2   |
|     07h     |  Last n error events page                        |  8.3.2.3   |
|     06h     |  Non-medium error page                           |  8.3.2.4   |
|     00h     |  Supported log pages                             |  8.3.2.5   |
|  08h - 2Fh  |  Reserved                                        |            |
|     3Fh     |  Reserved                                        |            |
|  30h - 3Eh  |  Vendor-specific pages                           |            |
+=============================================================================+ 

15.3.3 Mode parameters

This subclause defines the descriptors and pages for mode parameters used with scanner devices.

The mode parameter list, including the mode parameter header and mode block descriptor, is defined in 8.3.3.

The medium-type code field is contained in the mode parameter header (see 8.3.3). This field is reserved for scanners devices.

The device specific parameter field is contained in the mode parameter header (see 8.3.3). This field is reserved for scanner devices.

The density code field is contained in the mode parameter block descriptor (see table 8.3.3). This field is reserved for scanner devices.

The mode page codes for scanner devices are defined in table 296.

Table 296 - Mode page codes

+=============-==================================================-============+
|  Page code  |  Description                                     | Subclause  |
|-------------+--------------------------------------------------+------------|
|     0Ah     |  Control mode page                               |  8.3.3.1   |
|     02h     |  Disconnect-reconnect page                       |  8.3.3.2   |
|     03h     |  Measurement units page                          | 15.3.3.1   |
|     09h     |  Peripheral device page                          |  8.3.3.3   |
|     01h     |  Reserved                                        |            |
|  03h - 08h  |  Reserved                                        |            |
|  0Bh - 1Fh  |  Reserved                                        |            |
|     00h     |  Vendor-specific (does not require page format)  |            |
|  20h - 3Eh  |  Vendor-specific (page format required)          |            |
|     3Fh     |  Return all pages                                |            |
|             |     (valid only for the MODE SENSE command)      |            |
+=============================================================================+ 

15.3.3.1 Measurement units page

The measurement units page (see table 297) specifies the units of measurement used for calculating the displacement of window and for positioning an object.

The measurement units are independent of the horizontal and vertical scan resolutions.

Table 297 - Measurement units page

+=====-========-========-========-========-========-========-========-========+
|  Bit|   7    |   6    |   5    |   4    |   3    |   2    |   1    |   0    |
|Byte |        |        |        |        |        |        |        |        |
|=====+========+========+=====================================================|
| 0   |   PS   |Reserved|         Page code (03h)                             |
|-----+-----------------------------------------------------------------------|
| 1   |                           Parameter length (06h)                      |
|-----+-----------------------------------------------------------------------|
| 2   |                           Basic measurement unit                      |
|-----+-----------------------------------------------------------------------|
| 3   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 4   | (MSB)                                                                 |
|-----+---                        Measurement unit divisor                 ---|
| 5   |                                                                 (LSB) |
|-----+-----------------------------------------------------------------------|
| 6   |                           Reserved                                    |
|-----+-----------------------------------------------------------------------|
| 7   |                           Reserved                                    |
+=============================================================================+ 
The parameters savable (PS) bit is only used with the MODE SENSE command. This bit is reserved for the MODE SELECT command. A PS bit of one indicates that the target is capable of saving the page in a non-volatile vendor-specific location.

The basic measurement unit field is defined in table 298. Targets shall use inches as the default basic measurement unit.

Table 298 - Basic measurement units

+=============-===============+
|    Code     |  Description  |
|-------------+---------------|
|     00h     |  Inch         |
|     01h     |  Millimetre   |
|     02h     |  Point        |
|  03h - FFh  |  Reserved     |
+=============================+ 
The measurement unit divisor specifies the number of units needed to equal one basic measurement unit. Targets shall use 1200 as the default measurement unit divisor. If a value of zero is specified the target shall return CHECK CONDITION status and set the sense key to ILLEGAL REQUEST.

NOTE 194 A target that does not implement this page or only supports default values uses twelve hundredths (1/1200) of an inch as the unit of measure.

15.4 Definitions specific to scanner devices

15.4.1 base element line:

An x-axis displacement equal to zero.

15.4.2 base line:

An y-axis displacement equal to zero.

15.4.3 beginning-of-medium:

A x-axis and y-axis of zero displacement. Alternatively this is being positioned at the intersection of the base and scan lines.

15.4.4 end-of-medium:

The maximum x-axis and y-axis displacement.

15.4.5 image:

The digital result of a scan.

15.4.6 object:

The original or item being scanned.

15.4.7 pixel:

Picture-element, which is the smallest photo sight in the array.

15.4.8 platen:

The surface on which the target is positioned.

15.4.9 scan:

An operation that generates a digital image from the reflected light of an object.

15.4.10 scan line:

A y-axis displacement from the base line.

15.4.11 scanning range:

The total area that a scanner can generate an image from. For two dimensional objects this may correspond to the largest object that can be scanned.

15.4.12 window:

All or part of the scanning range of a scanner. A window defines the part of the object scanned.