Chapter 7
G Mode Functions
© National Instruments Corp.
7-19
GPIB-SCSI-A User Manual
dtin
(continued)
ibwrt (gpibscsia, "cmd #h8, #h0, #h0, #h1, #h1,
#h0\n", 33);
/* Build the SCSI Command Descriptor Block to
* execute the Group 0 READ command. Verify
* that the Target you select is in the Command
* phase before you issue this command. Analyze
* the status returned by the GPIB-SCSI-A or
* analyze the serial poll response byte of the
* GPIB-SCSI-A to do this.
*/
ibwrt (gpibscsia, "dtin\n", 5);
/* This alerts the GPIB-SCSI-A that you want to
* receive data into your GPIB port from the
* selected SCSI device.
*/
state = wt_rdy()
/* Wait for the GPIB-SCSI-A to request service.
* State then contains a value of either DCR
* (which indicates that the Target is in the
* Data In phase) or RDY (which indicates that
* the Target, due to some error, went into the
* Status phase).
*/
if (state == DCR)
{
ibrd (scsidev, databuf, 256);
/* Because the Data Channel is ready, read in
* the data.
*/
ibwrt (gpibscsia, "cmp\n", 4);