G Mode Functions
Chapter 7
GPIB-SCSI-A User Manual
7-72
© National Instruments Corp.
read
(continued)
Example:
This example causes the GPIB-SCSI-A to read 10 blocks of data
beginning at Logical Block Address 100 from the Target with a SCSI
id of 4 and blocksize of 512 bytes.
ibwrt (gpibscsia, "stat c n\n", 9);
/* Request the GPIB-SCSI-A to report numerical
* status continuously.
*/
ibwrt (gpibscsia, "tid 4\n", 6);
/* Request to the GPIB-SCSI-A to communicate
* with SCSI Target with ID of 4.
*/
ibwrt (gpibscsia, "blksz 512\n", 10);
/* Tell the GPIB-SCSI-A that the drive has
* a blocksize of 512 bytes. This information
* can be found either in the documentation of
* the SCSI disk drive or by executing the SCSI
* MODE SENSE command either through a low-level
* command sequence or with the high-level mdsns
* command provided by the GPIB-SCSI-A.
*/
ibwrt (gpibscsia, "read 100, 10\n", 13);
/* Request the GPIB-SCSI-A to read data
* from the SCSI Target at ID 4. This command
* also tells the GPIB-SCSI-A that there are a
* total of 5120 bytes (blksz * transfer length,
* 10 * 512) transferred from the SCSI device to
* the GPIB-SCSI-A. Therefore, that is the least
* you are reading from the GPIB-SCSI-A
* over the GPIB.
*/