Rockwell Automation 6008-SV2R VMEbus remote I/O Scanner User Manual

Page 146

Advertising
background image

Chapter

Programming the Scanner

8

8Ć12

/* poll for command result */
if (wait_for_cmdcmpl(chan) == FALSE) {

/* clear the semaphore */
unlock_gda(chan);
unmap_channel(chan);
fprintf(stdout, ”fdg: wait failure, lock cleared\n”);
return –2;

}

/* check autoconfigure result */
res = csa–>cnfstat;
if (res != 0) {

/* link status failed */
unlock_gda(chan);
unmap_channel(chan);
return (int) res;

}

/* place scan list size in autocfg structure */
linkcfg–>scanlist_len = csa–>datalen;

/* copy I/O adapter status word block to autocfg structure */
for (i = 0; i < ioaswblk_size; i++) {

linkcfg–>ioaswblk[i] = gda[i];

}

/* copy the scan list to the autocfg structure */
scanlist = (unsigned char far *) (&gda[ioaswblk_size]);
blockcpy(linkcfg–>scanlist, scanlist, (size_t) csa–>datalen);

/* clear the semaphore & unmap channel */
unlock_gda(chan);
unmap_channel(chan);
return (int) res;

}

Advertising
This manual is related to the following products: