Sample Code:
struct sigaction sa;
ibconfig(gi488Card, IbcSC, 0);
ibconfig(gi488Card, IbcPAD, 2);
ibconfig(gi488Card, IbcSAD, 0);
ibconfig(gi488Card, IbcAUTOPOLL, 0);
/* Change to SIGUSR1 instead of default SIGINT.
** In this way the process does not catch Ctrl-C
*/
ibconfig(gi488Card, IbcSignalNumber, SIGUSR1);
ibconfig(gi488Card, IbcTMO, T1s);
memset(&sa, 0, sizeof(sa));
sa.sa_handler = &Sig_Handler;
sigaction(SIGUSR1, &sa, NULL);
/* Signal on GET OR (DCL | SDC) */
ibsgnl(gi488Card, (DTAS | DCAS));
The handler
void Sig_Handler(int SigNum)
{
/* Update the current status of ibsta */
ibwait(gi488Card, 0);
if (ibsta &
DCAS)
{
printf("Caught sig DCL or SDC!\n\n");
gMode = DCL;
}
else if (ibsta & DTAS)
{
printf("Caught sig GET!\n\n");
gMode = GET;
}
}
The problem is the handler always says "GET" never
"SDC" even though the handler will be invoked because of a ibclr() from the CIC.
How can I differentiate between the two events?
I am using a NI PCI-GBIB card under linux 2.4.8 kernel with the NI 0.8.1 driver.