Fault dependent group command – Rockwell Automation 6008-SV2R VMEbus remote I/O Scanner User Manual
Page 142
![background image](/manuals/580456/142/background.png)
Chapter
Programming the Scanner
8
8Ć8
FAULT DEPENDENT GROUP command
/*
**
** FAULTGROUP() –– configure 6008–SV2 channel fault–dependent groups
**
**
This function executes a FAULT GROUP command, using the fault group block provided
**
by the caller in the fdg_data parameter.
**
**
parameters:
pointer to channel structure
**
pointer to fdg_data structure
**
return values:
–1
= unable to lock general data area semaphore
**
–2
= did not get cmd–complete interrupt
**
ELSE
channel confirmation status word
**
*/
int
faultgroup (channel far *chan, fdg_data far *fdgcfg)
{
csa_data far
*csa;
unsigned short
fdgblk_size;
unsigned short
res;
/* map channel & establish pointers */
map_channel(chan);
csa = (csa_data far *) chan–>ControlStatusArea;
/* determine size of fault–dependent group block */
fdgblk_size = (unsigned short)
((chan–>ScannerMode == MODE_COMPATIBLE) ? SVC_FAULTGRP_SIZE :
SVS_FAULTGRP_SIZE);
/* get the semaphore */
if (lock_gda(chan) != 0) {
unmap_channel(chan);
fprintf(stdout, ”fdg: lock aquire FAILED\n”);
return –1;
}
/* set up the control/status area */
csa–>cnfstat = 0x000F;
/* confirmation status word */
csa–>cmd
= CMD_FDGROUP;
/* command word */
csa–>datalen = fdgblk_size;
/* length of data word */
/* copy the fault–dependent group data to the general data area */
blockcpy(chan–>GeneralDataArea, fdgcfg, (size_t) fdgblk_size);
/* send the command interrupt */
assert_cmd(chan);