National Instruments NI-488.2M Software Reference Manual page 58

For os/2
Hide thumbs Also See for NI-488.2M:
Table of Contents

Advertisement

Developing Your Application
Chapter 3
Step 6. Read the Measurement
If the data is valid, read the measurement from the instrument.
(AsciiToFloat is a function that takes a null-terminated string as input and
outputs the floating point number it represents.)
ibrd (ud, rdbuf, 10L);
if (ibsta & ERR) {
gpiberr("ibrd error");
}
rdbuf[ibcntl] = '\0';
printf("Read: %s\n", rdbuf);
/*
Output ==> Read: +10.98E-3
*/
sum += AsciiToFloat(rdbuf);
Step 7. Process the Data
Repeat Steps 4 through 6 in a loop until 10 measurements have been read, then
print the average of the readings as shown:
printf("The average of the 10 readings is %f\n",
sum/10.0);
Step 8. Place the Device Offline
As a final step, take the device offline by using the ibonl function.
ibonl (ud, 0);
NI-488.2M SRM for OS/2
3-12
© National Instruments Corp.

Advertisement

Table of Contents
loading

Table of Contents