I am using the device handle not the board handle.
following the code that I am using.
Please let me know if I am doing anything wrong.
Thanks
Praveen.
//Declaration of the call back function.
extern "C" int __stdcall MyCallback (int ud, int LocalIbsta, int LocalIberr, long LocalIbcntl, void *RefData);
main()
{
if ( (pcBoardId = ibfind("GPIB0")) < 0 )
{
Error Message
}
int tmOut = T10s;
ibtmo( cellBoardId, tmOut );
//S2Cell is the name of the device.
if ( (cellBoardId = ibfind("S2CELL")) < 0 )
{
Error meessage;
}
ibnotify(cellBoardId, RQS, MyCallback, NULL);
if (ibsta & ERR)
{
ibonl(cellBoardId, 0);
return (FAILURE);
}
}
//My call back function definition
int __stdcall MyCallback( int Localud
, int LocalIbsta, int LocalIberr, long LocalIbcntl, void *RefData)
{
char SpoolByte;
int expectedResponse = 0x40;
//Read the serial poll byte from the device. If the ERR bit is set
//in ibsta, then set the Variable DeviceError to ture and return.
LocalIbsta = ibrsp(Localud, &SpoolByte);
if (LocalIbsta & ERR)
{
DeviceError = true;
return 0;
}
//If the returned status byte equals the expected response, then the
//cell has the valid data to send; otherwise it has a fault condition to report.
if(SpoolByte != expectedResponse)
{
DeviceError = true;
return 0;
}
GPIBAsyncLink::dataToRead = 1;
pLink->ProcessLink();
return (RQS);
}