Chapter 3
Developing Your Application
© National Instruments Corp.
3-11
NI-488.2M UM for Windows NT
Writing Your NI-488.2 Application
This section discusses items you should include in an application program that uses
NI -488.2 routines, general program steps, and an NI-488.2 example. In this manual the
example code is presented in C using the standard C language interface. The NI-488.2M
software includes the source code for this example written in C (
samp4882.c
) and the
code for this example written to use direct entry to access the
gpib-32.dll
(
dll4882.c
).
The NI-488.2M software also includes the source code for nine application examples,
which are described in Chapter 2, Application Examples.
Items to Include
•
Include the appropriate GPIB header file. This file contains prototypes for the
NI-488.2 routines and constants that you can use in your application program.
•
Check for errors after each NI-488.2 routine call.
•
Declare and define a function to handle GPIB errors. This function takes the device
offline and closes the application. If the function is declared as:
void gpiberr (char * msg);
/* function prototype */
then your application invokes it as follows:
if (ibsta & ERR) {
gpiberr("GPIB error");
}