Download GPIB-SCSI-A User Manual

Transcript
G Mode Functions
Chapter 7
rcnct
(continued)
ibwrt (gpibscsia, "getscsi\n", 8);
/* Request the GPIB-SCSI-A to arbitrate for the
* SCSI bus.
*/
ibrd (gpibscsia, miscbuf, 100);
/* Get the response from the GPIB-SCSI-A. */
get_stat(&ibstat,&gpiberr,&scsierr,miscbuf);
/* Call a routine to connect the character
* strings representing numerical values to
* binary data.
*/
if (ibstat < 0)
/* The status would be negative if any form of
* error occurred with the GPIB or SCSI ports.
*/
processerr (ibstat)
/* If error, go and process it. */
else
{
ibwrt (gpibscsia, "selwa\n", 6);
/*
*
*
*
*
*
Continue with the operation. At each step
in the process, check the status as you did
after getscsi above. Because this does not
show anything new, it is not duplicated in
the remainder of this example. selwa causes
the GPIB-SCSI-A to attempt selecting a SCSI
GPIB-SCSI-A User Manual
7-54
© National Instruments Corp.