National Instruments NI-488.2 User Manual page 74

National instruments user manual ni-488.2
Hide thumbs Also See for NI-488.2:
Table of Contents

Advertisement

if (ibsta & ERR)
printf ("ibnotify call failed.\n");
return 0;
}
while ((ReadingsTaken < 1000) && !(DeviceError))
// Your application does useful work here. For example, it
// might process the device readings or do any other useful work.
}
// disable notification
ibnotify (ud, 0, NULL, NULL);
// Call the ibonl function to disable the hardware and software.
ibonl (ud, 0);
return 1;
}
int __stdcall MyCallback (int LocalUd, int LocalIbsta, int LocalIberr,
long LocalIbcntl, void *RefData)
{
char SpollByte;
char ReadBuffer[40];
// If the ERR bit is set in LocalIbsta, then print an error
// message and return.
if (LocalIbsta & ERR)
printf ("GPIB error %d has occurred. No more callbacks.\n",
DeviceError = TRUE;
return 0;
}
// Read the serial poll byte from the device. If the ERR bit is set
// in ibsta, then print an error message and return.
LocalIbsta = ibrsp (LocalUd, &SpollByte);
if (LocalIbsta & ERR)
printf ("ibrsp failed. No more callbacks.\n");
DeviceError = TRUE;
return 0;
}
// If the returned status byte equals the expected response, then
// the device has valid data to send; otherwise it has a fault
© National Instruments Corporation
{
{
LocalIberr);
{
7-7
Chapter 7
NI-488.2 Programming Techniques
{
NI-488.2 User Manual for Windows

Advertisement

Table of Contents
loading

Table of Contents