National Instruments NI-488.2M Software Reference Manual page 62

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

Advertisement

Developing Your Application
Step 3. Identify the Instrument
Send an identification query to each device for identification. For this example,
assume that all the instruments are IEEE 488.2 compatible and can accept the
identification query, *IDN?. In addition, assume that FindLstn found the
GPIB interface board at primary address 0 (default) and, therefore, you can skip
the first entry in the result array.
for (loop = 1; loop <= num_Listeners; loop++) {
Send(0, result[loop], "*IDN?", 5L, NLend);
if
(ibsta & ERR) {
gpiberr("Send error");
}
Receive(0, result[loop], buffer, 10L, STOPend);
if
(ibsta & ERR) {
gpiberr("Receive error");
}
buffer[ibcntl] = '\0';
printf("The instrument at address %d is a %s\n",
result[loop], buffer);
if (strncmp(buffer, "Fluke, 45", 9) == 0) {
fluke = result[loop];
printf("****
break;
}
}
if (loop > num_Listeners) {
printf("Did not find the Fluke!\n");
}
The constant NLend signals that the new line character with EOI is
automatically appended to the data to be sent.
The constant STOPend indicates that the read is stopped when EOI is detected.
NI-488.2M SRM for OS/2
Found the Fluke ****\n");
3-16
© National Instruments Corp.
Chapter 3

Advertisement

Table of Contents
loading

Table of Contents