EasyManuals Logo
Home>National Instruments>Software>NI-488.2 NI-488.2

National Instruments NI-488.2 NI-488.2 User Manual

National Instruments NI-488.2 NI-488.2
134 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #81 background imageLoading...
Page #81 background image
Chapter 8 NI-488.2 Programming Techniques
© National Instruments Corporation 8-9 NI-488.2 User Manual
// Convert the data into a numeric value.
sscanf (ReadBuffer, "%f", &Readings[ReadingsTaken]);
// Display the data.
printf(“Reading : %f\n”, Readings[ReadingsTaken]);
ReadingsTaken += 1;
if (ReadingsTaken >= 1000) {
return 0;
}
else {
// Issue a request to the device to send the data and rearm
// callback on RQS.
LocalIbsta = ibwrt (LocalUd, "SEND DATA", 9L);
if (LocalIbsta & ERR) {
printf ("ibwrt failed. No more callbacks.\n");
DeviceError = TRUE;
return 0;
}
else {
return RQS;
}
}
}
Writing Multithreaded NI-488.2 Applications
If you are writing a multithreaded NI-488.2 application and you plan
to make all of your NI-488.2 calls from a single thread, you can safely
continue to use the traditional NI-488.2 global variables (
ibsta, iberr,
ibcnt, ibcntl). The NI-488.2 global variables are defined on a
per-process basis, so each process accesses its own copy of the NI-488.2
globals.
If you are writing a multithreaded NI-488.2 application and you plan to
make NI-488.2 calls from more than a single thread, you cannot safely
continue to use the traditional NI-488.2 global variables without some form
of synchronization (for example, semaphores, mutexes, critical sections).
To understand why, refer to the following example.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the National Instruments NI-488.2 NI-488.2 and is the answer not in the manual?

National Instruments NI-488.2 NI-488.2 Specifications

General IconGeneral
BrandNational Instruments
ModelNI-488.2 NI-488.2
CategorySoftware
LanguageEnglish